Submission #9280

#TimeUsernameProblemLanguageResultExecution timeMemory
9280coreaUniting (kriii2_U)C++14
1 / 4
12 ms1088 KiB
#include <stdio.h> int main() { int N; scanf( "%d", &N ); long long res = 0; long long s = 0; for( int i = 1; i <= N; i ++ ) { long long a; scanf( "%lld", &a ); res += s * a; s += a; } printf( "%lld\n", res ); s = 1; for( int i = 1; i <= N; i ++ ) { s *= i; s %= 1000000007; } printf( "%lld\n", s ); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...