# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
428734 | 2021-06-15T14:08:13 Z | Kevin_Zhang_TW | Aliens (IOI16_aliens) | C++17 | 2000 ms | 17420 KB |
#include <bits/stdc++.h> using namespace std; using ll = long long; #define pb emplace_back #define AI(i) begin(i), end(i) template<class T> bool chmin(T &a, T b) { return b < a && (a = b, true); } template<class T> bool chmax(T &a, T b) { return a < b && (a = b, true); } #ifdef KEV #define DE(args...) kout("[ " + string(#args) + " ] = ", args) void kout() { cerr << endl; } template<class T, class ...U> void kout(T a, U ...b) { cerr << a << ' ', kout(b...); } template<class T> void debug(T l, T r) { while (l != r) cerr << *l << " \n"[next(l)==r], ++l; } #else #define DE(...) 0 #define debug(...) 0 #endif const int MAX_N = 100010, MAX_K = 17; const ll inf = 1ll << 55; #include "aliens.h" ll sq(ll v) { return v * v; } vector<int> allc; void monolize(vector<int> &r, vector<int> &c, int &n) { for (int i = 0;i < n;++i) { if (r[i] > c[i]) swap(r[i], c[i]); } vector<pair<int,int>> loc; for (int i = 0;i < n;++i) loc.pb(c[i], r[i]); sort(AI(loc)); int sz = 0; for (auto [x, y] : loc) { while (sz) { auto [xx, yy] = loc[sz-1]; if (yy < y) break; --sz; } loc[sz++] = {x, y}; } loc.resize(sz); r.clear(), c.clear(); for (auto [x, y] : loc) r.pb(y), c.pb(x); n = r.size(); } ll sp[MAX_K][MAX_N]; ll qry(int l, int r) { int lg = __lg(r-l); return min(sp[lg][l], sp[lg][r - (1<<lg)]); } void init_rmq(int g, vector<int> r, vector<int> c) { vector<int> allc(c); allc.pb(-1); sort(AI(allc)), allc.erase(unique(AI(allc)), end(allc)); auto get_pos = [&](int c) -> int { return lower_bound(AI(allc), c) - begin(allc); }; fill(sp[0], sp[0] + g, inf); for (int i = 0;i < r.size();++i) { int j = get_pos(c[i]); chmin(sp[0][j], (ll)r[i]); //chmin(omn[j], (ll)r[i]); } for (int d = 1;d < MAX_K;++d) for (int i = 0;i < g;++i) sp[d][i] = min(sp[d-1][i], sp[d-1][ min(g-1, i + (1<<(d-1))) ]); } ll cost(int l, int i) { ll mnc = qry(l+1, i+1); ll wid = allc[i] - mnc + 1; ll rep = max<ll>(0, allc[l] - mnc + 1); return sq(wid) - sq(rep); } pair<ll,ll> get_dp(ll C, int g) { vector<ll> dp(g, inf); dp[0] = 0; vector<ll> cnt(g); deque<int> fr, ti; fr.pb(0), ti.pb(-1); for (int i = 1;i < g;++i) { if (ti.size() > 1 && ti[1] <= i) ti.pop_front(), fr.pop_front(); auto trans = [&](int l, int i) { return cost(l, i) + dp[l]; }; dp[i] = C + trans(fr[0], i); cnt[i] = cnt[ fr[0] ] + 1; auto better = [&](int a, int b) { int l = i+1, r = g, mid; while (l < r) { mid = l + r >> 1; if (trans(a, mid) < trans(b, mid)) r = mid; else l = mid+1; } return l; }; while (fr.size() > 1) { int nt = better(i, fr.back()); if (nt > ti.back()) break; fr.pop_back(), ti.pop_back(); } int nt = better(i, fr.back()); fr.pb(i), ti.pb(nt); } return make_pair(cnt[g-1], dp[g-1]); } long long take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) { monolize(r, c, n); allc = c; allc.pb(-1); sort(AI(allc)), allc.erase(unique(AI(allc)), end(allc)); int g = allc.size(); init_rmq(g, r, c); ll L = 0, R = 1ll << 40, M; { auto [u, w] = get_dp(0, g); if (u <= k) return w; } while (L < R) { M = L + R >> 1; auto [u, w] = get_dp(M, g); if (u > k) L = M+1; else R = M; } auto [u, w] = get_dp(L, g); return w - L * k; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
2 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
3 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
4 | Correct | 1 ms | 332 KB | Correct answer: answer = 12 |
5 | Correct | 1 ms | 332 KB | Correct answer: answer = 52 |
6 | Correct | 1 ms | 332 KB | Correct answer: answer = 210 |
7 | Correct | 1 ms | 332 KB | Correct answer: answer = 88 |
8 | Correct | 1 ms | 332 KB | Correct answer: answer = 7696 |
9 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
10 | Correct | 1 ms | 332 KB | Correct answer: answer = 2374 |
11 | Correct | 1 ms | 332 KB | Correct answer: answer = 9502 |
12 | Correct | 1 ms | 332 KB | Correct answer: answer = 49 |
13 | Correct | 1 ms | 296 KB | Correct answer: answer = 151 |
14 | Correct | 1 ms | 332 KB | Correct answer: answer = 7550 |
15 | Correct | 1 ms | 332 KB | Correct answer: answer = 7220 |
16 | Correct | 1 ms | 332 KB | Correct answer: answer = 7550 |
17 | Correct | 1 ms | 332 KB | Correct answer: answer = 10000 |
18 | Correct | 1 ms | 332 KB | Correct answer: answer = 10000 |
19 | Correct | 1 ms | 332 KB | Correct answer: answer = 624 |
20 | Correct | 1 ms | 332 KB | Correct answer: answer = 10000 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
2 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
3 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
4 | Correct | 1 ms | 332 KB | Correct answer: answer = 5 |
5 | Correct | 1 ms | 332 KB | Correct answer: answer = 41 |
6 | Correct | 1 ms | 332 KB | Correct answer: answer = 71923 |
7 | Correct | 3 ms | 332 KB | Correct answer: answer = 77137 |
8 | Correct | 5 ms | 332 KB | Correct answer: answer = 764 |
9 | Correct | 6 ms | 460 KB | Correct answer: answer = 250000 |
10 | Correct | 1 ms | 460 KB | Correct answer: answer = 500 |
11 | Correct | 1 ms | 332 KB | Correct answer: answer = 32 |
12 | Correct | 7 ms | 332 KB | Correct answer: answer = 130050 |
13 | Correct | 7 ms | 332 KB | Correct answer: answer = 5110 |
14 | Correct | 3 ms | 332 KB | Correct answer: answer = 2626 |
15 | Correct | 3 ms | 332 KB | Correct answer: answer = 796 |
16 | Correct | 9 ms | 460 KB | Correct answer: answer = 7580 |
17 | Correct | 9 ms | 460 KB | Correct answer: answer = 1904 |
18 | Correct | 6 ms | 332 KB | Correct answer: answer = 996004 |
19 | Correct | 6 ms | 332 KB | Correct answer: answer = 38817 |
20 | Correct | 6 ms | 332 KB | Correct answer: answer = 4096 |
21 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
22 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
23 | Correct | 6 ms | 460 KB | Correct answer: answer = 2040 |
24 | Correct | 1 ms | 332 KB | Correct answer: answer = 2 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
2 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
3 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
4 | Correct | 1 ms | 332 KB | Correct answer: answer = 12 |
5 | Correct | 1 ms | 332 KB | Correct answer: answer = 52 |
6 | Correct | 1 ms | 332 KB | Correct answer: answer = 210 |
7 | Correct | 1 ms | 332 KB | Correct answer: answer = 88 |
8 | Correct | 1 ms | 332 KB | Correct answer: answer = 7696 |
9 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
10 | Correct | 1 ms | 332 KB | Correct answer: answer = 2374 |
11 | Correct | 1 ms | 332 KB | Correct answer: answer = 9502 |
12 | Correct | 1 ms | 332 KB | Correct answer: answer = 49 |
13 | Correct | 1 ms | 296 KB | Correct answer: answer = 151 |
14 | Correct | 1 ms | 332 KB | Correct answer: answer = 7550 |
15 | Correct | 1 ms | 332 KB | Correct answer: answer = 7220 |
16 | Correct | 1 ms | 332 KB | Correct answer: answer = 7550 |
17 | Correct | 1 ms | 332 KB | Correct answer: answer = 10000 |
18 | Correct | 1 ms | 332 KB | Correct answer: answer = 10000 |
19 | Correct | 1 ms | 332 KB | Correct answer: answer = 624 |
20 | Correct | 1 ms | 332 KB | Correct answer: answer = 10000 |
21 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
22 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
23 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
24 | Correct | 1 ms | 332 KB | Correct answer: answer = 5 |
25 | Correct | 1 ms | 332 KB | Correct answer: answer = 41 |
26 | Correct | 1 ms | 332 KB | Correct answer: answer = 71923 |
27 | Correct | 3 ms | 332 KB | Correct answer: answer = 77137 |
28 | Correct | 5 ms | 332 KB | Correct answer: answer = 764 |
29 | Correct | 6 ms | 460 KB | Correct answer: answer = 250000 |
30 | Correct | 1 ms | 460 KB | Correct answer: answer = 500 |
31 | Correct | 1 ms | 332 KB | Correct answer: answer = 32 |
32 | Correct | 7 ms | 332 KB | Correct answer: answer = 130050 |
33 | Correct | 7 ms | 332 KB | Correct answer: answer = 5110 |
34 | Correct | 3 ms | 332 KB | Correct answer: answer = 2626 |
35 | Correct | 3 ms | 332 KB | Correct answer: answer = 796 |
36 | Correct | 9 ms | 460 KB | Correct answer: answer = 7580 |
37 | Correct | 9 ms | 460 KB | Correct answer: answer = 1904 |
38 | Correct | 6 ms | 332 KB | Correct answer: answer = 996004 |
39 | Correct | 6 ms | 332 KB | Correct answer: answer = 38817 |
40 | Correct | 6 ms | 332 KB | Correct answer: answer = 4096 |
41 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
42 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
43 | Correct | 6 ms | 460 KB | Correct answer: answer = 2040 |
44 | Correct | 1 ms | 332 KB | Correct answer: answer = 2 |
45 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
46 | Correct | 1 ms | 332 KB | Correct answer: answer = 9 |
47 | Correct | 1 ms | 332 KB | Correct answer: answer = 9 |
48 | Correct | 1 ms | 332 KB | Correct answer: answer = 21 |
49 | Correct | 1 ms | 332 KB | Correct answer: answer = 71 |
50 | Correct | 1 ms | 332 KB | Correct answer: answer = 77 |
51 | Correct | 1 ms | 332 KB | Correct answer: answer = 400 |
52 | Correct | 1 ms | 332 KB | Correct answer: answer = 996004 |
53 | Correct | 1 ms | 332 KB | Correct answer: answer = 997310 |
54 | Correct | 1 ms | 332 KB | Correct answer: answer = 990781 |
55 | Correct | 1 ms | 332 KB | Correct answer: answer = 996545 |
56 | Correct | 1 ms | 332 KB | Correct answer: answer = 484 |
57 | Correct | 1 ms | 332 KB | Correct answer: answer = 484 |
58 | Correct | 7 ms | 456 KB | Correct answer: answer = 63501 |
59 | Correct | 8 ms | 460 KB | Correct answer: answer = 323501 |
60 | Correct | 6 ms | 332 KB | Correct answer: answer = 752500 |
61 | Correct | 3 ms | 332 KB | Correct answer: answer = 761480 |
62 | Correct | 3 ms | 332 KB | Correct answer: answer = 758932 |
63 | Correct | 1 ms | 332 KB | Correct answer: answer = 1000000 |
64 | Correct | 1 ms | 460 KB | Correct answer: answer = 750500 |
65 | Correct | 1 ms | 332 KB | Correct answer: answer = 1000000 |
66 | Correct | 1 ms | 332 KB | Correct answer: answer = 250000 |
67 | Correct | 1 ms | 332 KB | Correct answer: answer = 250000 |
68 | Correct | 1 ms | 332 KB | Correct answer: answer = 1000000 |
69 | Correct | 1 ms | 332 KB | Correct answer: answer = 994009 |
70 | Correct | 3 ms | 332 KB | Correct answer: answer = 59315 |
71 | Correct | 2 ms | 332 KB | Correct answer: answer = 25454 |
72 | Correct | 4 ms | 332 KB | Correct answer: answer = 1504 |
73 | Correct | 2 ms | 332 KB | Correct answer: answer = 37486 |
74 | Correct | 3 ms | 332 KB | Correct answer: answer = 4284 |
75 | Correct | 1 ms | 332 KB | Correct answer: answer = 158008 |
76 | Correct | 1 ms | 352 KB | Correct answer: answer = 51860 |
77 | Correct | 2 ms | 332 KB | Correct answer: answer = 12985 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
2 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
3 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
4 | Correct | 1 ms | 332 KB | Correct answer: answer = 12 |
5 | Correct | 1 ms | 332 KB | Correct answer: answer = 52 |
6 | Correct | 1 ms | 332 KB | Correct answer: answer = 210 |
7 | Correct | 1 ms | 332 KB | Correct answer: answer = 88 |
8 | Correct | 1 ms | 332 KB | Correct answer: answer = 7696 |
9 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
10 | Correct | 1 ms | 332 KB | Correct answer: answer = 2374 |
11 | Correct | 1 ms | 332 KB | Correct answer: answer = 9502 |
12 | Correct | 1 ms | 332 KB | Correct answer: answer = 49 |
13 | Correct | 1 ms | 296 KB | Correct answer: answer = 151 |
14 | Correct | 1 ms | 332 KB | Correct answer: answer = 7550 |
15 | Correct | 1 ms | 332 KB | Correct answer: answer = 7220 |
16 | Correct | 1 ms | 332 KB | Correct answer: answer = 7550 |
17 | Correct | 1 ms | 332 KB | Correct answer: answer = 10000 |
18 | Correct | 1 ms | 332 KB | Correct answer: answer = 10000 |
19 | Correct | 1 ms | 332 KB | Correct answer: answer = 624 |
20 | Correct | 1 ms | 332 KB | Correct answer: answer = 10000 |
21 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
22 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
23 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
24 | Correct | 1 ms | 332 KB | Correct answer: answer = 5 |
25 | Correct | 1 ms | 332 KB | Correct answer: answer = 41 |
26 | Correct | 1 ms | 332 KB | Correct answer: answer = 71923 |
27 | Correct | 3 ms | 332 KB | Correct answer: answer = 77137 |
28 | Correct | 5 ms | 332 KB | Correct answer: answer = 764 |
29 | Correct | 6 ms | 460 KB | Correct answer: answer = 250000 |
30 | Correct | 1 ms | 460 KB | Correct answer: answer = 500 |
31 | Correct | 1 ms | 332 KB | Correct answer: answer = 32 |
32 | Correct | 7 ms | 332 KB | Correct answer: answer = 130050 |
33 | Correct | 7 ms | 332 KB | Correct answer: answer = 5110 |
34 | Correct | 3 ms | 332 KB | Correct answer: answer = 2626 |
35 | Correct | 3 ms | 332 KB | Correct answer: answer = 796 |
36 | Correct | 9 ms | 460 KB | Correct answer: answer = 7580 |
37 | Correct | 9 ms | 460 KB | Correct answer: answer = 1904 |
38 | Correct | 6 ms | 332 KB | Correct answer: answer = 996004 |
39 | Correct | 6 ms | 332 KB | Correct answer: answer = 38817 |
40 | Correct | 6 ms | 332 KB | Correct answer: answer = 4096 |
41 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
42 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
43 | Correct | 6 ms | 460 KB | Correct answer: answer = 2040 |
44 | Correct | 1 ms | 332 KB | Correct answer: answer = 2 |
45 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
46 | Correct | 1 ms | 332 KB | Correct answer: answer = 9 |
47 | Correct | 1 ms | 332 KB | Correct answer: answer = 9 |
48 | Correct | 1 ms | 332 KB | Correct answer: answer = 21 |
49 | Correct | 1 ms | 332 KB | Correct answer: answer = 71 |
50 | Correct | 1 ms | 332 KB | Correct answer: answer = 77 |
51 | Correct | 1 ms | 332 KB | Correct answer: answer = 400 |
52 | Correct | 1 ms | 332 KB | Correct answer: answer = 996004 |
53 | Correct | 1 ms | 332 KB | Correct answer: answer = 997310 |
54 | Correct | 1 ms | 332 KB | Correct answer: answer = 990781 |
55 | Correct | 1 ms | 332 KB | Correct answer: answer = 996545 |
56 | Correct | 1 ms | 332 KB | Correct answer: answer = 484 |
57 | Correct | 1 ms | 332 KB | Correct answer: answer = 484 |
58 | Correct | 7 ms | 456 KB | Correct answer: answer = 63501 |
59 | Correct | 8 ms | 460 KB | Correct answer: answer = 323501 |
60 | Correct | 6 ms | 332 KB | Correct answer: answer = 752500 |
61 | Correct | 3 ms | 332 KB | Correct answer: answer = 761480 |
62 | Correct | 3 ms | 332 KB | Correct answer: answer = 758932 |
63 | Correct | 1 ms | 332 KB | Correct answer: answer = 1000000 |
64 | Correct | 1 ms | 460 KB | Correct answer: answer = 750500 |
65 | Correct | 1 ms | 332 KB | Correct answer: answer = 1000000 |
66 | Correct | 1 ms | 332 KB | Correct answer: answer = 250000 |
67 | Correct | 1 ms | 332 KB | Correct answer: answer = 250000 |
68 | Correct | 1 ms | 332 KB | Correct answer: answer = 1000000 |
69 | Correct | 1 ms | 332 KB | Correct answer: answer = 994009 |
70 | Correct | 3 ms | 332 KB | Correct answer: answer = 59315 |
71 | Correct | 2 ms | 332 KB | Correct answer: answer = 25454 |
72 | Correct | 4 ms | 332 KB | Correct answer: answer = 1504 |
73 | Correct | 2 ms | 332 KB | Correct answer: answer = 37486 |
74 | Correct | 3 ms | 332 KB | Correct answer: answer = 4284 |
75 | Correct | 1 ms | 332 KB | Correct answer: answer = 158008 |
76 | Correct | 1 ms | 352 KB | Correct answer: answer = 51860 |
77 | Correct | 2 ms | 332 KB | Correct answer: answer = 12985 |
78 | Correct | 2 ms | 460 KB | Correct answer: answer = 997864126212 |
79 | Correct | 2 ms | 460 KB | Correct answer: answer = 998608411647 |
80 | Correct | 2 ms | 460 KB | Correct answer: answer = 995265560477 |
81 | Correct | 69 ms | 972 KB | Correct answer: answer = 10125000 |
82 | Correct | 69 ms | 1064 KB | Correct answer: answer = 2291668 |
83 | Correct | 29 ms | 716 KB | Correct answer: answer = 42388 |
84 | Correct | 30 ms | 716 KB | Correct answer: answer = 10318 |
85 | Correct | 30 ms | 748 KB | Correct answer: answer = 3416 |
86 | Correct | 96 ms | 1072 KB | Correct answer: answer = 331708193881 |
87 | Correct | 112 ms | 1056 KB | Correct answer: answer = 2861193756 |
88 | Correct | 80 ms | 972 KB | Correct answer: answer = 114646930 |
89 | Correct | 63 ms | 972 KB | Correct answer: answer = 9280921 |
90 | Correct | 62 ms | 972 KB | Correct answer: answer = 999984053400 |
91 | Correct | 105 ms | 1052 KB | Correct answer: answer = 750935949134 |
92 | Correct | 1 ms | 460 KB | Correct answer: answer = 1000000000000 |
93 | Correct | 2 ms | 460 KB | Correct answer: answer = 998762383161 |
94 | Correct | 99 ms | 972 KB | Correct answer: answer = 23017412908 |
95 | Correct | 2 ms | 460 KB | Correct answer: answer = 728143410622 |
96 | Correct | 2 ms | 460 KB | Correct answer: answer = 2 |
97 | Correct | 69 ms | 972 KB | Correct answer: answer = 1824916 |
98 | Correct | 79 ms | 972 KB | Correct answer: answer = 10680029 |
99 | Correct | 75 ms | 972 KB | Correct answer: answer = 18351700 |
100 | Correct | 67 ms | 972 KB | Correct answer: answer = 16040026 |
101 | Correct | 8 ms | 460 KB | Correct answer: answer = 253968628325 |
102 | Correct | 32 ms | 716 KB | Correct answer: answer = 10267 |
103 | Correct | 68 ms | 1068 KB | Correct answer: answer = 2582408 |
104 | Correct | 2 ms | 460 KB | Correct answer: answer = 78024964781 |
105 | Correct | 2 ms | 460 KB | Correct answer: answer = 9866346457 |
106 | Correct | 8 ms | 460 KB | Correct answer: answer = 3327720949 |
107 | Correct | 2 ms | 460 KB | Correct answer: answer = 86064128360 |
108 | Correct | 2 ms | 588 KB | Correct answer: answer = 12698259150 |
109 | Correct | 54 ms | 936 KB | Correct answer: answer = 1185259288 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
2 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
3 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
4 | Correct | 1 ms | 332 KB | Correct answer: answer = 12 |
5 | Correct | 1 ms | 332 KB | Correct answer: answer = 52 |
6 | Correct | 1 ms | 332 KB | Correct answer: answer = 210 |
7 | Correct | 1 ms | 332 KB | Correct answer: answer = 88 |
8 | Correct | 1 ms | 332 KB | Correct answer: answer = 7696 |
9 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
10 | Correct | 1 ms | 332 KB | Correct answer: answer = 2374 |
11 | Correct | 1 ms | 332 KB | Correct answer: answer = 9502 |
12 | Correct | 1 ms | 332 KB | Correct answer: answer = 49 |
13 | Correct | 1 ms | 296 KB | Correct answer: answer = 151 |
14 | Correct | 1 ms | 332 KB | Correct answer: answer = 7550 |
15 | Correct | 1 ms | 332 KB | Correct answer: answer = 7220 |
16 | Correct | 1 ms | 332 KB | Correct answer: answer = 7550 |
17 | Correct | 1 ms | 332 KB | Correct answer: answer = 10000 |
18 | Correct | 1 ms | 332 KB | Correct answer: answer = 10000 |
19 | Correct | 1 ms | 332 KB | Correct answer: answer = 624 |
20 | Correct | 1 ms | 332 KB | Correct answer: answer = 10000 |
21 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
22 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
23 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
24 | Correct | 1 ms | 332 KB | Correct answer: answer = 5 |
25 | Correct | 1 ms | 332 KB | Correct answer: answer = 41 |
26 | Correct | 1 ms | 332 KB | Correct answer: answer = 71923 |
27 | Correct | 3 ms | 332 KB | Correct answer: answer = 77137 |
28 | Correct | 5 ms | 332 KB | Correct answer: answer = 764 |
29 | Correct | 6 ms | 460 KB | Correct answer: answer = 250000 |
30 | Correct | 1 ms | 460 KB | Correct answer: answer = 500 |
31 | Correct | 1 ms | 332 KB | Correct answer: answer = 32 |
32 | Correct | 7 ms | 332 KB | Correct answer: answer = 130050 |
33 | Correct | 7 ms | 332 KB | Correct answer: answer = 5110 |
34 | Correct | 3 ms | 332 KB | Correct answer: answer = 2626 |
35 | Correct | 3 ms | 332 KB | Correct answer: answer = 796 |
36 | Correct | 9 ms | 460 KB | Correct answer: answer = 7580 |
37 | Correct | 9 ms | 460 KB | Correct answer: answer = 1904 |
38 | Correct | 6 ms | 332 KB | Correct answer: answer = 996004 |
39 | Correct | 6 ms | 332 KB | Correct answer: answer = 38817 |
40 | Correct | 6 ms | 332 KB | Correct answer: answer = 4096 |
41 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
42 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
43 | Correct | 6 ms | 460 KB | Correct answer: answer = 2040 |
44 | Correct | 1 ms | 332 KB | Correct answer: answer = 2 |
45 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
46 | Correct | 1 ms | 332 KB | Correct answer: answer = 9 |
47 | Correct | 1 ms | 332 KB | Correct answer: answer = 9 |
48 | Correct | 1 ms | 332 KB | Correct answer: answer = 21 |
49 | Correct | 1 ms | 332 KB | Correct answer: answer = 71 |
50 | Correct | 1 ms | 332 KB | Correct answer: answer = 77 |
51 | Correct | 1 ms | 332 KB | Correct answer: answer = 400 |
52 | Correct | 1 ms | 332 KB | Correct answer: answer = 996004 |
53 | Correct | 1 ms | 332 KB | Correct answer: answer = 997310 |
54 | Correct | 1 ms | 332 KB | Correct answer: answer = 990781 |
55 | Correct | 1 ms | 332 KB | Correct answer: answer = 996545 |
56 | Correct | 1 ms | 332 KB | Correct answer: answer = 484 |
57 | Correct | 1 ms | 332 KB | Correct answer: answer = 484 |
58 | Correct | 7 ms | 456 KB | Correct answer: answer = 63501 |
59 | Correct | 8 ms | 460 KB | Correct answer: answer = 323501 |
60 | Correct | 6 ms | 332 KB | Correct answer: answer = 752500 |
61 | Correct | 3 ms | 332 KB | Correct answer: answer = 761480 |
62 | Correct | 3 ms | 332 KB | Correct answer: answer = 758932 |
63 | Correct | 1 ms | 332 KB | Correct answer: answer = 1000000 |
64 | Correct | 1 ms | 460 KB | Correct answer: answer = 750500 |
65 | Correct | 1 ms | 332 KB | Correct answer: answer = 1000000 |
66 | Correct | 1 ms | 332 KB | Correct answer: answer = 250000 |
67 | Correct | 1 ms | 332 KB | Correct answer: answer = 250000 |
68 | Correct | 1 ms | 332 KB | Correct answer: answer = 1000000 |
69 | Correct | 1 ms | 332 KB | Correct answer: answer = 994009 |
70 | Correct | 3 ms | 332 KB | Correct answer: answer = 59315 |
71 | Correct | 2 ms | 332 KB | Correct answer: answer = 25454 |
72 | Correct | 4 ms | 332 KB | Correct answer: answer = 1504 |
73 | Correct | 2 ms | 332 KB | Correct answer: answer = 37486 |
74 | Correct | 3 ms | 332 KB | Correct answer: answer = 4284 |
75 | Correct | 1 ms | 332 KB | Correct answer: answer = 158008 |
76 | Correct | 1 ms | 352 KB | Correct answer: answer = 51860 |
77 | Correct | 2 ms | 332 KB | Correct answer: answer = 12985 |
78 | Correct | 2 ms | 460 KB | Correct answer: answer = 997864126212 |
79 | Correct | 2 ms | 460 KB | Correct answer: answer = 998608411647 |
80 | Correct | 2 ms | 460 KB | Correct answer: answer = 995265560477 |
81 | Correct | 69 ms | 972 KB | Correct answer: answer = 10125000 |
82 | Correct | 69 ms | 1064 KB | Correct answer: answer = 2291668 |
83 | Correct | 29 ms | 716 KB | Correct answer: answer = 42388 |
84 | Correct | 30 ms | 716 KB | Correct answer: answer = 10318 |
85 | Correct | 30 ms | 748 KB | Correct answer: answer = 3416 |
86 | Correct | 96 ms | 1072 KB | Correct answer: answer = 331708193881 |
87 | Correct | 112 ms | 1056 KB | Correct answer: answer = 2861193756 |
88 | Correct | 80 ms | 972 KB | Correct answer: answer = 114646930 |
89 | Correct | 63 ms | 972 KB | Correct answer: answer = 9280921 |
90 | Correct | 62 ms | 972 KB | Correct answer: answer = 999984053400 |
91 | Correct | 105 ms | 1052 KB | Correct answer: answer = 750935949134 |
92 | Correct | 1 ms | 460 KB | Correct answer: answer = 1000000000000 |
93 | Correct | 2 ms | 460 KB | Correct answer: answer = 998762383161 |
94 | Correct | 99 ms | 972 KB | Correct answer: answer = 23017412908 |
95 | Correct | 2 ms | 460 KB | Correct answer: answer = 728143410622 |
96 | Correct | 2 ms | 460 KB | Correct answer: answer = 2 |
97 | Correct | 69 ms | 972 KB | Correct answer: answer = 1824916 |
98 | Correct | 79 ms | 972 KB | Correct answer: answer = 10680029 |
99 | Correct | 75 ms | 972 KB | Correct answer: answer = 18351700 |
100 | Correct | 67 ms | 972 KB | Correct answer: answer = 16040026 |
101 | Correct | 8 ms | 460 KB | Correct answer: answer = 253968628325 |
102 | Correct | 32 ms | 716 KB | Correct answer: answer = 10267 |
103 | Correct | 68 ms | 1068 KB | Correct answer: answer = 2582408 |
104 | Correct | 2 ms | 460 KB | Correct answer: answer = 78024964781 |
105 | Correct | 2 ms | 460 KB | Correct answer: answer = 9866346457 |
106 | Correct | 8 ms | 460 KB | Correct answer: answer = 3327720949 |
107 | Correct | 2 ms | 460 KB | Correct answer: answer = 86064128360 |
108 | Correct | 2 ms | 588 KB | Correct answer: answer = 12698259150 |
109 | Correct | 54 ms | 936 KB | Correct answer: answer = 1185259288 |
110 | Correct | 18 ms | 1736 KB | Correct answer: answer = 999889968863 |
111 | Correct | 18 ms | 1736 KB | Correct answer: answer = 999861384931 |
112 | Correct | 19 ms | 1736 KB | Correct answer: answer = 999811809929 |
113 | Correct | 18 ms | 1736 KB | Correct answer: answer = 999869756441 |
114 | Correct | 1168 ms | 8976 KB | Correct answer: answer = 1700000000 |
115 | Correct | 1125 ms | 8980 KB | Correct answer: answer = 131666670 |
116 | Correct | 338 ms | 3392 KB | Correct answer: answer = 89478486 |
117 | Correct | 300 ms | 3228 KB | Correct answer: answer = 4971040 |
118 | Correct | 316 ms | 3396 KB | Correct answer: answer = 2711494 |
119 | Correct | 1032 ms | 8976 KB | Correct answer: answer = 25252530 |
120 | Correct | 1041 ms | 8980 KB | Correct answer: answer = 62500000 |
121 | Correct | 1719 ms | 8780 KB | Correct answer: answer = 333175097780 |
122 | Correct | 1838 ms | 8776 KB | Correct answer: answer = 33121180179 |
123 | Correct | 1956 ms | 8788 KB | Correct answer: answer = 9802314015 |
124 | Correct | 1038 ms | 8976 KB | Correct answer: answer = 32567551 |
125 | Correct | 1002 ms | 8860 KB | Correct answer: answer = 997525000000 |
126 | Correct | 1547 ms | 8368 KB | Correct answer: answer = 752723538884 |
127 | Correct | 13 ms | 1736 KB | Correct answer: answer = 1000000000000 |
128 | Correct | 17 ms | 1736 KB | Correct answer: answer = 999978000121 |
129 | Correct | 20 ms | 1736 KB | Correct answer: answer = 745986144735 |
130 | Correct | 15 ms | 1736 KB | Correct answer: answer = 2 |
131 | Correct | 1138 ms | 8904 KB | Correct answer: answer = 277966670 |
132 | Correct | 1159 ms | 9012 KB | Correct answer: answer = 2500900082 |
133 | Correct | 149 ms | 2152 KB | Correct answer: answer = 301248349636 |
134 | Correct | 604 ms | 4832 KB | Correct answer: answer = 14118891 |
135 | Correct | 20 ms | 1736 KB | Correct answer: answer = 14384977265 |
136 | Correct | 33 ms | 1720 KB | Correct answer: answer = 3681368330 |
137 | Correct | 28 ms | 1736 KB | Correct answer: answer = 2720316816 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
2 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
3 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
4 | Correct | 1 ms | 332 KB | Correct answer: answer = 12 |
5 | Correct | 1 ms | 332 KB | Correct answer: answer = 52 |
6 | Correct | 1 ms | 332 KB | Correct answer: answer = 210 |
7 | Correct | 1 ms | 332 KB | Correct answer: answer = 88 |
8 | Correct | 1 ms | 332 KB | Correct answer: answer = 7696 |
9 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
10 | Correct | 1 ms | 332 KB | Correct answer: answer = 2374 |
11 | Correct | 1 ms | 332 KB | Correct answer: answer = 9502 |
12 | Correct | 1 ms | 332 KB | Correct answer: answer = 49 |
13 | Correct | 1 ms | 296 KB | Correct answer: answer = 151 |
14 | Correct | 1 ms | 332 KB | Correct answer: answer = 7550 |
15 | Correct | 1 ms | 332 KB | Correct answer: answer = 7220 |
16 | Correct | 1 ms | 332 KB | Correct answer: answer = 7550 |
17 | Correct | 1 ms | 332 KB | Correct answer: answer = 10000 |
18 | Correct | 1 ms | 332 KB | Correct answer: answer = 10000 |
19 | Correct | 1 ms | 332 KB | Correct answer: answer = 624 |
20 | Correct | 1 ms | 332 KB | Correct answer: answer = 10000 |
21 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
22 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
23 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
24 | Correct | 1 ms | 332 KB | Correct answer: answer = 5 |
25 | Correct | 1 ms | 332 KB | Correct answer: answer = 41 |
26 | Correct | 1 ms | 332 KB | Correct answer: answer = 71923 |
27 | Correct | 3 ms | 332 KB | Correct answer: answer = 77137 |
28 | Correct | 5 ms | 332 KB | Correct answer: answer = 764 |
29 | Correct | 6 ms | 460 KB | Correct answer: answer = 250000 |
30 | Correct | 1 ms | 460 KB | Correct answer: answer = 500 |
31 | Correct | 1 ms | 332 KB | Correct answer: answer = 32 |
32 | Correct | 7 ms | 332 KB | Correct answer: answer = 130050 |
33 | Correct | 7 ms | 332 KB | Correct answer: answer = 5110 |
34 | Correct | 3 ms | 332 KB | Correct answer: answer = 2626 |
35 | Correct | 3 ms | 332 KB | Correct answer: answer = 796 |
36 | Correct | 9 ms | 460 KB | Correct answer: answer = 7580 |
37 | Correct | 9 ms | 460 KB | Correct answer: answer = 1904 |
38 | Correct | 6 ms | 332 KB | Correct answer: answer = 996004 |
39 | Correct | 6 ms | 332 KB | Correct answer: answer = 38817 |
40 | Correct | 6 ms | 332 KB | Correct answer: answer = 4096 |
41 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
42 | Correct | 1 ms | 332 KB | Correct answer: answer = 1 |
43 | Correct | 6 ms | 460 KB | Correct answer: answer = 2040 |
44 | Correct | 1 ms | 332 KB | Correct answer: answer = 2 |
45 | Correct | 1 ms | 332 KB | Correct answer: answer = 4 |
46 | Correct | 1 ms | 332 KB | Correct answer: answer = 9 |
47 | Correct | 1 ms | 332 KB | Correct answer: answer = 9 |
48 | Correct | 1 ms | 332 KB | Correct answer: answer = 21 |
49 | Correct | 1 ms | 332 KB | Correct answer: answer = 71 |
50 | Correct | 1 ms | 332 KB | Correct answer: answer = 77 |
51 | Correct | 1 ms | 332 KB | Correct answer: answer = 400 |
52 | Correct | 1 ms | 332 KB | Correct answer: answer = 996004 |
53 | Correct | 1 ms | 332 KB | Correct answer: answer = 997310 |
54 | Correct | 1 ms | 332 KB | Correct answer: answer = 990781 |
55 | Correct | 1 ms | 332 KB | Correct answer: answer = 996545 |
56 | Correct | 1 ms | 332 KB | Correct answer: answer = 484 |
57 | Correct | 1 ms | 332 KB | Correct answer: answer = 484 |
58 | Correct | 7 ms | 456 KB | Correct answer: answer = 63501 |
59 | Correct | 8 ms | 460 KB | Correct answer: answer = 323501 |
60 | Correct | 6 ms | 332 KB | Correct answer: answer = 752500 |
61 | Correct | 3 ms | 332 KB | Correct answer: answer = 761480 |
62 | Correct | 3 ms | 332 KB | Correct answer: answer = 758932 |
63 | Correct | 1 ms | 332 KB | Correct answer: answer = 1000000 |
64 | Correct | 1 ms | 460 KB | Correct answer: answer = 750500 |
65 | Correct | 1 ms | 332 KB | Correct answer: answer = 1000000 |
66 | Correct | 1 ms | 332 KB | Correct answer: answer = 250000 |
67 | Correct | 1 ms | 332 KB | Correct answer: answer = 250000 |
68 | Correct | 1 ms | 332 KB | Correct answer: answer = 1000000 |
69 | Correct | 1 ms | 332 KB | Correct answer: answer = 994009 |
70 | Correct | 3 ms | 332 KB | Correct answer: answer = 59315 |
71 | Correct | 2 ms | 332 KB | Correct answer: answer = 25454 |
72 | Correct | 4 ms | 332 KB | Correct answer: answer = 1504 |
73 | Correct | 2 ms | 332 KB | Correct answer: answer = 37486 |
74 | Correct | 3 ms | 332 KB | Correct answer: answer = 4284 |
75 | Correct | 1 ms | 332 KB | Correct answer: answer = 158008 |
76 | Correct | 1 ms | 352 KB | Correct answer: answer = 51860 |
77 | Correct | 2 ms | 332 KB | Correct answer: answer = 12985 |
78 | Correct | 2 ms | 460 KB | Correct answer: answer = 997864126212 |
79 | Correct | 2 ms | 460 KB | Correct answer: answer = 998608411647 |
80 | Correct | 2 ms | 460 KB | Correct answer: answer = 995265560477 |
81 | Correct | 69 ms | 972 KB | Correct answer: answer = 10125000 |
82 | Correct | 69 ms | 1064 KB | Correct answer: answer = 2291668 |
83 | Correct | 29 ms | 716 KB | Correct answer: answer = 42388 |
84 | Correct | 30 ms | 716 KB | Correct answer: answer = 10318 |
85 | Correct | 30 ms | 748 KB | Correct answer: answer = 3416 |
86 | Correct | 96 ms | 1072 KB | Correct answer: answer = 331708193881 |
87 | Correct | 112 ms | 1056 KB | Correct answer: answer = 2861193756 |
88 | Correct | 80 ms | 972 KB | Correct answer: answer = 114646930 |
89 | Correct | 63 ms | 972 KB | Correct answer: answer = 9280921 |
90 | Correct | 62 ms | 972 KB | Correct answer: answer = 999984053400 |
91 | Correct | 105 ms | 1052 KB | Correct answer: answer = 750935949134 |
92 | Correct | 1 ms | 460 KB | Correct answer: answer = 1000000000000 |
93 | Correct | 2 ms | 460 KB | Correct answer: answer = 998762383161 |
94 | Correct | 99 ms | 972 KB | Correct answer: answer = 23017412908 |
95 | Correct | 2 ms | 460 KB | Correct answer: answer = 728143410622 |
96 | Correct | 2 ms | 460 KB | Correct answer: answer = 2 |
97 | Correct | 69 ms | 972 KB | Correct answer: answer = 1824916 |
98 | Correct | 79 ms | 972 KB | Correct answer: answer = 10680029 |
99 | Correct | 75 ms | 972 KB | Correct answer: answer = 18351700 |
100 | Correct | 67 ms | 972 KB | Correct answer: answer = 16040026 |
101 | Correct | 8 ms | 460 KB | Correct answer: answer = 253968628325 |
102 | Correct | 32 ms | 716 KB | Correct answer: answer = 10267 |
103 | Correct | 68 ms | 1068 KB | Correct answer: answer = 2582408 |
104 | Correct | 2 ms | 460 KB | Correct answer: answer = 78024964781 |
105 | Correct | 2 ms | 460 KB | Correct answer: answer = 9866346457 |
106 | Correct | 8 ms | 460 KB | Correct answer: answer = 3327720949 |
107 | Correct | 2 ms | 460 KB | Correct answer: answer = 86064128360 |
108 | Correct | 2 ms | 588 KB | Correct answer: answer = 12698259150 |
109 | Correct | 54 ms | 936 KB | Correct answer: answer = 1185259288 |
110 | Correct | 18 ms | 1736 KB | Correct answer: answer = 999889968863 |
111 | Correct | 18 ms | 1736 KB | Correct answer: answer = 999861384931 |
112 | Correct | 19 ms | 1736 KB | Correct answer: answer = 999811809929 |
113 | Correct | 18 ms | 1736 KB | Correct answer: answer = 999869756441 |
114 | Correct | 1168 ms | 8976 KB | Correct answer: answer = 1700000000 |
115 | Correct | 1125 ms | 8980 KB | Correct answer: answer = 131666670 |
116 | Correct | 338 ms | 3392 KB | Correct answer: answer = 89478486 |
117 | Correct | 300 ms | 3228 KB | Correct answer: answer = 4971040 |
118 | Correct | 316 ms | 3396 KB | Correct answer: answer = 2711494 |
119 | Correct | 1032 ms | 8976 KB | Correct answer: answer = 25252530 |
120 | Correct | 1041 ms | 8980 KB | Correct answer: answer = 62500000 |
121 | Correct | 1719 ms | 8780 KB | Correct answer: answer = 333175097780 |
122 | Correct | 1838 ms | 8776 KB | Correct answer: answer = 33121180179 |
123 | Correct | 1956 ms | 8788 KB | Correct answer: answer = 9802314015 |
124 | Correct | 1038 ms | 8976 KB | Correct answer: answer = 32567551 |
125 | Correct | 1002 ms | 8860 KB | Correct answer: answer = 997525000000 |
126 | Correct | 1547 ms | 8368 KB | Correct answer: answer = 752723538884 |
127 | Correct | 13 ms | 1736 KB | Correct answer: answer = 1000000000000 |
128 | Correct | 17 ms | 1736 KB | Correct answer: answer = 999978000121 |
129 | Correct | 20 ms | 1736 KB | Correct answer: answer = 745986144735 |
130 | Correct | 15 ms | 1736 KB | Correct answer: answer = 2 |
131 | Correct | 1138 ms | 8904 KB | Correct answer: answer = 277966670 |
132 | Correct | 1159 ms | 9012 KB | Correct answer: answer = 2500900082 |
133 | Correct | 149 ms | 2152 KB | Correct answer: answer = 301248349636 |
134 | Correct | 604 ms | 4832 KB | Correct answer: answer = 14118891 |
135 | Correct | 20 ms | 1736 KB | Correct answer: answer = 14384977265 |
136 | Correct | 33 ms | 1720 KB | Correct answer: answer = 3681368330 |
137 | Correct | 28 ms | 1736 KB | Correct answer: answer = 2720316816 |
138 | Correct | 36 ms | 3012 KB | Correct answer: answer = 999976000144 |
139 | Correct | 36 ms | 2984 KB | Correct answer: answer = 999856102410 |
140 | Correct | 36 ms | 2924 KB | Correct answer: answer = 999958401531 |
141 | Correct | 35 ms | 3008 KB | Correct answer: answer = 999769649944 |
142 | Correct | 37 ms | 3008 KB | Correct answer: answer = 999874525918 |
143 | Execution timed out | 2069 ms | 17420 KB | Time limit exceeded |
144 | Halted | 0 ms | 0 KB | - |