# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
9848 | 2014-10-01T15:07:32 Z | effserv | Uniting (kriii2_U) | C++ | 6 ms | 416 KB |
#include <cstdio> #include <algorithm> using namespace std; typedef long long ll; int main() { int N; scanf("%d", &N); ll a; scanf("%lld", &a); ll A = (ll)a; ll C = 0; for (int i = 0; i < N - 1; i++) { scanf("%lld", &a); C += A*a; A += a; } printf("%lld\n", C); ll mod = 1000000007; ll bigmod = 1e13; ll S = N; for (int i = N - 1; i >= 1; i--) { S *= (ll)i; S %= bigmod; S *= (ll)i; S %= bigmod; } printf("%lld\n", S%mod); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 0 ms | 348 KB | Partially correct |
2 | Partially correct | 0 ms | 348 KB | Partially correct |
3 | Partially correct | 0 ms | 344 KB | Partially correct |
4 | Partially correct | 0 ms | 348 KB | Partially correct |
5 | Partially correct | 0 ms | 348 KB | Partially correct |
6 | Partially correct | 0 ms | 348 KB | Partially correct |
7 | Partially correct | 0 ms | 348 KB | Partially correct |
8 | Partially correct | 0 ms | 348 KB | Partially correct |
9 | Partially correct | 0 ms | 348 KB | Partially correct |
10 | Partially correct | 1 ms | 348 KB | Partially correct |
11 | Partially correct | 1 ms | 348 KB | Partially correct |
12 | Partially correct | 0 ms | 348 KB | Partially correct |
13 | Partially correct | 0 ms | 348 KB | Partially correct |
14 | Partially correct | 1 ms | 348 KB | Partially correct |
15 | Partially correct | 1 ms | 348 KB | Partially correct |
16 | Partially correct | 1 ms | 348 KB | Partially correct |
17 | Partially correct | 1 ms | 348 KB | Partially correct |
18 | Partially correct | 1 ms | 348 KB | Partially correct |
19 | Partially correct | 1 ms | 348 KB | Partially correct |
20 | Partially correct | 1 ms | 412 KB | Partially correct |
21 | Partially correct | 2 ms | 348 KB | Partially correct |
22 | Partially correct | 2 ms | 348 KB | Partially correct |
23 | Partially correct | 2 ms | 348 KB | Partially correct |
24 | Partially correct | 1 ms | 348 KB | Partially correct |
25 | Partially correct | 2 ms | 348 KB | Partially correct |
26 | Partially correct | 2 ms | 348 KB | Partially correct |
27 | Partially correct | 2 ms | 348 KB | Partially correct |
28 | Partially correct | 2 ms | 344 KB | Partially correct |
29 | Partially correct | 2 ms | 348 KB | Partially correct |
30 | Partially correct | 2 ms | 344 KB | Partially correct |
31 | Partially correct | 2 ms | 348 KB | Partially correct |
32 | Partially correct | 3 ms | 348 KB | Partially correct |
33 | Partially correct | 3 ms | 348 KB | Partially correct |
34 | Partially correct | 3 ms | 344 KB | Partially correct |
35 | Partially correct | 3 ms | 348 KB | Partially correct |
36 | Partially correct | 3 ms | 388 KB | Partially correct |
37 | Partially correct | 3 ms | 344 KB | Partially correct |
38 | Partially correct | 3 ms | 344 KB | Partially correct |
39 | Partially correct | 3 ms | 344 KB | Partially correct |
40 | Partially correct | 4 ms | 348 KB | Partially correct |
41 | Partially correct | 5 ms | 360 KB | Partially correct |
42 | Partially correct | 4 ms | 348 KB | Partially correct |
43 | Partially correct | 5 ms | 416 KB | Partially correct |
44 | Partially correct | 5 ms | 348 KB | Partially correct |
45 | Partially correct | 6 ms | 348 KB | Partially correct |
46 | Partially correct | 6 ms | 348 KB | Partially correct |
47 | Partially correct | 5 ms | 348 KB | Partially correct |
48 | Partially correct | 4 ms | 348 KB | Partially correct |
49 | Partially correct | 5 ms | 348 KB | Partially correct |
50 | Partially correct | 5 ms | 348 KB | Partially correct |