Submission #22659

#TimeUsernameProblemLanguageResultExecution timeMemory
22659현우야 이거 플로우야 (#40)Fully Generate (KRIII5_FG)C++98
2 / 7
13 ms8928 KiB
#include <stdio.h> #define MOD 1000000007 long long int num[1000050]; long long int ans = 1; int main(){ int n = 0; //freopen("input.txt","r",stdin); scanf("%d",&n); for(int i = 1; i <= n; i++){ num[i] = 1 + num[i - num[num[i-1]]]; num[i]%=MOD; ans *= num[i]; ans%=MOD; } printf("%lld",ans); }

Compilation message (stderr)

FG.cpp: In function 'int main()':
FG.cpp:10:16: 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...