답안 #139088

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
139088 2019-07-31T09:13:05 Z SirCeness Shortcut (IOI16_shortcut) C++14
23 / 100
2000 ms 508 KB
#include "shortcut.h"
#include <bits/stdc++.h>

#define pb push_back
#define mp make_pair
#define inside sl<=l_&&r<=sr
#define outside r<sl||sr<l_
#define orta ((l_+r)>>1)
#define INF 1000000009
#define mod 1000000007
#define ppair(x); cerr << "(" << x.first << ", " << x.second << ")\n";
#define bas(x) #x << ": " << x << " "
#define prarr(x, n); cerr << #x << ": "; for(int qsd = 0; qsd < n; qsd++) cerr << x[qsd] << " "; cerr << "\n";
#define prarrv(x); cerr << #x << ": "; for(int qsd = 0; qsd < (int)x.size(); qsd++) cerr << x[qsd] << " "; cerr << "\n";
using namespace std;
typedef long long ll;

vector<ll> lmax;
vector<ll> rmax;
vector<ll> prest;
vector<ll> sufst;
ll c;
int n;
vector<int> l, d;
vector<ll> pre;
ll stpre[4000006];
ll stsuf[4000006];

ll dist(int ll, int rr){
	return abs(pre[rr] - pre[ll]);
}

ll getl(int i){
	return max(lmax[i], (ll)d[i]);
}

ll getr(int i){
	return max(rmax[i], (ll)d[i]);
}

void stcpre(int node, int l_, int r){
	if (l_ == r) stpre[node] = prest[l_];
	else {
		int m = orta;
		stcpre(node*2, l_, m);
		stcpre(node*2+1, m+1, r);
		stpre[node] = max(stpre[node*2], stpre[node*2+1]);
	}
}

ll stqpre(int node, int l_, int r, int sl, int sr){
	if (inside) return stpre[node];
	else if (outside) return 0;
	else {
		int m = orta;
		return max(stqpre(node*2, l_, m, sl, sr), stqpre(node*2+1, m+1, r, sl, sr));
	}
}

void stcsuf(int node, int l_, int r){
	if (l_ == r) stsuf[node] = sufst[l_];
	else {
		int m = orta;
		stcsuf(node*2, l_, m);
		stcsuf(node*2+1, m+1, r);
		stsuf[node] = max(stsuf[node*2], stsuf[node*2+1]);
	}
}

ll stqsuf(int node, int l_, int r, int sl, int sr){
	if (inside) return stsuf[node];
	else if (outside) return 0;
	else {
		int m = orta;
		return max(stqsuf(node*2, l_, m, sl, sr), stqsuf(node*2+1, m+1, r, sl, sr));
	}
}

int check(ll val){
	int pl = 0;
	int pr = n-1;
	int islem = 1;
	while (islem){
		islem = 0;
		for (int i = 0; i < n; i++){
			ll rig = d[i] + dist(i, pl) + c + max(getr(pr), stqsuf(1, 0, n-1, max(i, pl)+1, pr) - dist(pr, n-1));
			rig = min(rig, d[i] + rmax[i]);
			
			
			while (pl < pr && rig > val){
				pl++;
				rig = rig = d[i] + dist(i, pl) + c + max(getr(pr), stqsuf(1, 0, n-1, max(i, pl)+1, pr) - dist(pr, n-1));
				rig = min(rig, d[i] + rmax[i]);
				islem = 1;
			}
			
			ll lef = d[i] + dist(i, pr) + c + max(getl(pl), stqpre(1, 0, n-1, pl, min(i, pr)-1) - dist(0, pl));
			lef = min(lef, d[i] + lmax[i]);
			while (pl < pr && lef > val){
				pr--;
				lef = d[i] + dist(i, pr) + c + max(getl(pl), stqpre(1, 0, n-1, pl, min(i, pr)-1) - dist(0, pl));
				lef = min(lef, d[i] + lmax[i]);
				islem = 1;
			}
			if (pl == pr) return 0;
		}
	}
	return 1;
}

ll brute(int pl, int pr){
	ll ans = 0;
	for (int i = 0; i < n; i++){
		for (int j = i+1; j < n; j++){
			ll mesafe = dist(i, j) + d[i] + d[j];
			mesafe = min(mesafe, d[i] + dist(i, pl) + c + dist(pr, j) + d[j]);
			ans = max(ans, mesafe);
		}
	}
	return ans;
}

ll find_shortcut(int N, vector<int> L, vector<int> D, int C){
	l = L;
	d = D;
	n = N;
	c = C;
	lmax.pb(0);
	for (int i = 1; i < n; i++){
		lmax.pb(max(lmax[i-1] + l[i-1], (ll)l[i-1] + d[i-1]));
	}
	rmax.resize(n);
	rmax[n-1] = 0;
	for (int i = n-2; i >= 0; i--){
		rmax[i] = max(rmax[i+1] + l[i], (ll)l[i] + d[i+1]);
	}
	pre.pb(0);
	for (int i = 1; i < n; i++){
		pre.pb(pre[i-1] + l[i-1]);
	}
	
	prest.resize(n);
	for (int i = 0; i < n; i++){
		prest[i] = dist(0, i) + d[i];
	}
	
	sufst.resize(n);
	for (int i = n-1; i >= 0; i--) sufst[i] = dist(i, n-1) + d[i];
	
	stcpre(1, 0, n-1);
	stcsuf(1, 0, n-1);
	
	/*ll bas = 0;
	ll son = 1e15+1;
	while (bas < son){
		int m = (bas+son)>>1;
		if (check(m)) son = m;
		else bas = m+1;
	}*/
	
	ll ans = 1000000000000000;
	for (int i = 0; i < n; i++){
		for (int j = i+1; j < n; j++){
			ans = min(ans, brute(i, j));
		}
	}
	
	return ans;
}





Compilation message

