Submission #22625

#TimeUsernameProblemLanguageResultExecution timeMemory
22625JAESu_gak (#40)Fully Generate (KRIII5_FG)C++14
2 / 7
9 ms8928 KiB
#include<stdio.h> long long int n, garr[1000005], ans = 1; int main() { int i, j, k; scanf("%lld", &n); garr[1] = 1; garr[2] = 2; garr[3] = 2; k = 3; for (i = 3; i <= n; i++) { for (j = 1; j <= garr[i]; j++) { garr[++k] = i; if (k == n) break; } if (j != garr[i] + 1) break; } for (i = 1; i <= n; i++) ans = (ans*garr[i]) % 1000000007; printf("%lld", ans); }

Compilation message (stderr)

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