#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
const int N = (int)1e5 + 100;
ll H[N], W[N];
int dir[4][2] = {{0,+1},{0,-1},{+1,0},{-1,0}};
int n;
int sol = 0;
struct E{
ll val;
ll sec;
int idx;
bool operator<(const E &e) const {
if(val == e.val)
return sec < e.sec;
return val < e.val;
}
};
vector<E> vv[4][4];
struct node{
pii low_val;
pii sol;
ll lazy;
};
struct segment_tree{
vector<ll> vls;
vector<node> pap;
int m;
void build(int node, int cl, int cr){
pap[node].lazy = -(ll)1e18;
if(cl == cr){
pap[node].low_val = mp(vls[cl], cl);
pap[node].sol = mp((ll)1e18, cl);
return;
}
int mid = (cl + cr) / 2;
build(node * 2, cl, mid);
build(node * 2 + 1, mid + 1, cr);
pap[node].low_val = min(pap[node*2].low_val, pap[node*2+1].low_val);
pap[node].sol = min(pap[node*2].sol, pap[node*2+1].sol);
}
void init(vector<E> sha){
vls.clear();
pap.clear();
m = sha.size();
if(m == 0) return;
pap.resize(4 * m + 16);
for(int i = 0 ; i < m ; i ++ ){
vls.push_back(sha[i].sec);
}
build(1, 0, m - 1);
}
void push(int node, int cl, int cr){
pap[node].sol = min(pap[node].sol, mp(pap[node].low_val.fi - pap[node].lazy,pap[node].low_val.se));
if(cl != cr){
pap[node*2].lazy = max(pap[node*2].lazy, pap[node].lazy);
pap[node*2+1].lazy = max(pap[node*2+1].lazy, pap[node].lazy);
}
}
void update(int node, int cl, int cr, int tl, int tr, ll vv){
push(node, cl, cr);
if(cr < tl || cl > tr){
return;
}
if(cl >= tl && cr <= tr){
pap[node].lazy = max(pap[node].lazy, vv);
push(node, cl, cr);
return;
}
int mid = (cl + cr) / 2;
update(node * 2, cl, mid, tl, tr, vv);
update(node * 2 + 1, mid + 1, cr, tl, tr, vv);
pap[node].sol = min(pap[node * 2].sol, pap[node * 2 + 1].sol);
}
void clean(int node, int cl, int cr, int id){
push(node, cl, cr);
if(cl == cr){
pap[node].low_val = mp((ll)1e18, id);
pap[node].sol = mp((ll)1e18, id);
return;
}
int mid = (cl + cr) / 2;
if(mid >= id)
clean(node * 2, cl, mid, id);
else
clean(node * 2 + 1, mid + 1, cr, id);
pap[node].low_val = min(pap[node*2].low_val, pap[node*2+1].low_val);
pap[node].sol = min(pap[node * 2].sol, pap[node * 2 + 1].sol);
pap[node].sol = min(pap[node].sol, mp(pap[node].low_val.fi - pap[node].lazy, pap[node].low_val.se));
}
};
segment_tree opt[4][4];
int go[N];
ll low[N];
int solve(){
go[0] = 0;
for(int i = 2; i <= n; i ++ ){
if(abs(H[i]) == abs(W[i])){
if(W[i] < 0) go[i] = 0;
else {
if(H[i] > 0)
go[i] = 3;
else
go[i] = 2;
}
}
else{
if(abs(H[i]) > abs(W[i])){
if(H[i] > 0)
go[i] = 3;
else
go[i] = 2;
}
else{
if(W[i] > 0){
go[i] = 1;
}
else{
go[i] = 0;
}
}
}
low[i]=(ll)1e18;
}
low[1]=0;
for(int p = 0 ; p < 4; p ++ ){
for(int q = 0; q < 4; q ++ ){
vv[p][q].clear();
}
}
E cur;
ll AH, AW;
for(int p = 0 ; p < 4; p ++ ){
for(int i = 1; i <= n; i ++ ){
if(go[i] != p){
AH = dir[p][0] - dir[go[i]][0];
AW = dir[p][1] - dir[go[i]][1];
cur.val = AW * 1ll * H[i] - AH * 1ll * W[i];
if(AH != 0) cur.sec = H[i] / AH;
else cur.sec = W[i] / AW;
cur.idx = i;
vv[p][go[i]].push_back(cur);
}
}
}
for(int p = 0 ; p < 4; p ++ ){
for(int q = 0; q < 4; q ++ ){
sort(vv[p][q].begin(), vv[p][q].end());
opt[p][q].init(vv[p][q]);
}
}
int cnt = 0;
int id = -1;
ll nw;
int cid;
ll add;
int lf, rf;
int nex;
int iq;
while(1){
if(cnt == 0){
id = 1;
low[id] = 0;
}
else{
nw = (ll)2e18;
cid = -1;
for(int p = 0; p < 4; p ++ ){
for(int q = 0; q < 4; q ++ ){
if(p == q || opt[p][q].m == 0) continue;
if(opt[p][q].pap[1].sol.fi < nw){
nw = opt[p][q].pap[1].sol.fi;
cid = vv[p][q][opt[p][q].pap[1].sol.se].idx;
}
}
}
if(nw > (ll)1e14) break;
id = cid;
low[id] = nw;
}
cnt ++ ;
for(int p = 0 ; p < 4; p ++ ){
if(p == go[id]) continue;
AH = dir[p][0] - dir[go[id]][0];
AW = dir[p][1] - dir[go[id]][1];
cur.val = AW * H[id] - AH * W[id];
if(AH != 0) cur.sec = H[id] / AH;
else cur.sec = W[id] / AW;
cur.idx = -1;
iq = lower_bound(vv[p][go[id]].begin(), vv[p][go[id]].end(), cur) - vv[p][go[id]].begin();
opt[p][go[id]].clean(1, 0, opt[p][go[id]].m - 1, iq);
}
for(int nx = 0; nx < 4; nx ++ ){
if(nx == go[id] || vv[go[id]][nx].empty()) continue;
AH = dir[go[id]][0] - dir[nx][0];
AW = dir[go[id]][1] - dir[nx][1];
cur.val = AW * H[id] - AH * W[id];
cur.sec = low[id];
if(AH != 0) add = H[id] / AH;
else add = W[id] / AW;
cur.sec += add;
lf = lower_bound(vv[go[id]][nx].begin(), vv[go[id]][nx].end(), cur) - vv[go[id]][nx].begin();
if(lf < vv[go[id]][nx].size() && vv[go[id]][nx][lf].val == cur.val){
rf = lf;
for(int lg = 17; lg >= 0 ; lg -- ){
nex = rf + (1 << lg);
if(nex < vv[go[id]][nx].size() && vv[go[id]][nx][nex].val == cur.val){
rf = nex;
}
}
opt[go[id]][nx].update(1, 0, opt[go[id]][nx].m - 1, lf, rf, add);
}
}
}
return cnt;
}
int main(){
fastIO;
cin >> n;
for(int i = 1; i <= n; i ++ ){
cin >> H[i] >> W[i];
H[i] *= 2ll;
W[i] *= 2ll;
if(i > 1){
H[i] -= H[1];
W[i] -= W[1];
}
}
H[1] = 0;
W[1] = 0;
int sol = solve();
for(int i = 1; i <= n; i ++ ){
W[i] = -W[i];
}
sol = max(sol, solve());
for(int i = 1; i <= n; i ++ ){
swap(H[i], W[i]);
}
sol = max(sol, solve());
for(int i = 1; i <= n; i ++ ){
W[i] = -W[i];
}
sol = max(sol, solve());
cout << sol << "\n";
return 0;
}
Compilation message
fever.cpp: In function 'int solve()':
fever.cpp:220:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<E>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
220 | if(lf < vv[go[id]][nx].size() && vv[go[id]][nx][lf].val == cur.val){
| ~~~^~~~~~~~~~~~~~~~~~~~~~~
fever.cpp:224:28: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<E>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
224 | if(nex < vv[go[id]][nx].size() && vv[go[id]][nx][nex].val == cur.val){
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
1 ms |
332 KB |
Output is correct |
9 |
Correct |
1 ms |
332 KB |
Output is correct |
10 |
Correct |
1 ms |
332 KB |
Output is correct |
11 |
Correct |
1 ms |
332 KB |
Output is correct |
12 |
Correct |
0 ms |
332 KB |
Output is correct |
13 |
Correct |
1 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
1 ms |
332 KB |
Output is correct |
17 |
Correct |
1 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
0 ms |
332 KB |
Output is correct |
20 |
Correct |
1 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
1 ms |
332 KB |
Output is correct |
23 |
Correct |
1 ms |
332 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
336 KB |
Output is correct |
26 |
Correct |
1 ms |
332 KB |
Output is correct |
27 |
Correct |
1 ms |
332 KB |
Output is correct |
28 |
Correct |
1 ms |
332 KB |
Output is correct |
29 |
Correct |
1 ms |
332 KB |
Output is correct |
30 |
Correct |
1 ms |
332 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
1 ms |
332 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
1 ms |
332 KB |
Output is correct |
9 |
Correct |
1 ms |
332 KB |
Output is correct |
10 |
Correct |
1 ms |
332 KB |
Output is correct |
11 |
Correct |
1 ms |
332 KB |
Output is correct |
12 |
Correct |
0 ms |
332 KB |
Output is correct |
13 |
Correct |
1 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
1 ms |
332 KB |
Output is correct |
17 |
Correct |
1 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
0 ms |
332 KB |
Output is correct |
20 |
Correct |
1 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
1 ms |
332 KB |
Output is correct |
23 |
Correct |
1 ms |
332 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
336 KB |
Output is correct |
26 |
Correct |
1 ms |
332 KB |
Output is correct |
27 |
Correct |
1 ms |
332 KB |
Output is correct |
28 |
Correct |
1 ms |
332 KB |
Output is correct |
29 |
Correct |
1 ms |
332 KB |
Output is correct |
30 |
Correct |
1 ms |
332 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
1 ms |
332 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
1 ms |
332 KB |
Output is correct |
35 |
Correct |
1 ms |
332 KB |
Output is correct |
36 |
Correct |
1 ms |
332 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
1 ms |
332 KB |
Output is correct |
39 |
Correct |
1 ms |
332 KB |
Output is correct |
40 |
Correct |
1 ms |
332 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
1 ms |
332 KB |
Output is correct |
43 |
Correct |
1 ms |
332 KB |
Output is correct |
44 |
Correct |
1 ms |
332 KB |
Output is correct |
45 |
Correct |
1 ms |
332 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
460 KB |
Output is correct |
2 |
Correct |
1 ms |
460 KB |
Output is correct |
3 |
Correct |
1 ms |
460 KB |
Output is correct |
4 |
Correct |
1 ms |
460 KB |
Output is correct |
5 |
Correct |
1 ms |
460 KB |
Output is correct |
6 |
Correct |
1 ms |
460 KB |
Output is correct |
7 |
Correct |
1 ms |
460 KB |
Output is correct |
8 |
Correct |
1 ms |
460 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
1 ms |
332 KB |
Output is correct |
9 |
Correct |
1 ms |
332 KB |
Output is correct |
10 |
Correct |
1 ms |
332 KB |
Output is correct |
11 |
Correct |
1 ms |
332 KB |
Output is correct |
12 |
Correct |
0 ms |
332 KB |
Output is correct |
13 |
Correct |
1 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
1 ms |
332 KB |
Output is correct |
17 |
Correct |
1 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
0 ms |
332 KB |
Output is correct |
20 |
Correct |
1 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
1 ms |
332 KB |
Output is correct |
23 |
Correct |
1 ms |
332 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
336 KB |
Output is correct |
26 |
Correct |
1 ms |
332 KB |
Output is correct |
27 |
Correct |
1 ms |
332 KB |
Output is correct |
28 |
Correct |
1 ms |
332 KB |
Output is correct |
29 |
Correct |
1 ms |
332 KB |
Output is correct |
30 |
Correct |
1 ms |
332 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
1 ms |
332 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
1 ms |
332 KB |
Output is correct |
35 |
Correct |
1 ms |
332 KB |
Output is correct |
36 |
Correct |
1 ms |
332 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
1 ms |
332 KB |
Output is correct |
39 |
Correct |
1 ms |
332 KB |
Output is correct |
40 |
Correct |
1 ms |
332 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
1 ms |
332 KB |
Output is correct |
43 |
Correct |
1 ms |
332 KB |
Output is correct |
44 |
Correct |
1 ms |
332 KB |
Output is correct |
45 |
Correct |
1 ms |
332 KB |
Output is correct |
46 |
Correct |
1 ms |
460 KB |
Output is correct |
47 |
Correct |
1 ms |
460 KB |
Output is correct |
48 |
Correct |
1 ms |
460 KB |
Output is correct |
49 |
Correct |
1 ms |
460 KB |
Output is correct |
50 |
Correct |
1 ms |
460 KB |
Output is correct |
51 |
Correct |
1 ms |
460 KB |
Output is correct |
52 |
Correct |
1 ms |
460 KB |
Output is correct |
53 |
Correct |
1 ms |
460 KB |
Output is correct |
54 |
Correct |
1 ms |
460 KB |
Output is correct |
55 |
Correct |
1 ms |
460 KB |
Output is correct |
56 |
Correct |
1 ms |
464 KB |
Output is correct |
57 |
Correct |
1 ms |
464 KB |
Output is correct |
58 |
Correct |
2 ms |
460 KB |
Output is correct |
59 |
Correct |
1 ms |
460 KB |
Output is correct |
60 |
Correct |
1 ms |
460 KB |
Output is correct |
61 |
Correct |
1 ms |
460 KB |
Output is correct |
62 |
Correct |
1 ms |
460 KB |
Output is correct |
63 |
Correct |
1 ms |
332 KB |
Output is correct |
64 |
Correct |
1 ms |
332 KB |
Output is correct |
65 |
Correct |
1 ms |
460 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
1 ms |
332 KB |
Output is correct |
9 |
Correct |
1 ms |
332 KB |
Output is correct |
10 |
Correct |
1 ms |
332 KB |
Output is correct |
11 |
Correct |
1 ms |
332 KB |
Output is correct |
12 |
Correct |
0 ms |
332 KB |
Output is correct |
13 |
Correct |
1 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
1 ms |
332 KB |
Output is correct |
17 |
Correct |
1 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
0 ms |
332 KB |
Output is correct |
20 |
Correct |
1 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
1 ms |
332 KB |
Output is correct |
23 |
Correct |
1 ms |
332 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
336 KB |
Output is correct |
26 |
Correct |
1 ms |
332 KB |
Output is correct |
27 |
Correct |
1 ms |
332 KB |
Output is correct |
28 |
Correct |
1 ms |
332 KB |
Output is correct |
29 |
Correct |
1 ms |
332 KB |
Output is correct |
30 |
Correct |
1 ms |
332 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
1 ms |
332 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
1 ms |
332 KB |
Output is correct |
35 |
Correct |
1 ms |
332 KB |
Output is correct |
36 |
Correct |
1 ms |
332 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
1 ms |
332 KB |
Output is correct |
39 |
Correct |
1 ms |
332 KB |
Output is correct |
40 |
Correct |
1 ms |
332 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
1 ms |
332 KB |
Output is correct |
43 |
Correct |
1 ms |
332 KB |
Output is correct |
44 |
Correct |
1 ms |
332 KB |
Output is correct |
45 |
Correct |
1 ms |
332 KB |
Output is correct |
46 |
Correct |
1 ms |
460 KB |
Output is correct |
47 |
Correct |
1 ms |
460 KB |
Output is correct |
48 |
Correct |
1 ms |
460 KB |
Output is correct |
49 |
Correct |
1 ms |
460 KB |
Output is correct |
50 |
Correct |
1 ms |
460 KB |
Output is correct |
51 |
Correct |
1 ms |
460 KB |
Output is correct |
52 |
Correct |
1 ms |
460 KB |
Output is correct |
53 |
Correct |
1 ms |
460 KB |
Output is correct |
54 |
Correct |
1 ms |
460 KB |
Output is correct |
55 |
Correct |
1 ms |
460 KB |
Output is correct |
56 |
Correct |
1 ms |
464 KB |
Output is correct |
57 |
Correct |
1 ms |
464 KB |
Output is correct |
58 |
Correct |
2 ms |
460 KB |
Output is correct |
59 |
Correct |
1 ms |
460 KB |
Output is correct |
60 |
Correct |
1 ms |
460 KB |
Output is correct |
61 |
Correct |
1 ms |
460 KB |
Output is correct |
62 |
Correct |
1 ms |
460 KB |
Output is correct |
63 |
Correct |
1 ms |
332 KB |
Output is correct |
64 |
Correct |
1 ms |
332 KB |
Output is correct |
65 |
Correct |
1 ms |
460 KB |
Output is correct |
66 |
Correct |
7 ms |
4492 KB |
Output is correct |
67 |
Correct |
7 ms |
4812 KB |
Output is correct |
68 |
Correct |
7 ms |
3448 KB |
Output is correct |
69 |
Correct |
47 ms |
4236 KB |
Output is correct |
70 |
Correct |
22 ms |
4572 KB |
Output is correct |
71 |
Correct |
10 ms |
4564 KB |
Output is correct |
72 |
Correct |
8 ms |
3412 KB |
Output is correct |
73 |
Correct |
7 ms |
3628 KB |
Output is correct |
74 |
Correct |
13 ms |
5708 KB |
Output is correct |
75 |
Correct |
19 ms |
5340 KB |
Output is correct |
76 |
Correct |
10 ms |
2992 KB |
Output is correct |
77 |
Correct |
9 ms |
4300 KB |
Output is correct |
78 |
Correct |
9 ms |
3192 KB |
Output is correct |
79 |
Correct |
9 ms |
2940 KB |
Output is correct |
80 |
Correct |
8 ms |
2756 KB |
Output is correct |
81 |
Correct |
10 ms |
2892 KB |
Output is correct |
82 |
Correct |
17 ms |
5580 KB |
Output is correct |
83 |
Correct |
14 ms |
5576 KB |
Output is correct |
84 |
Correct |
8 ms |
5708 KB |
Output is correct |
85 |
Correct |
8 ms |
5636 KB |
Output is correct |
86 |
Correct |
12 ms |
4580 KB |
Output is correct |
87 |
Correct |
10 ms |
5708 KB |
Output is correct |
88 |
Correct |
12 ms |
5708 KB |
Output is correct |
89 |
Correct |
14 ms |
2892 KB |
Output is correct |
90 |
Correct |
14 ms |
2896 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
1 ms |
332 KB |
Output is correct |
9 |
Correct |
1 ms |
332 KB |
Output is correct |
10 |
Correct |
1 ms |
332 KB |
Output is correct |
11 |
Correct |
1 ms |
332 KB |
Output is correct |
12 |
Correct |
0 ms |
332 KB |
Output is correct |
13 |
Correct |
1 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
1 ms |
332 KB |
Output is correct |
17 |
Correct |
1 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
0 ms |
332 KB |
Output is correct |
20 |
Correct |
1 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
1 ms |
332 KB |
Output is correct |
23 |
Correct |
1 ms |
332 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
336 KB |
Output is correct |
26 |
Correct |
1 ms |
332 KB |
Output is correct |
27 |
Correct |
1 ms |
332 KB |
Output is correct |
28 |
Correct |
1 ms |
332 KB |
Output is correct |
29 |
Correct |
1 ms |
332 KB |
Output is correct |
30 |
Correct |
1 ms |
332 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
1 ms |
332 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
1 ms |
332 KB |
Output is correct |
35 |
Correct |
1 ms |
332 KB |
Output is correct |
36 |
Correct |
1 ms |
332 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
1 ms |
332 KB |
Output is correct |
39 |
Correct |
1 ms |
332 KB |
Output is correct |
40 |
Correct |
1 ms |
332 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
1 ms |
332 KB |
Output is correct |
43 |
Correct |
1 ms |
332 KB |
Output is correct |
44 |
Correct |
1 ms |
332 KB |
Output is correct |
45 |
Correct |
1 ms |
332 KB |
Output is correct |
46 |
Correct |
1 ms |
460 KB |
Output is correct |
47 |
Correct |
1 ms |
460 KB |
Output is correct |
48 |
Correct |
1 ms |
460 KB |
Output is correct |
49 |
Correct |
1 ms |
460 KB |
Output is correct |
50 |
Correct |
1 ms |
460 KB |
Output is correct |
51 |
Correct |
1 ms |
460 KB |
Output is correct |
52 |
Correct |
1 ms |
460 KB |
Output is correct |
53 |
Correct |
1 ms |
460 KB |
Output is correct |
54 |
Correct |
1 ms |
460 KB |
Output is correct |
55 |
Correct |
1 ms |
460 KB |
Output is correct |
56 |
Correct |
1 ms |
464 KB |
Output is correct |
57 |
Correct |
1 ms |
464 KB |
Output is correct |
58 |
Correct |
2 ms |
460 KB |
Output is correct |
59 |
Correct |
1 ms |
460 KB |
Output is correct |
60 |
Correct |
1 ms |
460 KB |
Output is correct |
61 |
Correct |
1 ms |
460 KB |
Output is correct |
62 |
Correct |
1 ms |
460 KB |
Output is correct |
63 |
Correct |
1 ms |
332 KB |
Output is correct |
64 |
Correct |
1 ms |
332 KB |
Output is correct |
65 |
Correct |
1 ms |
460 KB |
Output is correct |
66 |
Correct |
189 ms |
71652 KB |
Output is correct |
67 |
Correct |
259 ms |
121596 KB |
Output is correct |
68 |
Correct |
251 ms |
127032 KB |
Output is correct |
69 |
Correct |
542 ms |
176892 KB |
Output is correct |
70 |
Correct |
919 ms |
122148 KB |
Output is correct |
71 |
Correct |
250 ms |
98144 KB |
Output is correct |
72 |
Correct |
276 ms |
103476 KB |
Output is correct |
73 |
Correct |
373 ms |
153632 KB |
Output is correct |
74 |
Correct |
252 ms |
83436 KB |
Output is correct |
75 |
Correct |
270 ms |
79964 KB |
Output is correct |
76 |
Correct |
472 ms |
78704 KB |
Output is correct |
77 |
Correct |
256 ms |
67816 KB |
Output is correct |
78 |
Correct |
537 ms |
67344 KB |
Output is correct |
79 |
Correct |
538 ms |
67468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
1 ms |
332 KB |
Output is correct |
9 |
Correct |
1 ms |
332 KB |
Output is correct |
10 |
Correct |
1 ms |
332 KB |
Output is correct |
11 |
Correct |
1 ms |
332 KB |
Output is correct |
12 |
Correct |
0 ms |
332 KB |
Output is correct |
13 |
Correct |
1 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
1 ms |
332 KB |
Output is correct |
17 |
Correct |
1 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
332 KB |
Output is correct |
19 |
Correct |
0 ms |
332 KB |
Output is correct |
20 |
Correct |
1 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 KB |
Output is correct |
22 |
Correct |
1 ms |
332 KB |
Output is correct |
23 |
Correct |
1 ms |
332 KB |
Output is correct |
24 |
Correct |
1 ms |
332 KB |
Output is correct |
25 |
Correct |
1 ms |
336 KB |
Output is correct |
26 |
Correct |
1 ms |
332 KB |
Output is correct |
27 |
Correct |
1 ms |
332 KB |
Output is correct |
28 |
Correct |
1 ms |
332 KB |
Output is correct |
29 |
Correct |
1 ms |
332 KB |
Output is correct |
30 |
Correct |
1 ms |
332 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
1 ms |
332 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
1 ms |
332 KB |
Output is correct |
35 |
Correct |
1 ms |
332 KB |
Output is correct |
36 |
Correct |
1 ms |
332 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
1 ms |
332 KB |
Output is correct |
39 |
Correct |
1 ms |
332 KB |
Output is correct |
40 |
Correct |
1 ms |
332 KB |
Output is correct |
41 |
Correct |
1 ms |
332 KB |
Output is correct |
42 |
Correct |
1 ms |
332 KB |
Output is correct |
43 |
Correct |
1 ms |
332 KB |
Output is correct |
44 |
Correct |
1 ms |
332 KB |
Output is correct |
45 |
Correct |
1 ms |
332 KB |
Output is correct |
46 |
Correct |
1 ms |
460 KB |
Output is correct |
47 |
Correct |
1 ms |
460 KB |
Output is correct |
48 |
Correct |
1 ms |
460 KB |
Output is correct |
49 |
Correct |
1 ms |
460 KB |
Output is correct |
50 |
Correct |
1 ms |
460 KB |
Output is correct |
51 |
Correct |
1 ms |
460 KB |
Output is correct |
52 |
Correct |
1 ms |
460 KB |
Output is correct |
53 |
Correct |
1 ms |
460 KB |
Output is correct |
54 |
Correct |
1 ms |
460 KB |
Output is correct |
55 |
Correct |
1 ms |
460 KB |
Output is correct |
56 |
Correct |
1 ms |
464 KB |
Output is correct |
57 |
Correct |
1 ms |
464 KB |
Output is correct |
58 |
Correct |
2 ms |
460 KB |
Output is correct |
59 |
Correct |
1 ms |
460 KB |
Output is correct |
60 |
Correct |
1 ms |
460 KB |
Output is correct |
61 |
Correct |
1 ms |
460 KB |
Output is correct |
62 |
Correct |
1 ms |
460 KB |
Output is correct |
63 |
Correct |
1 ms |
332 KB |
Output is correct |
64 |
Correct |
1 ms |
332 KB |
Output is correct |
65 |
Correct |
1 ms |
460 KB |
Output is correct |
66 |
Correct |
7 ms |
4492 KB |
Output is correct |
67 |
Correct |
7 ms |
4812 KB |
Output is correct |
68 |
Correct |
7 ms |
3448 KB |
Output is correct |
69 |
Correct |
47 ms |
4236 KB |
Output is correct |
70 |
Correct |
22 ms |
4572 KB |
Output is correct |
71 |
Correct |
10 ms |
4564 KB |
Output is correct |
72 |
Correct |
8 ms |
3412 KB |
Output is correct |
73 |
Correct |
7 ms |
3628 KB |
Output is correct |
74 |
Correct |
13 ms |
5708 KB |
Output is correct |
75 |
Correct |
19 ms |
5340 KB |
Output is correct |
76 |
Correct |
10 ms |
2992 KB |
Output is correct |
77 |
Correct |
9 ms |
4300 KB |
Output is correct |
78 |
Correct |
9 ms |
3192 KB |
Output is correct |
79 |
Correct |
9 ms |
2940 KB |
Output is correct |
80 |
Correct |
8 ms |
2756 KB |
Output is correct |
81 |
Correct |
10 ms |
2892 KB |
Output is correct |
82 |
Correct |
17 ms |
5580 KB |
Output is correct |
83 |
Correct |
14 ms |
5576 KB |
Output is correct |
84 |
Correct |
8 ms |
5708 KB |
Output is correct |
85 |
Correct |
8 ms |
5636 KB |
Output is correct |
86 |
Correct |
12 ms |
4580 KB |
Output is correct |
87 |
Correct |
10 ms |
5708 KB |
Output is correct |
88 |
Correct |
12 ms |
5708 KB |
Output is correct |
89 |
Correct |
14 ms |
2892 KB |
Output is correct |
90 |
Correct |
14 ms |
2896 KB |
Output is correct |
91 |
Correct |
189 ms |
71652 KB |
Output is correct |
92 |
Correct |
259 ms |
121596 KB |
Output is correct |
93 |
Correct |
251 ms |
127032 KB |
Output is correct |
94 |
Correct |
542 ms |
176892 KB |
Output is correct |
95 |
Correct |
919 ms |
122148 KB |
Output is correct |
96 |
Correct |
250 ms |
98144 KB |
Output is correct |
97 |
Correct |
276 ms |
103476 KB |
Output is correct |
98 |
Correct |
373 ms |
153632 KB |
Output is correct |
99 |
Correct |
252 ms |
83436 KB |
Output is correct |
100 |
Correct |
270 ms |
79964 KB |
Output is correct |
101 |
Correct |
472 ms |
78704 KB |
Output is correct |
102 |
Correct |
256 ms |
67816 KB |
Output is correct |
103 |
Correct |
537 ms |
67344 KB |
Output is correct |
104 |
Correct |
538 ms |
67468 KB |
Output is correct |
105 |
Correct |
1531 ms |
97924 KB |
Output is correct |
106 |
Correct |
1741 ms |
117560 KB |
Output is correct |
107 |
Correct |
3308 ms |
72476 KB |
Output is correct |
108 |
Correct |
2121 ms |
106876 KB |
Output is correct |
109 |
Correct |
286 ms |
120100 KB |
Output is correct |
110 |
Correct |
256 ms |
117640 KB |
Output is correct |
111 |
Correct |
253 ms |
124932 KB |
Output is correct |
112 |
Correct |
254 ms |
97180 KB |
Output is correct |
113 |
Correct |
271 ms |
80596 KB |
Output is correct |
114 |
Correct |
1576 ms |
149172 KB |
Output is correct |
115 |
Correct |
359 ms |
130380 KB |
Output is correct |
116 |
Correct |
250 ms |
93644 KB |
Output is correct |
117 |
Correct |
290 ms |
76528 KB |
Output is correct |
118 |
Correct |
1024 ms |
74996 KB |
Output is correct |
119 |
Correct |
688 ms |
73808 KB |
Output is correct |
120 |
Correct |
241 ms |
72212 KB |
Output is correct |
121 |
Correct |
307 ms |
67496 KB |
Output is correct |
122 |
Correct |
453 ms |
67972 KB |
Output is correct |
123 |
Correct |
596 ms |
172060 KB |
Output is correct |
124 |
Correct |
589 ms |
170436 KB |
Output is correct |
125 |
Correct |
276 ms |
178124 KB |
Output is correct |
126 |
Correct |
277 ms |
177552 KB |
Output is correct |
127 |
Correct |
381 ms |
122548 KB |
Output is correct |
128 |
Correct |
258 ms |
176436 KB |
Output is correct |
129 |
Correct |
272 ms |
178176 KB |
Output is correct |