shortcut.cpp: In function 'int check(ll)':
shortcut.cpp:92:9: warning: operation on 'rig' may be undefined [-Wsequence-point]
     rig = rig = d[i] + dist(i, pl) + c + max(getr(pr), stqsuf(1, 0, n-1, max(i, pl)+1, pr) - dist(pr, n-1));
     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB n = 4, 80 is a correct answer
2 Correct 2 ms 376 KB n = 9, 110 is a correct answer
3 Correct 2 ms 376 KB n = 4, 21 is a correct answer
4 Correct 2 ms 376 KB n = 3, 4 is a correct answer
5 Correct 2 ms 376 KB n = 2, 62 is a correct answer
6 Correct 2 ms 376 KB n = 2, 3 is a correct answer
7 Correct 2 ms 376 KB n = 3, 29 is a correct answer
8 Correct 2 ms 376 KB n = 2, 3 is a correct answer
9 Correct 2 ms 376 KB n = 2, 3 is a correct answer
10 Correct 2 ms 376 KB n = 2, 2000000001 is a correct answer
11 Correct 2 ms 376 KB n = 2, 3000000000 is a correct answer
12 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
13 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
14 Correct 2 ms 376 KB n = 4, 3000000001 is a correct answer
15 Correct 2 ms 376 KB n = 4, 4000000000 is a correct answer
16 Correct 2 ms 376 KB n = 5, 4000000000 is a correct answer
17 Correct 2 ms 380 KB n = 10, 1000000343 is a correct answer
18 Correct 2 ms 376 KB n = 10, 3189 is a correct answer
19 Correct 2 ms 376 KB n = 10, 7000000000 is a correct answer
20 Correct 2 ms 376 KB n = 5, 12 is a correct answer
21 Correct 2 ms 376 KB n = 5, 25 is a correct answer
22 Correct 2 ms 452 KB n = 2, 122 is a correct answer
23 Correct 2 ms 376 KB n = 10, 117 is a correct answer
24 Correct 2 ms 376 KB n = 10, 336 is a correct answer
25 Correct 2 ms 376 KB n = 10, 438 is a correct answer
26 Correct 2 ms 376 KB n = 10, 206 is a correct answer
27 Correct 2 ms 376 KB n = 10, 636 is a correct answer
28 Correct 2 ms 376 KB n = 4, 2399 is a correct answer
29 Correct 2 ms 376 KB n = 10, 10992 is a correct answer
30 Correct 2 ms 256 KB n = 10, 3112 is a correct answer
31 Correct 76 ms 376 KB n = 100, 51000000001 is a correct answer
32 Correct 7 ms 380 KB n = 50, 197881272 is a correct answer
33 Correct 77 ms 508 KB n = 100, 20969 is a correct answer
34 Correct 76 ms 384 KB n = 100, 20969 is a correct answer
35 Correct 77 ms 376 KB n = 100, 52000000000 is a correct answer
36 Correct 76 ms 376 KB n = 100, 285 is a correct answer
37 Correct 76 ms 376 KB n = 100, 21272 is a correct answer
38 Correct 76 ms 376 KB n = 100, 12161 is a correct answer
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB n = 4, 80 is a correct answer
2 Correct 2 ms 376 KB n = 9, 110 is a correct answer
3 Correct 2 ms 376 KB n = 4, 21 is a correct answer
4 Correct 2 ms 376 KB n = 3, 4 is a correct answer
5 Correct 2 ms 376 KB n = 2, 62 is a correct answer
6 Correct 2 ms 376 KB n = 2, 3 is a correct answer
7 Correct 2 ms 376 KB n = 3, 29 is a correct answer
8 Correct 2 ms 376 KB n = 2, 3 is a correct answer
9 Correct 2 ms 376 KB n = 2, 3 is a correct answer
10 Correct 2 ms 376 KB n = 2, 2000000001 is a correct answer
11 Correct 2 ms 376 KB n = 2, 3000000000 is a correct answer
12 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
13 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
14 Correct 2 ms 376 KB n = 4, 3000000001 is a correct answer
15 Correct 2 ms 376 KB n = 4, 4000000000 is a correct answer
16 Correct 2 ms 376 KB n = 5, 4000000000 is a correct answer
17 Correct 2 ms 380 KB n = 10, 1000000343 is a correct answer
18 Correct 2 ms 376 KB n = 10, 3189 is a correct answer
19 Correct 2 ms 376 KB n = 10, 7000000000 is a correct answer
20 Correct 2 ms 376 KB n = 5, 12 is a correct answer
21 Correct 2 ms 376 KB n = 5, 25 is a correct answer
22 Correct 2 ms 452 KB n = 2, 122 is a correct answer
23 Correct 2 ms 376 KB n = 10, 117 is a correct answer
24 Correct 2 ms 376 KB n = 10, 336 is a correct answer
25 Correct 2 ms 376 KB n = 10, 438 is a correct answer
26 Correct 2 ms 376 KB n = 10, 206 is a correct answer
27 Correct 2 ms 376 KB n = 10, 636 is a correct answer
28 Correct 2 ms 376 KB n = 4, 2399 is a correct answer
29 Correct 2 ms 376 KB n = 10, 10992 is a correct answer
30 Correct 2 ms 256 KB n = 10, 3112 is a correct answer
31 Correct 76 ms 376 KB n = 100, 51000000001 is a correct answer
32 Correct 7 ms 380 KB n = 50, 197881272 is a correct answer
33 Correct 77 ms 508 KB n = 100, 20969 is a correct answer
34 Correct 76 ms 384 KB n = 100, 20969 is a correct answer
35 Correct 77 ms 376 KB n = 100, 52000000000 is a correct answer
36 Correct 76 ms 376 KB n = 100, 285 is a correct answer
37 Correct 76 ms 376 KB n = 100, 21272 is a correct answer
38 Correct 76 ms 376 KB n = 100, 12161 is a correct answer
39 Correct 2 ms 376 KB n = 2, 62 is a correct answer
40 Correct 2 ms 376 KB n = 2, 3 is a correct answer
41 Correct 2 ms 376 KB n = 3, 29 is a correct answer
42 Correct 2 ms 376 KB n = 2, 3 is a correct answer
43 Correct 2 ms 376 KB n = 2, 3 is a correct answer
44 Correct 2 ms 256 KB n = 2, 2000000001 is a correct answer
45 Correct 2 ms 376 KB n = 2, 3000000000 is a correct answer
46 Correct 1 ms 376 KB n = 3, 3000000000 is a correct answer
47 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
48 Correct 2 ms 376 KB n = 4, 3000000001 is a correct answer
49 Correct 2 ms 376 KB n = 4, 4000000000 is a correct answer
50 Correct 2 ms 380 KB n = 5, 4000000000 is a correct answer
51 Correct 2 ms 376 KB n = 10, 1000000343 is a correct answer
52 Correct 2 ms 376 KB n = 10, 3189 is a correct answer
53 Correct 2 ms 376 KB n = 10, 7000000000 is a correct answer
54 Correct 2 ms 376 KB n = 5, 12 is a correct answer
55 Correct 2 ms 376 KB n = 5, 25 is a correct answer
56 Correct 2 ms 376 KB n = 2, 122 is a correct answer
57 Correct 2 ms 376 KB n = 10, 117 is a correct answer
58 Correct 2 ms 376 KB n = 10, 336 is a correct answer
59 Correct 2 ms 376 KB n = 10, 438 is a correct answer
60 Correct 2 ms 376 KB n = 10, 206 is a correct answer
61 Correct 2 ms 376 KB n = 10, 636 is a correct answer
62 Correct 2 ms 376 KB n = 4, 2399 is a correct answer
63 Correct 2 ms 376 KB n = 10, 10992 is a correct answer
64 Correct 2 ms 376 KB n = 10, 3112 is a correct answer
65 Correct 76 ms 376 KB n = 100, 51000000001 is a correct answer
66 Correct 7 ms 376 KB n = 50, 197881272 is a correct answer
67 Correct 78 ms 376 KB n = 100, 20969 is a correct answer
68 Correct 77 ms 504 KB n = 100, 20969 is a correct answer
69 Correct 77 ms 376 KB n = 100, 52000000000 is a correct answer
70 Correct 77 ms 504 KB n = 100, 285 is a correct answer
71 Correct 76 ms 376 KB n = 100, 21272 is a correct answer
72 Correct 76 ms 424 KB n = 100, 12161 is a correct answer
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB n = 4, 80 is a correct answer
2 Correct 2 ms 376 KB n = 9, 110 is a correct answer
3 Correct 2 ms 376 KB n = 4, 21 is a correct answer
4 Correct 2 ms 376 KB n = 3, 4 is a correct answer
5 Correct 2 ms 376 KB n = 2, 62 is a correct answer
6 Correct 2 ms 376 KB n = 2, 3 is a correct answer
7 Correct 2 ms 376 KB n = 3, 29 is a correct answer
8 Correct 2 ms 376 KB n = 2, 3 is a correct answer
9 Correct 2 ms 376 KB n = 2, 3 is a correct answer
10 Correct 2 ms 376 KB n = 2, 2000000001 is a correct answer
11 Correct 2 ms 376 KB n = 2, 3000000000 is a correct answer
12 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
13 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
14 Correct 2 ms 376 KB n = 4, 3000000001 is a correct answer
15 Correct 2 ms 376 KB n = 4, 4000000000 is a correct answer
16 Correct 2 ms 376 KB n = 5, 4000000000 is a correct answer
17 Correct 2 ms 380 KB n = 10, 1000000343 is a correct answer
18 Correct 2 ms 376 KB n = 10, 3189 is a correct answer
19 Correct 2 ms 376 KB n = 10, 7000000000 is a correct answer
20 Correct 2 ms 376 KB n = 5, 12 is a correct answer
21 Correct 2 ms 376 KB n = 5, 25 is a correct answer
22 Correct 2 ms 452 KB n = 2, 122 is a correct answer
23 Correct 2 ms 376 KB n = 10, 117 is a correct answer
24 Correct 2 ms 376 KB n = 10, 336 is a correct answer
25 Correct 2 ms 376 KB n = 10, 438 is a correct answer
26 Correct 2 ms 376 KB n = 10, 206 is a correct answer
27 Correct 2 ms 376 KB n = 10, 636 is a correct answer
28 Correct 2 ms 376 KB n = 4, 2399 is a correct answer
29 Correct 2 ms 376 KB n = 10, 10992 is a correct answer
30 Correct 2 ms 256 KB n = 10, 3112 is a correct answer
31 Correct 76 ms 376 KB n = 100, 51000000001 is a correct answer
32 Correct 7 ms 380 KB n = 50, 197881272 is a correct answer
33 Correct 77 ms 508 KB n = 100, 20969 is a correct answer
34 Correct 76 ms 384 KB n = 100, 20969 is a correct answer
35 Correct 77 ms 376 KB n = 100, 52000000000 is a correct answer
36 Correct 76 ms 376 KB n = 100, 285 is a correct answer
37 Correct 76 ms 376 KB n = 100, 21272 is a correct answer
38 Correct 76 ms 376 KB n = 100, 12161 is a correct answer
39 Correct 2 ms 376 KB n = 2, 62 is a correct answer
40 Correct 2 ms 376 KB n = 2, 3 is a correct answer
41 Correct 2 ms 376 KB n = 3, 29 is a correct answer
42 Correct 2 ms 376 KB n = 2, 3 is a correct answer
43 Correct 2 ms 376 KB n = 2, 3 is a correct answer
44 Correct 2 ms 256 KB n = 2, 2000000001 is a correct answer
45 Correct 2 ms 376 KB n = 2, 3000000000 is a correct answer
46 Correct 1 ms 376 KB n = 3, 3000000000 is a correct answer
47 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
48 Correct 2 ms 376 KB n = 4, 3000000001 is a correct answer
49 Correct 2 ms 376 KB n = 4, 4000000000 is a correct answer
50 Correct 2 ms 380 KB n = 5, 4000000000 is a correct answer
51 Correct 2 ms 376 KB n = 10, 1000000343 is a correct answer
52 Correct 2 ms 376 KB n = 10, 3189 is a correct answer
53 Correct 2 ms 376 KB n = 10, 7000000000 is a correct answer
54 Correct 2 ms 376 KB n = 5, 12 is a correct answer
55 Correct 2 ms 376 KB n = 5, 25 is a correct answer
56 Correct 2 ms 376 KB n = 2, 122 is a correct answer
57 Correct 2 ms 376 KB n = 10, 117 is a correct answer
58 Correct 2 ms 376 KB n = 10, 336 is a correct answer
59 Correct 2 ms 376 KB n = 10, 438 is a correct answer
60 Correct 2 ms 376 KB n = 10, 206 is a correct answer
61 Correct 2 ms 376 KB n = 10, 636 is a correct answer
62 Correct 2 ms 376 KB n = 4, 2399 is a correct answer
63 Correct 2 ms 376 KB n = 10, 10992 is a correct answer
64 Correct 2 ms 376 KB n = 10, 3112 is a correct answer
65 Correct 76 ms 376 KB n = 100, 51000000001 is a correct answer
66 Correct 7 ms 376 KB n = 50, 197881272 is a correct answer
67 Correct 78 ms 376 KB n = 100, 20969 is a correct answer
68 Correct 77 ms 504 KB n = 100, 20969 is a correct answer
69 Correct 77 ms 376 KB n = 100, 52000000000 is a correct answer
70 Correct 77 ms 504 KB n = 100, 285 is a correct answer
71 Correct 76 ms 376 KB n = 100, 21272 is a correct answer
72 Correct 76 ms 424 KB n = 100, 12161 is a correct answer
73 Execution timed out 2033 ms 376 KB Time limit exceeded
74 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB n = 4, 80 is a correct answer
2 Correct 2 ms 376 KB n = 9, 110 is a correct answer
3 Correct 2 ms 376 KB n = 4, 21 is a correct answer
4 Correct 2 ms 376 KB n = 3, 4 is a correct answer
5 Correct 2 ms 376 KB n = 2, 62 is a correct answer
6 Correct 2 ms 376 KB n = 2, 3 is a correct answer
7 Correct 2 ms 376 KB n = 3, 29 is a correct answer
8 Correct 2 ms 376 KB n = 2, 3 is a correct answer
9 Correct 2 ms 376 KB n = 2, 3 is a correct answer
10 Correct 2 ms 376 KB n = 2, 2000000001 is a correct answer
11 Correct 2 ms 376 KB n = 2, 3000000000 is a correct answer
12 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
13 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
14 Correct 2 ms 376 KB n = 4, 3000000001 is a correct answer
15 Correct 2 ms 376 KB n = 4, 4000000000 is a correct answer
16 Correct 2 ms 376 KB n = 5, 4000000000 is a correct answer
17 Correct 2 ms 380 KB n = 10, 1000000343 is a correct answer
18 Correct 2 ms 376 KB n = 10, 3189 is a correct answer
19 Correct 2 ms 376 KB n = 10, 7000000000 is a correct answer
20 Correct 2 ms 376 KB n = 5, 12 is a correct answer
21 Correct 2 ms 376 KB n = 5, 25 is a correct answer
22 Correct 2 ms 452 KB n = 2, 122 is a correct answer
23 Correct 2 ms 376 KB n = 10, 117 is a correct answer
24 Correct 2 ms 376 KB n = 10, 336 is a correct answer
25 Correct 2 ms 376 KB n = 10, 438 is a correct answer
26 Correct 2 ms 376 KB n = 10, 206 is a correct answer
27 Correct 2 ms 376 KB n = 10, 636 is a correct answer
28 Correct 2 ms 376 KB n = 4, 2399 is a correct answer
29 Correct 2 ms 376 KB n = 10, 10992 is a correct answer
30 Correct 2 ms 256 KB n = 10, 3112 is a correct answer
31 Correct 76 ms 376 KB n = 100, 51000000001 is a correct answer
32 Correct 7 ms 380 KB n = 50, 197881272 is a correct answer
33 Correct 77 ms 508 KB n = 100, 20969 is a correct answer
34 Correct 76 ms 384 KB n = 100, 20969 is a correct answer
35 Correct 77 ms 376 KB n = 100, 52000000000 is a correct answer
36 Correct 76 ms 376 KB n = 100, 285 is a correct answer
37 Correct 76 ms 376 KB n = 100, 21272 is a correct answer
38 Correct 76 ms 376 KB n = 100, 12161 is a correct answer
39 Correct 2 ms 376 KB n = 2, 62 is a correct answer
40 Correct 2 ms 376 KB n = 2, 3 is a correct answer
41 Correct 2 ms 376 KB n = 3, 29 is a correct answer
42 Correct 2 ms 376 KB n = 2, 3 is a correct answer
43 Correct 2 ms 376 KB n = 2, 3 is a correct answer
44 Correct 2 ms 256 KB n = 2, 2000000001 is a correct answer
45 Correct 2 ms 376 KB n = 2, 3000000000 is a correct answer
46 Correct 1 ms 376 KB n = 3, 3000000000 is a correct answer
47 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
48 Correct 2 ms 376 KB n = 4, 3000000001 is a correct answer
49 Correct 2 ms 376 KB n = 4, 4000000000 is a correct answer
50 Correct 2 ms 380 KB n = 5, 4000000000 is a correct answer
51 Correct 2 ms 376 KB n = 10, 1000000343 is a correct answer
52 Correct 2 ms 376 KB n = 10, 3189 is a correct answer
53 Correct 2 ms 376 KB n = 10, 7000000000 is a correct answer
54 Correct 2 ms 376 KB n = 5, 12 is a correct answer
55 Correct 2 ms 376 KB n = 5, 25 is a correct answer
56 Correct 2 ms 376 KB n = 2, 122 is a correct answer
57 Correct 2 ms 376 KB n = 10, 117 is a correct answer
58 Correct 2 ms 376 KB n = 10, 336 is a correct answer
59 Correct 2 ms 376 KB n = 10, 438 is a correct answer
60 Correct 2 ms 376 KB n = 10, 206 is a correct answer
61 Correct 2 ms 376 KB n = 10, 636 is a correct answer
62 Correct 2 ms 376 KB n = 4, 2399 is a correct answer
63 Correct 2 ms 376 KB n = 10, 10992 is a correct answer
64 Correct 2 ms 376 KB n = 10, 3112 is a correct answer
65 Correct 76 ms 376 KB n = 100, 51000000001 is a correct answer
66 Correct 7 ms 376 KB n = 50, 197881272 is a correct answer
67 Correct 78 ms 376 KB n = 100, 20969 is a correct answer
68 Correct 77 ms 504 KB n = 100, 20969 is a correct answer
69 Correct 77 ms 376 KB n = 100, 52000000000 is a correct answer
70 Correct 77 ms 504 KB n = 100, 285 is a correct answer
71 Correct 76 ms 376 KB n = 100, 21272 is a correct answer
72 Correct 76 ms 424 KB n = 100, 12161 is a correct answer
73 Execution timed out 2033 ms 376 KB Time limit exceeded
74 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB n = 4, 80 is a correct answer
2 Correct 2 ms 376 KB n = 9, 110 is a correct answer
3 Correct 2 ms 376 KB n = 4, 21 is a correct answer
4 Correct 2 ms 376 KB n = 3, 4 is a correct answer
5 Correct 2 ms 376 KB n = 2, 62 is a correct answer
6 Correct 2 ms 376 KB n = 2, 3 is a correct answer
7 Correct 2 ms 376 KB n = 3, 29 is a correct answer
8 Correct 2 ms 376 KB n = 2, 3 is a correct answer
9 Correct 2 ms 376 KB n = 2, 3 is a correct answer
10 Correct 2 ms 376 KB n = 2, 2000000001 is a correct answer
11 Correct 2 ms 376 KB n = 2, 3000000000 is a correct answer
12 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
13 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
14 Correct 2 ms 376 KB n = 4, 3000000001 is a correct answer
15 Correct 2 ms 376 KB n = 4, 4000000000 is a correct answer
16 Correct 2 ms 376 KB n = 5, 4000000000 is a correct answer
17 Correct 2 ms 380 KB n = 10, 1000000343 is a correct answer
18 Correct 2 ms 376 KB n = 10, 3189 is a correct answer
19 Correct 2 ms 376 KB n = 10, 7000000000 is a correct answer
20 Correct 2 ms 376 KB n = 5, 12 is a correct answer
21 Correct 2 ms 376 KB n = 5, 25 is a correct answer
22 Correct 2 ms 452 KB n = 2, 122 is a correct answer
23 Correct 2 ms 376 KB n = 10, 117 is a correct answer
24 Correct 2 ms 376 KB n = 10, 336 is a correct answer
25 Correct 2 ms 376 KB n = 10, 438 is a correct answer
26 Correct 2 ms 376 KB n = 10, 206 is a correct answer
27 Correct 2 ms 376 KB n = 10, 636 is a correct answer
28 Correct 2 ms 376 KB n = 4, 2399 is a correct answer
29 Correct 2 ms 376 KB n = 10, 10992 is a correct answer
30 Correct 2 ms 256 KB n = 10, 3112 is a correct answer
31 Correct 76 ms 376 KB n = 100, 51000000001 is a correct answer
32 Correct 7 ms 380 KB n = 50, 197881272 is a correct answer
33 Correct 77 ms 508 KB n = 100, 20969 is a correct answer
34 Correct 76 ms 384 KB n = 100, 20969 is a correct answer
35 Correct 77 ms 376 KB n = 100, 52000000000 is a correct answer
36 Correct 76 ms 376 KB n = 100, 285 is a correct answer
37 Correct 76 ms 376 KB n = 100, 21272 is a correct answer
38 Correct 76 ms 376 KB n = 100, 12161 is a correct answer
39 Correct 2 ms 376 KB n = 2, 62 is a correct answer
40 Correct 2 ms 376 KB n = 2, 3 is a correct answer
41 Correct 2 ms 376 KB n = 3, 29 is a correct answer
42 Correct 2 ms 376 KB n = 2, 3 is a correct answer
43 Correct 2 ms 376 KB n = 2, 3 is a correct answer
44 Correct 2 ms 256 KB n = 2, 2000000001 is a correct answer
45 Correct 2 ms 376 KB n = 2, 3000000000 is a correct answer
46 Correct 1 ms 376 KB n = 3, 3000000000 is a correct answer
47 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
48 Correct 2 ms 376 KB n = 4, 3000000001 is a correct answer
49 Correct 2 ms 376 KB n = 4, 4000000000 is a correct answer
50 Correct 2 ms 380 KB n = 5, 4000000000 is a correct answer
51 Correct 2 ms 376 KB n = 10, 1000000343 is a correct answer
52 Correct 2 ms 376 KB n = 10, 3189 is a correct answer
53 Correct 2 ms 376 KB n = 10, 7000000000 is a correct answer
54 Correct 2 ms 376 KB n = 5, 12 is a correct answer
55 Correct 2 ms 376 KB n = 5, 25 is a correct answer
56 Correct 2 ms 376 KB n = 2, 122 is a correct answer
57 Correct 2 ms 376 KB n = 10, 117 is a correct answer
58 Correct 2 ms 376 KB n = 10, 336 is a correct answer
59 Correct 2 ms 376 KB n = 10, 438 is a correct answer
60 Correct 2 ms 376 KB n = 10, 206 is a correct answer
61 Correct 2 ms 376 KB n = 10, 636 is a correct answer
62 Correct 2 ms 376 KB n = 4, 2399 is a correct answer
63 Correct 2 ms 376 KB n = 10, 10992 is a correct answer
64 Correct 2 ms 376 KB n = 10, 3112 is a correct answer
65 Correct 76 ms 376 KB n = 100, 51000000001 is a correct answer
66 Correct 7 ms 376 KB n = 50, 197881272 is a correct answer
67 Correct 78 ms 376 KB n = 100, 20969 is a correct answer
68 Correct 77 ms 504 KB n = 100, 20969 is a correct answer
69 Correct 77 ms 376 KB n = 100, 52000000000 is a correct answer
70 Correct 77 ms 504 KB n = 100, 285 is a correct answer
71 Correct 76 ms 376 KB n = 100, 21272 is a correct answer
72 Correct 76 ms 424 KB n = 100, 12161 is a correct answer
73 Execution timed out 2033 ms 376 KB Time limit exceeded
74 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB n = 4, 80 is a correct answer
2 Correct 2 ms 376 KB n = 9, 110 is a correct answer
3 Correct 2 ms 376 KB n = 4, 21 is a correct answer
4 Correct 2 ms 376 KB n = 3, 4 is a correct answer
5 Correct 2 ms 376 KB n = 2, 62 is a correct answer
6 Correct 2 ms 376 KB n = 2, 3 is a correct answer
7 Correct 2 ms 376 KB n = 3, 29 is a correct answer
8 Correct 2 ms 376 KB n = 2, 3 is a correct answer
9 Correct 2 ms 376 KB n = 2, 3 is a correct answer
10 Correct 2 ms 376 KB n = 2, 2000000001 is a correct answer
11 Correct 2 ms 376 KB n = 2, 3000000000 is a correct answer
12 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
13 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
14 Correct 2 ms 376 KB n = 4, 3000000001 is a correct answer
15 Correct 2 ms 376 KB n = 4, 4000000000 is a correct answer
16 Correct 2 ms 376 KB n = 5, 4000000000 is a correct answer
17 Correct 2 ms 380 KB n = 10, 1000000343 is a correct answer
18 Correct 2 ms 376 KB n = 10, 3189 is a correct answer
19 Correct 2 ms 376 KB n = 10, 7000000000 is a correct answer
20 Correct 2 ms 376 KB n = 5, 12 is a correct answer
21 Correct 2 ms 376 KB n = 5, 25 is a correct answer
22 Correct 2 ms 452 KB n = 2, 122 is a correct answer
23 Correct 2 ms 376 KB n = 10, 117 is a correct answer
24 Correct 2 ms 376 KB n = 10, 336 is a correct answer
25 Correct 2 ms 376 KB n = 10, 438 is a correct answer
26 Correct 2 ms 376 KB n = 10, 206 is a correct answer
27 Correct 2 ms 376 KB n = 10, 636 is a correct answer
28 Correct 2 ms 376 KB n = 4, 2399 is a correct answer
29 Correct 2 ms 376 KB n = 10, 10992 is a correct answer
30 Correct 2 ms 256 KB n = 10, 3112 is a correct answer
31 Correct 76 ms 376 KB n = 100, 51000000001 is a correct answer
32 Correct 7 ms 380 KB n = 50, 197881272 is a correct answer
33 Correct 77 ms 508 KB n = 100, 20969 is a correct answer
34 Correct 76 ms 384 KB n = 100, 20969 is a correct answer
35 Correct 77 ms 376 KB n = 100, 52000000000 is a correct answer
36 Correct 76 ms 376 KB n = 100, 285 is a correct answer
37 Correct 76 ms 376 KB n = 100, 21272 is a correct answer
38 Correct 76 ms 376 KB n = 100, 12161 is a correct answer
39 Correct 2 ms 376 KB n = 2, 62 is a correct answer
40 Correct 2 ms 376 KB n = 2, 3 is a correct answer
41 Correct 2 ms 376 KB n = 3, 29 is a correct answer
42 Correct 2 ms 376 KB n = 2, 3 is a correct answer
43 Correct 2 ms 376 KB n = 2, 3 is a correct answer
44 Correct 2 ms 256 KB n = 2, 2000000001 is a correct answer
45 Correct 2 ms 376 KB n = 2, 3000000000 is a correct answer
46 Correct 1 ms 376 KB n = 3, 3000000000 is a correct answer
47 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
48 Correct 2 ms 376 KB n = 4, 3000000001 is a correct answer
49 Correct 2 ms 376 KB n = 4, 4000000000 is a correct answer
50 Correct 2 ms 380 KB n = 5, 4000000000 is a correct answer
51 Correct 2 ms 376 KB n = 10, 1000000343 is a correct answer
52 Correct 2 ms 376 KB n = 10, 3189 is a correct answer
53 Correct 2 ms 376 KB n = 10, 7000000000 is a correct answer
54 Correct 2 ms 376 KB n = 5, 12 is a correct answer
55 Correct 2 ms 376 KB n = 5, 25 is a correct answer
56 Correct 2 ms 376 KB n = 2, 122 is a correct answer
57 Correct 2 ms 376 KB n = 10, 117 is a correct answer
58 Correct 2 ms 376 KB n = 10, 336 is a correct answer
59 Correct 2 ms 376 KB n = 10, 438 is a correct answer
60 Correct 2 ms 376 KB n = 10, 206 is a correct answer
61 Correct 2 ms 376 KB n = 10, 636 is a correct answer
62 Correct 2 ms 376 KB n = 4, 2399 is a correct answer
63 Correct 2 ms 376 KB n = 10, 10992 is a correct answer
64 Correct 2 ms 376 KB n = 10, 3112 is a correct answer
65 Correct 76 ms 376 KB n = 100, 51000000001 is a correct answer
66 Correct 7 ms 376 KB n = 50, 197881272 is a correct answer
67 Correct 78 ms 376 KB n = 100, 20969 is a correct answer
68 Correct 77 ms 504 KB n = 100, 20969 is a correct answer
69 Correct 77 ms 376 KB n = 100, 52000000000 is a correct answer
70 Correct 77 ms 504 KB n = 100, 285 is a correct answer
71 Correct 76 ms 376 KB n = 100, 21272 is a correct answer
72 Correct 76 ms 424 KB n = 100, 12161 is a correct answer
73 Execution timed out 2033 ms 376 KB Time limit exceeded
74 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB n = 4, 80 is a correct answer
2 Correct 2 ms 376 KB n = 9, 110 is a correct answer
3 Correct 2 ms 376 KB n = 4, 21 is a correct answer
4 Correct 2 ms 376 KB n = 3, 4 is a correct answer
5 Correct 2 ms 376 KB n = 2, 62 is a correct answer
6 Correct 2 ms 376 KB n = 2, 3 is a correct answer
7 Correct 2 ms 376 KB n = 3, 29 is a correct answer
8 Correct 2 ms 376 KB n = 2, 3 is a correct answer
9 Correct 2 ms 376 KB n = 2, 3 is a correct answer
10 Correct 2 ms 376 KB n = 2, 2000000001 is a correct answer
11 Correct 2 ms 376 KB n = 2, 3000000000 is a correct answer
12 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
13 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
14 Correct 2 ms 376 KB n = 4, 3000000001 is a correct answer
15 Correct 2 ms 376 KB n = 4, 4000000000 is a correct answer
16 Correct 2 ms 376 KB n = 5, 4000000000 is a correct answer
17 Correct 2 ms 380 KB n = 10, 1000000343 is a correct answer
18 Correct 2 ms 376 KB n = 10, 3189 is a correct answer
19 Correct 2 ms 376 KB n = 10, 7000000000 is a correct answer
20 Correct 2 ms 376 KB n = 5, 12 is a correct answer
21 Correct 2 ms 376 KB n = 5, 25 is a correct answer
22 Correct 2 ms 452 KB n = 2, 122 is a correct answer
23 Correct 2 ms 376 KB n = 10, 117 is a correct answer
24 Correct 2 ms 376 KB n = 10, 336 is a correct answer
25 Correct 2 ms 376 KB n = 10, 438 is a correct answer
26 Correct 2 ms 376 KB n = 10, 206 is a correct answer
27 Correct 2 ms 376 KB n = 10, 636 is a correct answer
28 Correct 2 ms 376 KB n = 4, 2399 is a correct answer
29 Correct 2 ms 376 KB n = 10, 10992 is a correct answer
30 Correct 2 ms 256 KB n = 10, 3112 is a correct answer
31 Correct 76 ms 376 KB n = 100, 51000000001 is a correct answer
32 Correct 7 ms 380 KB n = 50, 197881272 is a correct answer
33 Correct 77 ms 508 KB n = 100, 20969 is a correct answer
34 Correct 76 ms 384 KB n = 100, 20969 is a correct answer
35 Correct 77 ms 376 KB n = 100, 52000000000 is a correct answer
36 Correct 76 ms 376 KB n = 100, 285 is a correct answer
37 Correct 76 ms 376 KB n = 100, 21272 is a correct answer
38 Correct 76 ms 376 KB n = 100, 12161 is a correct answer
39 Correct 2 ms 376 KB n = 2, 62 is a correct answer
40 Correct 2 ms 376 KB n = 2, 3 is a correct answer
41 Correct 2 ms 376 KB n = 3, 29 is a correct answer
42 Correct 2 ms 376 KB n = 2, 3 is a correct answer
43 Correct 2 ms 376 KB n = 2, 3 is a correct answer
44 Correct 2 ms 256 KB n = 2, 2000000001 is a correct answer
45 Correct 2 ms 376 KB n = 2, 3000000000 is a correct answer
46 Correct 1 ms 376 KB n = 3, 3000000000 is a correct answer
47 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
48 Correct 2 ms 376 KB n = 4, 3000000001 is a correct answer
49 Correct 2 ms 376 KB n = 4, 4000000000 is a correct answer
50 Correct 2 ms 380 KB n = 5, 4000000000 is a correct answer
51 Correct 2 ms 376 KB n = 10, 1000000343 is a correct answer
52 Correct 2 ms 376 KB n = 10, 3189 is a correct answer
53 Correct 2 ms 376 KB n = 10, 7000000000 is a correct answer
54 Correct 2 ms 376 KB n = 5, 12 is a correct answer
55 Correct 2 ms 376 KB n = 5, 25 is a correct answer
56 Correct 2 ms 376 KB n = 2, 122 is a correct answer
57 Correct 2 ms 376 KB n = 10, 117 is a correct answer
58 Correct 2 ms 376 KB n = 10, 336 is a correct answer
59 Correct 2 ms 376 KB n = 10, 438 is a correct answer
60 Correct 2 ms 376 KB n = 10, 206 is a correct answer
61 Correct 2 ms 376 KB n = 10, 636 is a correct answer
62 Correct 2 ms 376 KB n = 4, 2399 is a correct answer
63 Correct 2 ms 376 KB n = 10, 10992 is a correct answer
64 Correct 2 ms 376 KB n = 10, 3112 is a correct answer
65 Correct 76 ms 376 KB n = 100, 51000000001 is a correct answer
66 Correct 7 ms 376 KB n = 50, 197881272 is a correct answer
67 Correct 78 ms 376 KB n = 100, 20969 is a correct answer
68 Correct 77 ms 504 KB n = 100, 20969 is a correct answer
69 Correct 77 ms 376 KB n = 100, 52000000000 is a correct answer
70 Correct 77 ms 504 KB n = 100, 285 is a correct answer
71 Correct 76 ms 376 KB n = 100, 21272 is a correct answer
72 Correct 76 ms 424 KB n = 100, 12161 is a correct answer
73 Execution timed out 2033 ms 376 KB Time limit exceeded
74 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB n = 4, 80 is a correct answer
2 Correct 2 ms 376 KB n = 9, 110 is a correct answer
3 Correct 2 ms 376 KB n = 4, 21 is a correct answer
4 Correct 2 ms 376 KB n = 3, 4 is a correct answer
5 Correct 2 ms 376 KB n = 2, 62 is a correct answer
6 Correct 2 ms 376 KB n = 2, 3 is a correct answer
7 Correct 2 ms 376 KB n = 3, 29 is a correct answer
8 Correct 2 ms 376 KB n = 2, 3 is a correct answer
9 Correct 2 ms 376 KB n = 2, 3 is a correct answer
10 Correct 2 ms 376 KB n = 2, 2000000001 is a correct answer
11 Correct 2 ms 376 KB n = 2, 3000000000 is a correct answer
12 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
13 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
14 Correct 2 ms 376 KB n = 4, 3000000001 is a correct answer
15 Correct 2 ms 376 KB n = 4, 4000000000 is a correct answer
16 Correct 2 ms 376 KB n = 5, 4000000000 is a correct answer
17 Correct 2 ms 380 KB n = 10, 1000000343 is a correct answer
18 Correct 2 ms 376 KB n = 10, 3189 is a correct answer
19 Correct 2 ms 376 KB n = 10, 7000000000 is a correct answer
20 Correct 2 ms 376 KB n = 5, 12 is a correct answer
21 Correct 2 ms 376 KB n = 5, 25 is a correct answer
22 Correct 2 ms 452 KB n = 2, 122 is a correct answer
23 Correct 2 ms 376 KB n = 10, 117 is a correct answer
24 Correct 2 ms 376 KB n = 10, 336 is a correct answer
25 Correct 2 ms 376 KB n = 10, 438 is a correct answer
26 Correct 2 ms 376 KB n = 10, 206 is a correct answer
27 Correct 2 ms 376 KB n = 10, 636 is a correct answer
28 Correct 2 ms 376 KB n = 4, 2399 is a correct answer
29 Correct 2 ms 376 KB n = 10, 10992 is a correct answer
30 Correct 2 ms 256 KB n = 10, 3112 is a correct answer
31 Correct 76 ms 376 KB n = 100, 51000000001 is a correct answer
32 Correct 7 ms 380 KB n = 50, 197881272 is a correct answer
33 Correct 77 ms 508 KB n = 100, 20969 is a correct answer
34 Correct 76 ms 384 KB n = 100, 20969 is a correct answer
35 Correct 77 ms 376 KB n = 100, 52000000000 is a correct answer
36 Correct 76 ms 376 KB n = 100, 285 is a correct answer
37 Correct 76 ms 376 KB n = 100, 21272 is a correct answer
38 Correct 76 ms 376 KB n = 100, 12161 is a correct answer
39 Correct 2 ms 376 KB n = 2, 62 is a correct answer
40 Correct 2 ms 376 KB n = 2, 3 is a correct answer
41 Correct 2 ms 376 KB n = 3, 29 is a correct answer
42 Correct 2 ms 376 KB n = 2, 3 is a correct answer
43 Correct 2 ms 376 KB n = 2, 3 is a correct answer
44 Correct 2 ms 256 KB n = 2, 2000000001 is a correct answer
45 Correct 2 ms 376 KB n = 2, 3000000000 is a correct answer
46 Correct 1 ms 376 KB n = 3, 3000000000 is a correct answer
47 Correct 2 ms 376 KB n = 3, 3000000000 is a correct answer
48 Correct 2 ms 376 KB n = 4, 3000000001 is a correct answer
49 Correct 2 ms 376 KB n = 4, 4000000000 is a correct answer
50 Correct 2 ms 380 KB n = 5, 4000000000 is a correct answer
51 Correct 2 ms 376 KB n = 10, 1000000343 is a correct answer
52 Correct 2 ms 376 KB n = 10, 3189 is a correct answer
53 Correct 2 ms 376 KB n = 10, 7000000000 is a correct answer
54 Correct 2 ms 376 KB n = 5, 12 is a correct answer
55 Correct 2 ms 376 KB n = 5, 25 is a correct answer
56 Correct 2 ms 376 KB n = 2, 122 is a correct answer
57 Correct 2 ms 376 KB n = 10, 117 is a correct answer
58 Correct 2 ms 376 KB n = 10, 336 is a correct answer
59 Correct 2 ms 376 KB n = 10, 438 is a correct answer
60 Correct 2 ms 376 KB n = 10, 206 is a correct answer
61 Correct 2 ms 376 KB n = 10, 636 is a correct answer
62 Correct 2 ms 376 KB n = 4, 2399 is a correct answer
63 Correct 2 ms 376 KB n = 10, 10992 is a correct answer
64 Correct 2 ms 376 KB n = 10, 3112 is a correct answer
65 Correct 76 ms 376 KB n = 100, 51000000001 is a correct answer
66 Correct 7 ms 376 KB n = 50, 197881272 is a correct answer
67 Correct 78 ms 376 KB n = 100, 20969 is a correct answer
68 Correct 77 ms 504 KB n = 100, 20969 is a correct answer
69 Correct 77 ms 376 KB n = 100, 52000000000 is a correct answer
70 Correct 77 ms 504 KB n = 100, 285 is a correct answer
71 Correct 76 ms 376 KB n = 100, 21272 is a correct answer
72 Correct 76 ms 424 KB n = 100, 12161 is a correct answer
73 Execution timed out 2033 ms 376 KB Time limit exceeded
74 Halted 0 ms 0 KB -