Submission #9295

#TimeUsernameProblemLanguageResultExecution timeMemory
9295coreaUniting (kriii2_U)C++14
4 / 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; } for( int i = 1; i <= N; i ++ ) { s *= i; s %= 1000000007; } printf( "%lld\n", s ); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...