Loading the catalog…
Loading the catalog…
문제 해설 피보나치는 정말 많이 풀기도 하고 많은 강의에서 예시로 드는 대표적인 항목이라, 바로 풀었다. 가장 빠른 DP로 해결 코드 #include <string> #include <vector> using namespace std; int d[1'000'001]; int solution(int n) { const int div = 1234567; d[0] = 0; d[1] = 1; for(int i=2;i<=n;++i) { d[i] = (d[i-1] + d[i-2])%div; } return d[n] % div; }
What RADAR observed and classified to build this opportunity. It is what the source published, not a verification that the offer is still active.
[PS] 피보나치 수. 문제 해설 피보나치는 정말 많이 풀기도 하고 많은 강의에서 예시로 드는 대표적인 항목이라, 바로 풀었다. 가장 빠른 DP로 해결 코드 #include #include using namespace std; int d[1'000'001]; int solution(int n) { const int div = 1234567; d[0] = 0; d[1] = 1; for(int i=2;i<=n;++i) { d[i] = (d[i-1] + d[i-2])%div; } return d[n] % div; }
Open source