Submission #9566

#TimeUsernameProblemLanguageResultExecution timeMemory
9566yukarikoUniting (kriii2_U)C11
1 / 4
12 ms1360 KiB
#include <stdio.h> //#include <windows.h> int main() { int N; int s[100001]; long long cnt; long long sum; int i,j; cnt = 1; sum = 0; scanf("%d",&N); for(i=0;i<N;i++) scanf("%d",s+i); for(i=N;i>=2;i--) cnt *= i; for(i=N;i>2;i--) cnt*=2; for(i=0;i<N-1;i++) { sum += s[i]*s[i+1]; s[i+1] += s[i]; } cnt = cnt%1000000007; printf("%lld\n",sum); printf("%lld\n",cnt); //system("pause"); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...