Submission #115131

# Submission time Handle Problem Language Result Execution time Memory
115131 2019-06-05T11:29:32 Z E869120 Aliens (IOI16_aliens) C++14
41 / 100
839 ms 81064 KB
#include "aliens.h"
#include <bits/stdc++.h>
using namespace std;

struct Node {
	long long l, r, a, b;
};

bool operator<(const Node &a1, const Node &a2) {
	if (a1.l < a2.l) return true;
	if (a1.l > a2.l) return false;
	if (a1.r < a2.r) return true;
	if (a1.r > a2.r) return false;
	return false;
}

class ConvexHullTrick {
	public:
	vector<Node> vec;
	
	void init() {
		vec.clear();
		vec.push_back(Node{-(1LL<<62), (1LL<<62), -1LL, (1LL<<60)});
	}
	long long cross_point(Node p1, Node p2) {
		// 最後に p1 が勝つ点を求める
		long long E = (p2.a - p1.a) * (p2.a - p1.a) + p2.b - p1.b;
		long long S = 0;
		if (E >= 0) S = E / (2LL * (p2.a - p1.a));
		else { S = (-E) / (2LL * (p2.a - p1.a)); S *= -1LL; S--; }
		return S + p1.a;
	}
	void add(long long pa, long long pb) {
		while (true) {
			Node V = vec[vec.size() - 1];
			long long C = cross_point(V, Node{-(1LL<<62), (1LL<<62), pa, pb});
			
			if (C < V.l) { vec.pop_back(); }
			else {
				vec[vec.size() - 1].r = C;
				vec.push_back(Node{C + 1LL, (1LL << 62), pa, pb});
				break;
			}
		}
	}
	long long getmax(long long pos) {
		int pos1 = lower_bound(vec.begin(), vec.end(), Node{pos + 1LL, -(1LL << 62), 0LL, 0LL}) - vec.begin(); pos1--;
		return (pos - vec[pos1].a) * (pos - vec[pos1].a) + vec[pos1].b;
	}
};

long long G[1 << 20], dp[4009][4009]; vector<pair<int, int>> V;
ConvexHullTrick E;

