Submission #22629

#TimeUsernameProblemLanguageResultExecution timeMemory
226292000/4000 (#40)Fully Generate (KRIII5_FG)C++14
2 / 7
9 ms5020 KiB
#include <cstdio> const int P = 1000'000'007; int N; int A[1000004]; int main() { scanf("%d", &N); if (N > 1000000) { puts("Too Big!"); return 0; } long long p = 1; A[1] = 1; for (int i = 1; i < N; ++i) { A[i + 1] = 1 + A[i + 1 - A[A[i]]]; p = p * A[i + 1] % P; } printf("%lld\n", p); return 0; }

Compilation message (stderr)

FG.cpp: In function 'int main()':
FG.cpp:8:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &N);
                 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...