long long take_photos(int n, int m, int k, vector<int> r, vector<int> c) {
	for (int i = 0; i < n; i++) {
		if (r[i] > c[i]) swap(c[i], r[i]);
		G[r[i]] = max(G[r[i]], 1LL * (c[i] + 1LL));
	}
	long long maxn = 0;
	for (int i = 0; i < m; i++) {
		if (G[i] > maxn) { V.push_back(make_pair(i, G[i])); maxn = G[i]; }
	}
	
	for (int i = 0; i <= (int)V.size(); i++) { for (int j = 0; j <= k; j++) dp[i][j] = (1LL << 50); }
	dp[0][0] = 0;
	for (int t = 0; t <= k - 1; t++) {
		E.init();
		for (int i = 0; i < (int)V.size(); i++) E.add(V[i].first, dp[i][t]);
		
		for (int i = 1; i <= (int)V.size(); i++) {
			long long F = E.getmax(V[i - 1].second);
			if (i < (int)V.size()) {
				long long FF = max(0LL, 1LL * (V[i - 1].second - V[i].first));
				F -= FF * FF;
			}
			dp[i][t + 1] = F;
		}
	}
	/*for (int i = 0; i <= V.size(); i++) {
		for (int j = 0; j <= k; j++) printf("% 3d", dp[i][j]);
		printf("\n");
	}*/
	
	long long ans = (1LL << 60); for (int i = 0; i <= k; i++) ans = min(ans, dp[V.size()][i]);
    return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Correct answer: answer = 4
2 Correct 2 ms 384 KB Correct answer: answer = 4
3 Correct 2 ms 384 KB Correct answer: answer = 4
4 Correct 2 ms 384 KB Correct answer: answer = 12
5 Correct 2 ms 384 KB Correct answer: answer = 52
6 Correct 2 ms 384 KB Correct answer: answer = 210
7 Correct 2 ms 384 KB Correct answer: answer = 88
8 Correct 2 ms 384 KB Correct answer: answer = 7696
9 Correct 2 ms 300 KB Correct answer: answer = 1
10 Correct 2 ms 384 KB Correct answer: answer = 2374
11 Correct 2 ms 384 KB Correct answer: answer = 9502
12 Correct 2 ms 384 KB Correct answer: answer = 49
13 Correct 2 ms 512 KB Correct answer: answer = 151
14 Correct 2 ms 512 KB Correct answer: answer = 7550
15 Correct 2 ms 384 KB Correct answer: answer = 7220
16 Correct 2 ms 512 KB Correct answer: answer = 7550
17 Correct 2 ms 256 KB Correct answer: answer = 10000
18 Correct 2 ms 384 KB Correct answer: answer = 10000
19 Correct 2 ms 384 KB Correct answer: answer = 624
20 Correct 2 ms 384 KB Correct answer: answer = 10000
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Correct answer: answer = 1
2 Correct 2 ms 384 KB Correct answer: answer = 4
3 Correct 2 ms 384 KB Correct answer: answer = 1
4 Correct 2 ms 384 KB Correct answer: answer = 5
5 Correct 2 ms 384 KB Correct answer: answer = 41
6 Correct 2 ms 384 KB Correct answer: answer = 71923
7 Correct 2 ms 1152 KB Correct answer: answer = 77137
8 Correct 10 ms 2688 KB Correct answer: answer = 764
9 Correct 4 ms 2404 KB Correct answer: answer = 250000
10 Correct 21 ms 4352 KB Correct answer: answer = 500
11 Correct 2 ms 384 KB Correct answer: answer = 32
12 Correct 4 ms 2432 KB Correct answer: answer = 130050
13 Correct 6 ms 2560 KB Correct answer: answer = 5110
14 Correct 3 ms 1408 KB Correct answer: answer = 2626
15 Correct 4 ms 1536 KB Correct answer: answer = 796
16 Correct 5 ms 2560 KB Correct answer: answer = 7580
17 Correct 9 ms 2944 KB Correct answer: answer = 1904
18 Correct 3 ms 1920 KB Correct answer: answer = 996004
19 Correct 4 ms 2048 KB Correct answer: answer = 38817
20 Correct 7 ms 2304 KB Correct answer: answer = 4096
21 Correct 3 ms 384 KB Correct answer: answer = 1
22 Correct 2 ms 368 KB Correct answer: answer = 1
23 Correct 9 ms 2944 KB Correct answer: answer = 2040
24 Correct 2 ms 384 KB Correct answer: answer = 2
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Correct answer: answer = 4
2 Correct 2 ms 384 KB Correct answer: answer = 4
3 Correct 2 ms 384 KB Correct answer: answer = 4
4 Correct 2 ms 384 KB Correct answer: answer = 12
5 Correct 2 ms 384 KB Correct answer: answer = 52
6 Correct 2 ms 384 KB Correct answer: answer = 210
7 Correct 2 ms 384 KB Correct answer: answer = 88
8 Correct 2 ms 384 KB Correct answer: answer = 7696
9 Correct 2 ms 300 KB Correct answer: answer = 1
10 Correct 2 ms 384 KB Correct answer: answer = 2374
11 Correct 2 ms 384 KB Correct answer: answer = 9502
12 Correct 2 ms 384 KB Correct answer: answer = 49
13 Correct 2 ms 512 KB Correct answer: answer = 151
14 Correct 2 ms 512 KB Correct answer: answer = 7550
15 Correct 2 ms 384 KB Correct answer: answer = 7220
16 Correct 2 ms 512 KB Correct answer: answer = 7550
17 Correct 2 ms 256 KB Correct answer: answer = 10000
18 Correct 2 ms 384 KB Correct answer: answer = 10000
19 Correct 2 ms 384 KB Correct answer: answer = 624
20 Correct 2 ms 384 KB Correct answer: answer = 10000
21 Correct 2 ms 384 KB Correct answer: answer = 1
22 Correct 2 ms 384 KB Correct answer: answer = 4
23 Correct 2 ms 384 KB Correct answer: answer = 1
24 Correct 2 ms 384 KB Correct answer: answer = 5
25 Correct 2 ms 384 KB Correct answer: answer = 41
26 Correct 2 ms 384 KB Correct answer: answer = 71923
27 Correct 2 ms 1152 KB Correct answer: answer = 77137
28 Correct 10 ms 2688 KB Correct answer: answer = 764
29 Correct 4 ms 2404 KB Correct answer: answer = 250000
30 Correct 21 ms 4352 KB Correct answer: answer = 500
31 Correct 2 ms 384 KB Correct answer: answer = 32
32 Correct 4 ms 2432 KB Correct answer: answer = 130050
33 Correct 6 ms 2560 KB Correct answer: answer = 5110
34 Correct 3 ms 1408 KB Correct answer: answer = 2626
35 Correct 4 ms 1536 KB Correct answer: answer = 796
36 Correct 5 ms 2560 KB Correct answer: answer = 7580
37 Correct 9 ms 2944 KB Correct answer: answer = 1904
38 Correct 3 ms 1920 KB Correct answer: answer = 996004
39 Correct 4 ms 2048 KB Correct answer: answer = 38817
40 Correct 7 ms 2304 KB Correct answer: answer = 4096
41 Correct 3 ms 384 KB Correct answer: answer = 1
42 Correct 2 ms 368 KB Correct answer: answer = 1
43 Correct 9 ms 2944 KB Correct answer: answer = 2040
44 Correct 2 ms 384 KB Correct answer: answer = 2
45 Correct 2 ms 384 KB Correct answer: answer = 4
46 Correct 2 ms 384 KB Correct answer: answer = 9
47 Correct 2 ms 384 KB Correct answer: answer = 9
48 Correct 2 ms 384 KB Correct answer: answer = 21
49 Correct 2 ms 384 KB Correct answer: answer = 71
50 Correct 2 ms 384 KB Correct answer: answer = 77
51 Correct 3 ms 384 KB Correct answer: answer = 400
52 Correct 5 ms 384 KB Correct answer: answer = 996004
53 Correct 2 ms 412 KB Correct answer: answer = 997310
54 Correct 2 ms 384 KB Correct answer: answer = 990781
55 Correct 2 ms 384 KB Correct answer: answer = 996545
56 Correct 2 ms 384 KB Correct answer: answer = 484
57 Correct 2 ms 384 KB Correct answer: answer = 484
58 Correct 4 ms 2432 KB Correct answer: answer = 63501
59 Correct 4 ms 2432 KB Correct answer: answer = 323501
60 Correct 7 ms 2816 KB Correct answer: answer = 752500
61 Correct 3 ms 1408 KB Correct answer: answer = 761480
62 Correct 6 ms 1664 KB Correct answer: answer = 758932
63 Correct 2 ms 384 KB Correct answer: answer = 1000000
64 Correct 22 ms 4408 KB Correct answer: answer = 750500
65 Correct 2 ms 384 KB Correct answer: answer = 1000000
66 Correct 2 ms 384 KB Correct answer: answer = 250000
67 Correct 2 ms 384 KB Correct answer: answer = 250000
68 Correct 2 ms 384 KB Correct answer: answer = 1000000
69 Correct 3 ms 384 KB Correct answer: answer = 994009
70 Correct 3 ms 1152 KB Correct answer: answer = 59315
71 Correct 3 ms 1152 KB Correct answer: answer = 25454
72 Correct 6 ms 1920 KB Correct answer: answer = 1504
73 Correct 2 ms 768 KB Correct answer: answer = 37486
74 Correct 5 ms 1664 KB Correct answer: answer = 4284
75 Correct 3 ms 640 KB Correct answer: answer = 158008
76 Correct 3 ms 768 KB Correct answer: answer = 51860
77 Correct 2 ms 768 KB Correct answer: answer = 12985
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Correct answer: answer = 4
2 Correct 2 ms 384 KB Correct answer: answer = 4
3 Correct 2 ms 384 KB Correct answer: answer = 4
4 Correct 2 ms 384 KB Correct answer: answer = 12
5 Correct 2 ms 384 KB Correct answer: answer = 52
6 Correct 2 ms 384 KB Correct answer: answer = 210
7 Correct 2 ms 384 KB Correct answer: answer = 88
8 Correct 2 ms 384 KB Correct answer: answer = 7696
9 Correct 2 ms 300 KB Correct answer: answer = 1
10 Correct 2 ms 384 KB Correct answer: answer = 2374
11 Correct 2 ms 384 KB Correct answer: answer = 9502
12 Correct 2 ms 384 KB Correct answer: answer = 49
13 Correct 2 ms 512 KB Correct answer: answer = 151
14 Correct 2 ms 512 KB Correct answer: answer = 7550
15 Correct 2 ms 384 KB Correct answer: answer = 7220
16 Correct 2 ms 512 KB Correct answer: answer = 7550
17 Correct 2 ms 256 KB Correct answer: answer = 10000
18 Correct 2 ms 384 KB Correct answer: answer = 10000
19 Correct 2 ms 384 KB Correct answer: answer = 624
20 Correct 2 ms 384 KB Correct answer: answer = 10000
21 Correct 2 ms 384 KB Correct answer: answer = 1
22 Correct 2 ms 384 KB Correct answer: answer = 4
23 Correct 2 ms 384 KB Correct answer: answer = 1
24 Correct 2 ms 384 KB Correct answer: answer = 5
25 Correct 2 ms 384 KB Correct answer: answer = 41
26 Correct 2 ms 384 KB Correct answer: answer = 71923
27 Correct 2 ms 1152 KB Correct answer: answer = 77137
28 Correct 10 ms 2688 KB Correct answer: answer = 764
29 Correct 4 ms 2404 KB Correct answer: answer = 250000
30 Correct 21 ms 4352 KB Correct answer: answer = 500
31 Correct 2 ms 384 KB Correct answer: answer = 32
32 Correct 4 ms 2432 KB Correct answer: answer = 130050
33 Correct 6 ms 2560 KB Correct answer: answer = 5110
34 Correct 3 ms 1408 KB Correct answer: answer = 2626
35 Correct 4 ms 1536 KB Correct answer: answer = 796
36 Correct 5 ms 2560 KB Correct answer: answer = 7580
37 Correct 9 ms 2944 KB Correct answer: answer = 1904
38 Correct 3 ms 1920 KB Correct answer: answer = 996004
39 Correct 4 ms 2048 KB Correct answer: answer = 38817
40 Correct 7 ms 2304 KB Correct answer: answer = 4096
41 Correct 3 ms 384 KB Correct answer: answer = 1
42 Correct 2 ms 368 KB Correct answer: answer = 1
43 Correct 9 ms 2944 KB Correct answer: answer = 2040
44 Correct 2 ms 384 KB Correct answer: answer = 2
45 Correct 2 ms 384 KB Correct answer: answer = 4
46 Correct 2 ms 384 KB Correct answer: answer = 9
47 Correct 2 ms 384 KB Correct answer: answer = 9
48 Correct 2 ms 384 KB Correct answer: answer = 21
49 Correct 2 ms 384 KB Correct answer: answer = 71
50 Correct 2 ms 384 KB Correct answer: answer = 77
51 Correct 3 ms 384 KB Correct answer: answer = 400
52 Correct 5 ms 384 KB Correct answer: answer = 996004
53 Correct 2 ms 412 KB Correct answer: answer = 997310
54 Correct 2 ms 384 KB Correct answer: answer = 990781
55 Correct 2 ms 384 KB Correct answer: answer = 996545
56 Correct 2 ms 384 KB Correct answer: answer = 484
57 Correct 2 ms 384 KB Correct answer: answer = 484
58 Correct 4 ms 2432 KB Correct answer: answer = 63501
59 Correct 4 ms 2432 KB Correct answer: answer = 323501
60 Correct 7 ms 2816 KB Correct answer: answer = 752500
61 Correct 3 ms 1408 KB Correct answer: answer = 761480
62 Correct 6 ms 1664 KB Correct answer: answer = 758932
63 Correct 2 ms 384 KB Correct answer: answer = 1000000
64 Correct 22 ms 4408 KB Correct answer: answer = 750500
65 Correct 2 ms 384 KB Correct answer: answer = 1000000
66 Correct 2 ms 384 KB Correct answer: answer = 250000
67 Correct 2 ms 384 KB Correct answer: answer = 250000
68 Correct 2 ms 384 KB Correct answer: answer = 1000000
69 Correct 3 ms 384 KB Correct answer: answer = 994009
70 Correct 3 ms 1152 KB Correct answer: answer = 59315
71 Correct 3 ms 1152 KB Correct answer: answer = 25454
72 Correct 6 ms 1920 KB Correct answer: answer = 1504
73 Correct 2 ms 768 KB Correct answer: answer = 37486
74 Correct 5 ms 1664 KB Correct answer: answer = 4284
75 Correct 3 ms 640 KB Correct answer: answer = 158008
76 Correct 3 ms 768 KB Correct answer: answer = 51860
77 Correct 2 ms 768 KB Correct answer: answer = 12985
78 Correct 9 ms 6400 KB Correct answer: answer = 997864126212
79 Correct 10 ms 6528 KB Correct answer: answer = 998608411647
80 Correct 12 ms 6784 KB Correct answer: answer = 995265560477
81 Correct 15 ms 17152 KB Correct answer: answer = 10125000
82 Correct 18 ms 17408 KB Correct answer: answer = 2291668
83 Correct 29 ms 10496 KB Correct answer: answer = 42388
84 Correct 94 ms 15488 KB Correct answer: answer = 10318
85 Correct 291 ms 30744 KB Correct answer: answer = 3416
86 Correct 23 ms 23680 KB Correct answer: answer = 331708193881
87 Correct 125 ms 30972 KB Correct answer: answer = 2861193756
88 Correct 587 ms 65448 KB Correct answer: answer = 114646930
89 Correct 38 ms 18688 KB Correct answer: answer = 9280921
90 Correct 139 ms 26440 KB Correct answer: answer = 999984053400
91 Correct 436 ms 51848 KB Correct answer: answer = 750935949134
92 Correct 5 ms 512 KB Correct answer: answer = 1000000000000
93 Correct 9 ms 4480 KB Correct answer: answer = 998762383161
94 Correct 37 ms 24448 KB Correct answer: answer = 23017412908
95 Correct 13 ms 5248 KB Correct answer: answer = 728143410622
96 Correct 5 ms 384 KB Correct answer: answer = 2
97 Correct 22 ms 17408 KB Correct answer: answer = 1824916
98 Correct 228 ms 33660 KB Correct answer: answer = 10680029
99 Correct 120 ms 25848 KB Correct answer: answer = 18351700
100 Correct 18 ms 17152 KB Correct answer: answer = 16040026
101 Correct 6 ms 2560 KB Correct answer: answer = 253968628325
102 Correct 205 ms 24460 KB Correct answer: answer = 10267
103 Correct 725 ms 75996 KB Correct answer: answer = 2582408
104 Correct 8 ms 3200 KB Correct answer: answer = 78024964781
105 Correct 8 ms 2560 KB Correct answer: answer = 9866346457
106 Correct 13 ms 6144 KB Correct answer: answer = 3327720949
107 Correct 35 ms 9088 KB Correct answer: answer = 86064128360
108 Correct 173 ms 24912 KB Correct answer: answer = 12698259150
109 Correct 839 ms 81064 KB Correct answer: answer = 1185259288
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Correct answer: answer = 4
2 Correct 2 ms 384 KB Correct answer: answer = 4
3 Correct 2 ms 384 KB Correct answer: answer = 4
4 Correct 2 ms 384 KB Correct answer: answer = 12
5 Correct 2 ms 384 KB Correct answer: answer = 52
6 Correct 2 ms 384 KB Correct answer: answer = 210
7 Correct 2 ms 384 KB Correct answer: answer = 88
8 Correct 2 ms 384 KB Correct answer: answer = 7696
9 Correct 2 ms 300 KB Correct answer: answer = 1
10 Correct 2 ms 384 KB Correct answer: answer = 2374
11 Correct 2 ms 384 KB Correct answer: answer = 9502
12 Correct 2 ms 384 KB Correct answer: answer = 49
13 Correct 2 ms 512 KB Correct answer: answer = 151
14 Correct 2 ms 512 KB Correct answer: answer = 7550
15 Correct 2 ms 384 KB Correct answer: answer = 7220
16 Correct 2 ms 512 KB Correct answer: answer = 7550
17 Correct 2 ms 256 KB Correct answer: answer = 10000
18 Correct 2 ms 384 KB Correct answer: answer = 10000
19 Correct 2 ms 384 KB Correct answer: answer = 624
20 Correct 2 ms 384 KB Correct answer: answer = 10000
21 Correct 2 ms 384 KB Correct answer: answer = 1
22 Correct 2 ms 384 KB Correct answer: answer = 4
23 Correct 2 ms 384 KB Correct answer: answer = 1
24 Correct 2 ms 384 KB Correct answer: answer = 5
25 Correct 2 ms 384 KB Correct answer: answer = 41
26 Correct 2 ms 384 KB Correct answer: answer = 71923
27 Correct 2 ms 1152 KB Correct answer: answer = 77137
28 Correct 10 ms 2688 KB Correct answer: answer = 764
29 Correct 4 ms 2404 KB Correct answer: answer = 250000
30 Correct 21 ms 4352 KB Correct answer: answer = 500
31 Correct 2 ms 384 KB Correct answer: answer = 32
32 Correct 4 ms 2432 KB Correct answer: answer = 130050
33 Correct 6 ms 2560 KB Correct answer: answer = 5110
34 Correct 3 ms 1408 KB Correct answer: answer = 2626
35 Correct 4 ms 1536 KB Correct answer: answer = 796
36 Correct 5 ms 2560 KB Correct answer: answer = 7580
37 Correct 9 ms 2944 KB Correct answer: answer = 1904
38 Correct 3 ms 1920 KB Correct answer: answer = 996004
39 Correct 4 ms 2048 KB Correct answer: answer = 38817
40 Correct 7 ms 2304 KB Correct answer: answer = 4096
41 Correct 3 ms 384 KB Correct answer: answer = 1
42 Correct 2 ms 368 KB Correct answer: answer = 1
43 Correct 9 ms 2944 KB Correct answer: answer = 2040
44 Correct 2 ms 384 KB Correct answer: answer = 2
45 Correct 2 ms 384 KB Correct answer: answer = 4
46 Correct 2 ms 384 KB Correct answer: answer = 9
47 Correct 2 ms 384 KB Correct answer: answer = 9
48 Correct 2 ms 384 KB Correct answer: answer = 21
49 Correct 2 ms 384 KB Correct answer: answer = 71
50 Correct 2 ms 384 KB Correct answer: answer = 77
51 Correct 3 ms 384 KB Correct answer: answer = 400
52 Correct 5 ms 384 KB Correct answer: answer = 996004
53 Correct 2 ms 412 KB Correct answer: answer = 997310
54 Correct 2 ms 384 KB Correct answer: answer = 990781
55 Correct 2 ms 384 KB Correct answer: answer = 996545
56 Correct 2 ms 384 KB Correct answer: answer = 484
57 Correct 2 ms 384 KB Correct answer: answer = 484
58 Correct 4 ms 2432 KB Correct answer: answer = 63501
59 Correct 4 ms 2432 KB Correct answer: answer = 323501
60 Correct 7 ms 2816 KB Correct answer: answer = 752500
61 Correct 3 ms 1408 KB Correct answer: answer = 761480
62 Correct 6 ms 1664 KB Correct answer: answer = 758932
63 Correct 2 ms 384 KB Correct answer: answer = 1000000
64 Correct 22 ms 4408 KB Correct answer: answer = 750500
65 Correct 2 ms 384 KB Correct answer: answer = 1000000
66 Correct 2 ms 384 KB Correct answer: answer = 250000
67 Correct 2 ms 384 KB Correct answer: answer = 250000
68 Correct 2 ms 384 KB Correct answer: answer = 1000000
69 Correct 3 ms 384 KB Correct answer: answer = 994009
70 Correct 3 ms 1152 KB Correct answer: answer = 59315
71 Correct 3 ms 1152 KB Correct answer: answer = 25454
72 Correct 6 ms 1920 KB Correct answer: answer = 1504
73 Correct 2 ms 768 KB Correct answer: answer = 37486
74 Correct 5 ms 1664 KB Correct answer: answer = 4284
75 Correct 3 ms 640 KB Correct answer: answer = 158008
76 Correct 3 ms 768 KB Correct answer: answer = 51860
77 Correct 2 ms 768 KB Correct answer: answer = 12985
78 Correct 9 ms 6400 KB Correct answer: answer = 997864126212
79 Correct 10 ms 6528 KB Correct answer: answer = 998608411647
80 Correct 12 ms 6784 KB Correct answer: answer = 995265560477
81 Correct 15 ms 17152 KB Correct answer: answer = 10125000
82 Correct 18 ms 17408 KB Correct answer: answer = 2291668
83 Correct 29 ms 10496 KB Correct answer: answer = 42388
84 Correct 94 ms 15488 KB Correct answer: answer = 10318
85 Correct 291 ms 30744 KB Correct answer: answer = 3416
86 Correct 23 ms 23680 KB Correct answer: answer = 331708193881
87 Correct 125 ms 30972 KB Correct answer: answer = 2861193756
88 Correct 587 ms 65448 KB Correct answer: answer = 114646930
89 Correct 38 ms 18688 KB Correct answer: answer = 9280921
90 Correct 139 ms 26440 KB Correct answer: answer = 999984053400
91 Correct 436 ms 51848 KB Correct answer: answer = 750935949134
92 Correct 5 ms 512 KB Correct answer: answer = 1000000000000
93 Correct 9 ms 4480 KB Correct answer: answer = 998762383161
94 Correct 37 ms 24448 KB Correct answer: answer = 23017412908
95 Correct 13 ms 5248 KB Correct answer: answer = 728143410622
96 Correct 5 ms 384 KB Correct answer: answer = 2
97 Correct 22 ms 17408 KB Correct answer: answer = 1824916
98 Correct 228 ms 33660 KB Correct answer: answer = 10680029
99 Correct 120 ms 25848 KB Correct answer: answer = 18351700
100 Correct 18 ms 17152 KB Correct answer: answer = 16040026
101 Correct 6 ms 2560 KB Correct answer: answer = 253968628325
102 Correct 205 ms 24460 KB Correct answer: answer = 10267
103 Correct 725 ms 75996 KB Correct answer: answer = 2582408
104 Correct 8 ms 3200 KB Correct answer: answer = 78024964781
105 Correct 8 ms 2560 KB Correct answer: answer = 9866346457
106 Correct 13 ms 6144 KB Correct answer: answer = 3327720949
107 Correct 35 ms 9088 KB Correct answer: answer = 86064128360
108 Correct 173 ms 24912 KB Correct answer: answer = 12698259150
109 Correct 839 ms 81064 KB Correct answer: answer = 1185259288
110 Correct 25 ms 9600 KB Correct answer: answer = 999889968863
111 Correct 25 ms 9592 KB Correct answer: answer = 999861384931
112 Correct 25 ms 9564 KB Correct answer: answer = 999811809929
113 Correct 25 ms 9548 KB Correct answer: answer = 999869756441
114 Runtime error 87 ms 39148 KB Execution killed with signal 11 (could be triggered by violating memory limits)
115 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Correct answer: answer = 4
2 Correct 2 ms 384 KB Correct answer: answer = 4
3 Correct 2 ms 384 KB Correct answer: answer = 4
4 Correct 2 ms 384 KB Correct answer: answer = 12
5 Correct 2 ms 384 KB Correct answer: answer = 52
6 Correct 2 ms 384 KB Correct answer: answer = 210
7 Correct 2 ms 384 KB Correct answer: answer = 88
8 Correct 2 ms 384 KB Correct answer: answer = 7696
9 Correct 2 ms 300 KB Correct answer: answer = 1
10 Correct 2 ms 384 KB Correct answer: answer = 2374
11 Correct 2 ms 384 KB Correct answer: answer = 9502
12 Correct 2 ms 384 KB Correct answer: answer = 49
13 Correct 2 ms 512 KB Correct answer: answer = 151
14 Correct 2 ms 512 KB Correct answer: answer = 7550
15 Correct 2 ms 384 KB Correct answer: answer = 7220
16 Correct 2 ms 512 KB Correct answer: answer = 7550
17 Correct 2 ms 256 KB Correct answer: answer = 10000
18 Correct 2 ms 384 KB Correct answer: answer = 10000
19 Correct 2 ms 384 KB Correct answer: answer = 624
20 Correct 2 ms 384 KB Correct answer: answer = 10000
21 Correct 2 ms 384 KB Correct answer: answer = 1
22 Correct 2 ms 384 KB Correct answer: answer = 4
23 Correct 2 ms 384 KB Correct answer: answer = 1
24 Correct 2 ms 384 KB Correct answer: answer = 5
25 Correct 2 ms 384 KB Correct answer: answer = 41
26 Correct 2 ms 384 KB Correct answer: answer = 71923
27 Correct 2 ms 1152 KB Correct answer: answer = 77137
28 Correct 10 ms 2688 KB Correct answer: answer = 764
29 Correct 4 ms 2404 KB Correct answer: answer = 250000
30 Correct 21 ms 4352 KB Correct answer: answer = 500
31 Correct 2 ms 384 KB Correct answer: answer = 32
32 Correct 4 ms 2432 KB Correct answer: answer = 130050
33 Correct 6 ms 2560 KB Correct answer: answer = 5110
34 Correct 3 ms 1408 KB Correct answer: answer = 2626
35 Correct 4 ms 1536 KB Correct answer: answer = 796
36 Correct 5 ms 2560 KB Correct answer: answer = 7580
37 Correct 9 ms 2944 KB Correct answer: answer = 1904
38 Correct 3 ms 1920 KB Correct answer: answer = 996004
39 Correct 4 ms 2048 KB Correct answer: answer = 38817
40 Correct 7 ms 2304 KB Correct answer: answer = 4096
41 Correct 3 ms 384 KB Correct answer: answer = 1
42 Correct 2 ms 368 KB Correct answer: answer = 1
43 Correct 9 ms 2944 KB Correct answer: answer = 2040
44 Correct 2 ms 384 KB Correct answer: answer = 2
45 Correct 2 ms 384 KB Correct answer: answer = 4
46 Correct 2 ms 384 KB Correct answer: answer = 9
47 Correct 2 ms 384 KB Correct answer: answer = 9
48 Correct 2 ms 384 KB Correct answer: answer = 21
49 Correct 2 ms 384 KB Correct answer: answer = 71
50 Correct 2 ms 384 KB Correct answer: answer = 77
51 Correct 3 ms 384 KB Correct answer: answer = 400
52 Correct 5 ms 384 KB Correct answer: answer = 996004
53 Correct 2 ms 412 KB Correct answer: answer = 997310
54 Correct 2 ms 384 KB Correct answer: answer = 990781
55 Correct 2 ms 384 KB Correct answer: answer = 996545
56 Correct 2 ms 384 KB Correct answer: answer = 484
57 Correct 2 ms 384 KB Correct answer: answer = 484
58 Correct 4 ms 2432 KB Correct answer: answer = 63501
59 Correct 4 ms 2432 KB Correct answer: answer = 323501
60 Correct 7 ms 2816 KB Correct answer: answer = 752500
61 Correct 3 ms 1408 KB Correct answer: answer = 761480
62 Correct 6 ms 1664 KB Correct answer: answer = 758932
63 Correct 2 ms 384 KB Correct answer: answer = 1000000
64 Correct 22 ms 4408 KB Correct answer: answer = 750500
65 Correct 2 ms 384 KB Correct answer: answer = 1000000
66 Correct 2 ms 384 KB Correct answer: answer = 250000
67 Correct 2 ms 384 KB Correct answer: answer = 250000
68 Correct 2 ms 384 KB Correct answer: answer = 1000000
69 Correct 3 ms 384 KB Correct answer: answer = 994009
70 Correct 3 ms 1152 KB Correct answer: answer = 59315
71 Correct 3 ms 1152 KB Correct answer: answer = 25454
72 Correct 6 ms 1920 KB Correct answer: answer = 1504
73 Correct 2 ms 768 KB Correct answer: answer = 37486
74 Correct 5 ms 1664 KB Correct answer: answer = 4284
75 Correct 3 ms 640 KB Correct answer: answer = 158008
76 Correct 3 ms 768 KB Correct answer: answer = 51860
77 Correct 2 ms 768 KB Correct answer: answer = 12985
78 Correct 9 ms 6400 KB Correct answer: answer = 997864126212
79 Correct 10 ms 6528 KB Correct answer: answer = 998608411647
80 Correct 12 ms 6784 KB Correct answer: answer = 995265560477
81 Correct 15 ms 17152 KB Correct answer: answer = 10125000
82 Correct 18 ms 17408 KB Correct answer: answer = 2291668
83 Correct 29 ms 10496 KB Correct answer: answer = 42388
84 Correct 94 ms 15488 KB Correct answer: answer = 10318
85 Correct 291 ms 30744 KB Correct answer: answer = 3416
86 Correct 23 ms 23680 KB Correct answer: answer = 331708193881
87 Correct 125 ms 30972 KB Correct answer: answer = 2861193756
88 Correct 587 ms 65448 KB Correct answer: answer = 114646930
89 Correct 38 ms 18688 KB Correct answer: answer = 9280921
90 Correct 139 ms 26440 KB Correct answer: answer = 999984053400
91 Correct 436 ms 51848 KB Correct answer: answer = 750935949134
92 Correct 5 ms 512 KB Correct answer: answer = 1000000000000
93 Correct 9 ms 4480 KB Correct answer: answer = 998762383161
94 Correct 37 ms 24448 KB Correct answer: answer = 23017412908
95 Correct 13 ms 5248 KB Correct answer: answer = 728143410622
96 Correct 5 ms 384 KB Correct answer: answer = 2
97 Correct 22 ms 17408 KB Correct answer: answer = 1824916
98 Correct 228 ms 33660 KB Correct answer: answer = 10680029
99 Correct 120 ms 25848 KB Correct answer: answer = 18351700
100 Correct 18 ms 17152 KB Correct answer: answer = 16040026
101 Correct 6 ms 2560 KB Correct answer: answer = 253968628325
102 Correct 205 ms 24460 KB Correct answer: answer = 10267
103 Correct 725 ms 75996 KB Correct answer: answer = 2582408
104 Correct 8 ms 3200 KB Correct answer: answer = 78024964781
105 Correct 8 ms 2560 KB Correct answer: answer = 9866346457
106 Correct 13 ms 6144 KB Correct answer: answer = 3327720949
107 Correct 35 ms 9088 KB Correct answer: answer = 86064128360
108 Correct 173 ms 24912 KB Correct answer: answer = 12698259150
109 Correct 839 ms 81064 KB Correct answer: answer = 1185259288
110 Correct 25 ms 9600 KB Correct answer: answer = 999889968863
111 Correct 25 ms 9592 KB Correct answer: answer = 999861384931
112 Correct 25 ms 9564 KB Correct answer: answer = 999811809929
113 Correct 25 ms 9548 KB Correct answer: answer = 999869756441
114 Runtime error 87 ms 39148 KB Execution killed with signal 11 (could be triggered by violating memory limits)
115 Halted 0 ms 0 KB -