#include<bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x << " : " << x << '\n'
// #define int long long
using namespace std;
typedef pair<int, int> pii;
const int N = 1e5 + 10;
const int Inf = 1'000'000'010;
int n;
int x[N], y[N];
int dir[N];
pii vec[] = {{1, 0}, {0, -1}, {-1, 0}, {0, 1}};
set< pair<int, int> > st; // time, id
int mk[N];
set<pair<int, int> > vis;
int Collision(int a, int b){
if(x[a] > x[b]) swap(a, b);
if(x[a] == x[b]){
if(y[a] > y[b]) swap(a, b);
if(dir[a] == 3 && dir[b] == 1)
return abs(y[a] - y[b]) / 2;
return Inf;
}
if(y[a] == y[b]){
// if(y[a] > y[b]) swap(a, b);
if(dir[a] == 0 && dir[b] == 2)
return abs(x[a] - x[b]) / 2;
return Inf;
}
int dp_a = x[a] + y[a];
int dp_b = x[b] + y[b];
int dn_a = x[a] - y[a];
int dn_b = x[b] - y[b];
if(dp_a != dp_b && dn_a != dn_b)
return Inf;
int d = abs(x[a] - x[b]);
if(dp_a == dp_b){
if((dir[a] == 0 && dir[b] == 3) || (dir[a] == 1 && dir[b] == 2))
return d;
return Inf;
}
if((dir[a] == 0 && dir[b] == 1) || (dir[a] == 3 && dir[b] == 2))
return d;
return Inf;
}
int dis[N];
struct Line {
int spd = 1, sz;
vector<pii> Stop, Move;
vector<pii> ans, mn;
vector<int> lz;
void Apply(int id, int x){
// debug(x);
ans[id] = min(ans[id], pii(mn[id].F + x, mn[id].S));
lz[id] = min(lz[id], x);
}
void Shift(int id){
if(lz[id] != 1){
Apply(id << 1, lz[id]);
Apply(id << 1 | 1, lz[id]);
}
lz[id] = 1;
}
void Build(int id, int L, int R){
lz[id] = 1;
if(L + 1 == R){
ans[id] = {Inf, Stop[L].S};
mn[id] = Stop[L];
return ;
}
int mid = (L + R) >> 1;
Build(id << 1, L, mid);
Build(id<<1|1, mid, R);
ans[id]=min(ans[id << 1], ans[id << 1 | 1]);
mn[id] = min(mn[id << 1], mn[id << 1 | 1]);
}
void Off(int id, int idx, int L, int R){
if(L + 1 == R){
mn[id].F = Inf + Inf;
ans[id] = mn[id];
return ;
}
int mid = (L + R) >> 1;
Shift(id);
if(idx < mid)
Off(id << 1, idx, L, mid);
else
Off(id<<1|1, idx, mid, R);
ans[id] = min(ans[id << 1], ans[id << 1 | 1]);
mn[id] = min(mn[id << 1], mn[id << 1 | 1]);
}
void Add(int id, int l, int r, int x, int L, int R){
// for(int i = l; i < r; i++)
// return ;
if(r <= L || R <= l) return ;
if(l <= L && R <= r){
Apply(id, x);
return ;
}
int mid = (L + R) >> 1;
Shift(id);
Add(id << 1, l, r, x, L, mid);
Add(id<<1|1, l, r, x, mid, R);
ans[id] = min(ans[id << 1], ans[id << 1 | 1]);
mn[id] = min(mn[id << 1], mn[id << 1 | 1]);
}
void Add_Stop(int pos, int id){
Stop.pb({pos, id});
}
void Add_Move(int pos, int id){
Move.pb({pos, id});
}
void Init(){
sz = Stop.size();
if(Stop.empty())
return ;
for(auto &el : Stop)
el.F /= spd;
for(auto &el : Move)
el.F /= spd;
sort(all(Stop));
ans.resize(sz * 4);
mn.resize(sz * 4);
lz.resize(sz * 4);
Build(1, 0, sz);
}
void Infect_Move(int pos, int id, int tm){
// debug(id);
// debug(tm);
pos /= spd;
// int dbg = 0;
// if(dbg){
// for(auto el : Stop){
// int i = el.S;
// // cerr << "&& " << id << ' ' << i << '\n';
// if(el.F < pos + tm) continue;
// if(mk[i]) continue;
// int ds = Collision(id, i);
// assert(ds == el.F - pos);
// if(dis[i] > ds){
// st.erase({dis[i], i});
// dis[i] = ds;
// st.insert({ds, i});
// }
// }
// }
// for(auto [_pos, _id] : Stop){
// if(mk[_id]) continue;
// if(pos + tm <= _pos && !mk[_id]){
// assert(Collision(id, _id) == _pos - pos);
// if(dis[_id] > _pos - pos){
// st.erase({dis[_id], _id});
// dis[_id] = _pos - pos;
// st.insert({dis[_id], _id});
// }
// }
// }
int idx = lower_bound(all(Stop), pii(pos + tm, -1)) - Stop.begin();
if(idx == sz)
return ;
// debug(pos);
Add(1, idx, sz, -pos, 0, sz);
if(dis[ans[1].S] > ans[1].F){
st.erase({dis[ans[1].S], ans[1].S});
dis[ans[1].S] = ans[1].F;
st.insert(ans[1]);
}
}
void Infect_Stop(int pos, int id, int tm){
pos /= spd;
int idx = lower_bound(all(Stop), pii(pos, id)) - Stop.begin();
// assert(idx < sz);
assert(Stop[idx] == pii(pos, id));
Off(1, idx, 0, sz);
if(dis[ans[1].S] > ans[1].F){
st.erase({dis[ans[1].S], ans[1].S});
dis[ans[1].S] = ans[1].F;
st.insert(ans[1]);
}
}
void Reset(){
Stop.clear();
Move.clear();
}
};
Line DIA[4][4][N], U[N], R[N];
int CP[N], CN[N], CXX[N], CYY[N];
int rv[4][4], ty[4][4];
void Infect(int u, int tm){
assert(mk[u] == 0);
mk[u] = 1;
// for(int i = 0; i < n; i++){
// if(mk[i]) continue;
// int ds = Collision(u, i);
// if(ds != Inf)
// vis.insert({u, i});
// if(ds >= tm && ds != Inf && dis[i] > ds){
// st.erase({dis[i], i});
// dis[i] = ds;
// st.insert({ds, i});
// }
// }
// return ;
// debug(u);
int MAX = 1'000'000'000;
int pos;
for(int d2 = 0; d2 < 4; d2 ++){
if((dir[u] + d2) % 2 == 0) continue;
pos = rv[dir[u]][d2] ? MAX - x[u] : x[u];
DIA[dir[u]][d2][ ty[dir[u]][d2] ? CN[u] : CP[u]].Infect_Move(pos, u, tm);
pos = rv[d2][dir[u]] ? MAX - x[u] : x[u];
DIA[d2][dir[u]][ ty[d2][dir[u]] ? CN[u] : CP[u]].Infect_Stop(pos, u, tm);
}
int imp = dir[u] & 1 ? y[u] : x[u];
pos = rv[dir[u]][dir[u] ^ 2] ? MAX - imp : imp;
DIA[dir[u]][dir[u] ^ 2][dir[u] & 1 ? CXX[u] : CYY[u]].Infect_Move(pos, u, tm);
pos = rv[dir[u] ^ 2][dir[u]] ? MAX - imp : imp;
DIA[dir[u] ^ 2][dir[u]][dir[u] & 1 ? CXX[u] : CYY[u]].Infect_Stop(pos, u, tm);
}
int Solve(){
dir[0] = 0;
for(int i = 1; i < n; i++){
int X = abs(x[i] - x[0]);
int Y = abs(y[i] - y[0]);
if(X == Y){
if(x[i] < x[0]) dir[i] = 0;
else dir[i] = y[i] < y[0] ? 3 : 1;
} else {
if(X > Y){
if( x[i] < x[0]) dir[i] = 0;
else dir[i] = 2;
} else {
if( y[i] < y[0]) dir[i] = 3;
else dir[i] = 1;
}
}
}
// cerr << "!! " ;
// for(int i = 0; i < n; i++){
// cerr << dir[i] << ' ';
// }
// cerr << '\n';
// cerr << "!! " << x[0] << ' ' << y[0] << ' ' << x[1] << ' ' << y[1] << '\n';
// for(int i = 0; i < N; i++) R[i].Reset(), U[i].Reset();
for(int i = 0; i < 16; i++)
for(int j = 0; j < N; j++)
DIA[i >> 2][i & 3][j].Reset();
for(int i = 0; i < 4; i++)
for(int j = 0; j < N; j++)
DIA[i][i ^ 2][j].spd = 2;
int MAX = 1'000'000'000;
for(int i = 0; i < n; i++){
int pos;
for(int d2 = 0; d2 < 4; d2 ++){
if((dir[i] + d2) % 2 == 0) continue;
pos = rv[dir[i]][d2] ? MAX - x[i] : x[i];
DIA[dir[i]][d2][ ty[dir[i]][d2] ? CN[i] : CP[i]].Add_Move(pos, i);
pos = rv[d2][dir[i]] ? MAX - x[i] : x[i];
DIA[d2][dir[i]][ ty[d2][dir[i]] ? CN[i] : CP[i]].Add_Stop(pos, i);
}
int imp = dir[i] & 1 ? y[i] : x[i];
pos = rv[dir[i]][dir[i] ^ 2] ? MAX - imp : imp;
DIA[dir[i]][dir[i] ^ 2][dir[i] & 1 ? CXX[i] : CYY[i]].Add_Move(pos, i);
pos = rv[dir[i] ^ 2][dir[i]] ? MAX - imp : imp;
DIA[dir[i] ^ 2][dir[i]][dir[i] & 1 ? CXX[i] : CYY[i]].Add_Stop(pos, i);
}
for(int i = 0; i < 16; i++)
for(int j = 0; j < N; j++)
DIA[i >> 2][i & 3][j].Init();
memset(mk, 0, sizeof mk);
fill(dis, dis + N, Inf);
dis[0] = 0;
st.insert({0, 0});
while(!st.empty()){
// cerr << "&&&&&&&\n";
// for(auto [a1, a2] : st)
// cerr << a1 << ' ' << a2 << '\n';
// cerr << "-------\n";
int fr = st.begin() -> S;
int tm = st.begin() -> F;
st.erase(st.begin());
// if(tm > Inf) continue;
// cerr << "!! " << fr << ' ' << tm << '\n';
Infect(fr, tm);
}
int res = 0;
for(int i = 0; i < n; i++)
res += mk[i];
return res;
}
int32_t main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
rv[3][0] = 1; rv[1][0] = 1;
rv[2][1] = 1; rv[2][3] = 1;
rv[2][0] = 1; rv[1][3] = 1;
ty[0][1] = ty[1][0] = ty[2][3] = ty[3][2] = 1;
cin >> n;
vector<int> cp, cn, cxx, cyy;
for(int i = 0; i < n; i++){
cin >> x[i] >> y[i];
cp.pb(x[i] + y[i]);
cn.pb(x[i] - y[i]);
cxx.pb(x[i]);
cyy.pb(y[i]);
}
sort(all(cp));
sort(all(cn));
sort(all(cxx));
sort(all(cyy));
for(int i = 0; i < n; i++)
CP[i] = lower_bound(all(cp), x[i] + y[i]) - cp.begin();
for(int i = 0; i < n; i++)
CN[i] = lower_bound(all(cn), x[i] - y[i]) - cn.begin();
for(int i = 0; i < n; i++)
CXX[i] = lower_bound(all(cxx), x[i]) - cxx.begin();
for(int i = 0; i < n; i++)
CYY[i] = lower_bound(all(cyy), y[i]) - cyy.begin();
for(int i = 0; i < n; i++){
x[i] += x[i];
y[i] += y[i];
}
int ans = 0;
int MAX = 1'000'000'000;
for(int _ = 0; _ < 4; _++){
ans = max(ans, Solve());
for(int i = 0; i < n; i++){
int _x = x[i];
x[i] = MAX-y[i];
y[i] = _x;
}
for(int i = 0; i < n; i++)
swap(CP[i], CN[i]);
for(int i = 0; i < n; i++)
swap(CXX[i], CYY[i]);
// break;
}
cout << ans << '\n';
// for(auto [a1, a2] : vis)
// cerr << "! " << a1 << ' ' << a2 << '\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
339 ms |
226568 KB |
Output is correct |
2 |
Correct |
329 ms |
226472 KB |
Output is correct |
3 |
Correct |
337 ms |
226612 KB |
Output is correct |
4 |
Correct |
341 ms |
226492 KB |
Output is correct |
5 |
Correct |
353 ms |
226572 KB |
Output is correct |
6 |
Correct |
336 ms |
226576 KB |
Output is correct |
7 |
Correct |
335 ms |
226580 KB |
Output is correct |
8 |
Correct |
324 ms |
226484 KB |
Output is correct |
9 |
Correct |
325 ms |
226636 KB |
Output is correct |
10 |
Correct |
324 ms |
226476 KB |
Output is correct |
11 |
Correct |
328 ms |
226584 KB |
Output is correct |
12 |
Correct |
320 ms |
226564 KB |
Output is correct |
13 |
Correct |
319 ms |
226624 KB |
Output is correct |
14 |
Correct |
298 ms |
226524 KB |
Output is correct |
15 |
Correct |
321 ms |
226584 KB |
Output is correct |
16 |
Correct |
320 ms |
226584 KB |
Output is correct |
17 |
Correct |
314 ms |
226564 KB |
Output is correct |
18 |
Correct |
307 ms |
226584 KB |
Output is correct |
19 |
Correct |
287 ms |
226500 KB |
Output is correct |
20 |
Correct |
315 ms |
226580 KB |
Output is correct |
21 |
Correct |
322 ms |
226704 KB |
Output is correct |
22 |
Correct |
300 ms |
226580 KB |
Output is correct |
23 |
Correct |
307 ms |
226708 KB |
Output is correct |
24 |
Correct |
341 ms |
226584 KB |
Output is correct |
25 |
Correct |
339 ms |
226584 KB |
Output is correct |
26 |
Correct |
340 ms |
226596 KB |
Output is correct |
27 |
Correct |
318 ms |
226700 KB |
Output is correct |
28 |
Correct |
332 ms |
226572 KB |
Output is correct |
29 |
Correct |
333 ms |
226696 KB |
Output is correct |
30 |
Correct |
332 ms |
226600 KB |
Output is correct |
31 |
Correct |
317 ms |
226580 KB |
Output is correct |
32 |
Correct |
321 ms |
226580 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
339 ms |
226568 KB |
Output is correct |
2 |
Correct |
329 ms |
226472 KB |
Output is correct |
3 |
Correct |
337 ms |
226612 KB |
Output is correct |
4 |
Correct |
341 ms |
226492 KB |
Output is correct |
5 |
Correct |
353 ms |
226572 KB |
Output is correct |
6 |
Correct |
336 ms |
226576 KB |
Output is correct |
7 |
Correct |
335 ms |
226580 KB |
Output is correct |
8 |
Correct |
324 ms |
226484 KB |
Output is correct |
9 |
Correct |
325 ms |
226636 KB |
Output is correct |
10 |
Correct |
324 ms |
226476 KB |
Output is correct |
11 |
Correct |
328 ms |
226584 KB |
Output is correct |
12 |
Correct |
320 ms |
226564 KB |
Output is correct |
13 |
Correct |
319 ms |
226624 KB |
Output is correct |
14 |
Correct |
298 ms |
226524 KB |
Output is correct |
15 |
Correct |
321 ms |
226584 KB |
Output is correct |
16 |
Correct |
320 ms |
226584 KB |
Output is correct |
17 |
Correct |
314 ms |
226564 KB |
Output is correct |
18 |
Correct |
307 ms |
226584 KB |
Output is correct |
19 |
Correct |
287 ms |
226500 KB |
Output is correct |
20 |
Correct |
315 ms |
226580 KB |
Output is correct |
21 |
Correct |
322 ms |
226704 KB |
Output is correct |
22 |
Correct |
300 ms |
226580 KB |
Output is correct |
23 |
Correct |
307 ms |
226708 KB |
Output is correct |
24 |
Correct |
341 ms |
226584 KB |
Output is correct |
25 |
Correct |
339 ms |
226584 KB |
Output is correct |
26 |
Correct |
340 ms |
226596 KB |
Output is correct |
27 |
Correct |
318 ms |
226700 KB |
Output is correct |
28 |
Correct |
332 ms |
226572 KB |
Output is correct |
29 |
Correct |
333 ms |
226696 KB |
Output is correct |
30 |
Correct |
332 ms |
226600 KB |
Output is correct |
31 |
Correct |
317 ms |
226580 KB |
Output is correct |
32 |
Correct |
321 ms |
226580 KB |
Output is correct |
33 |
Correct |
331 ms |
226560 KB |
Output is correct |
34 |
Correct |
334 ms |
226584 KB |
Output is correct |
35 |
Correct |
330 ms |
226572 KB |
Output is correct |
36 |
Correct |
342 ms |
226592 KB |
Output is correct |
37 |
Correct |
384 ms |
226592 KB |
Output is correct |
38 |
Correct |
406 ms |
226500 KB |
Output is correct |
39 |
Correct |
354 ms |
226628 KB |
Output is correct |
40 |
Correct |
354 ms |
226588 KB |
Output is correct |
41 |
Correct |
382 ms |
226628 KB |
Output is correct |
42 |
Correct |
353 ms |
226688 KB |
Output is correct |
43 |
Correct |
353 ms |
226604 KB |
Output is correct |
44 |
Correct |
375 ms |
226516 KB |
Output is correct |
45 |
Correct |
371 ms |
226648 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
359 ms |
226640 KB |
Output is correct |
2 |
Correct |
357 ms |
226752 KB |
Output is correct |
3 |
Correct |
341 ms |
226688 KB |
Output is correct |
4 |
Correct |
363 ms |
226796 KB |
Output is correct |
5 |
Correct |
357 ms |
226736 KB |
Output is correct |
6 |
Correct |
360 ms |
226772 KB |
Output is correct |
7 |
Correct |
342 ms |
226820 KB |
Output is correct |
8 |
Correct |
341 ms |
226700 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
339 ms |
226568 KB |
Output is correct |
2 |
Correct |
329 ms |
226472 KB |
Output is correct |
3 |
Correct |
337 ms |
226612 KB |
Output is correct |
4 |
Correct |
341 ms |
226492 KB |
Output is correct |
5 |
Correct |
353 ms |
226572 KB |
Output is correct |
6 |
Correct |
336 ms |
226576 KB |
Output is correct |
7 |
Correct |
335 ms |
226580 KB |
Output is correct |
8 |
Correct |
324 ms |
226484 KB |
Output is correct |
9 |
Correct |
325 ms |
226636 KB |
Output is correct |
10 |
Correct |
324 ms |
226476 KB |
Output is correct |
11 |
Correct |
328 ms |
226584 KB |
Output is correct |
12 |
Correct |
320 ms |
226564 KB |
Output is correct |
13 |
Correct |
319 ms |
226624 KB |
Output is correct |
14 |
Correct |
298 ms |
226524 KB |
Output is correct |
15 |
Correct |
321 ms |
226584 KB |
Output is correct |
16 |
Correct |
320 ms |
226584 KB |
Output is correct |
17 |
Correct |
314 ms |
226564 KB |
Output is correct |
18 |
Correct |
307 ms |
226584 KB |
Output is correct |
19 |
Correct |
287 ms |
226500 KB |
Output is correct |
20 |
Correct |
315 ms |
226580 KB |
Output is correct |
21 |
Correct |
322 ms |
226704 KB |
Output is correct |
22 |
Correct |
300 ms |
226580 KB |
Output is correct |
23 |
Correct |
307 ms |
226708 KB |
Output is correct |
24 |
Correct |
341 ms |
226584 KB |
Output is correct |
25 |
Correct |
339 ms |
226584 KB |
Output is correct |
26 |
Correct |
340 ms |
226596 KB |
Output is correct |
27 |
Correct |
318 ms |
226700 KB |
Output is correct |
28 |
Correct |
332 ms |
226572 KB |
Output is correct |
29 |
Correct |
333 ms |
226696 KB |
Output is correct |
30 |
Correct |
332 ms |
226600 KB |
Output is correct |
31 |
Correct |
317 ms |
226580 KB |
Output is correct |
32 |
Correct |
321 ms |
226580 KB |
Output is correct |
33 |
Correct |
331 ms |
226560 KB |
Output is correct |
34 |
Correct |
334 ms |
226584 KB |
Output is correct |
35 |
Correct |
330 ms |
226572 KB |
Output is correct |
36 |
Correct |
342 ms |
226592 KB |
Output is correct |
37 |
Correct |
384 ms |
226592 KB |
Output is correct |
38 |
Correct |
406 ms |
226500 KB |
Output is correct |
39 |
Correct |
354 ms |
226628 KB |
Output is correct |
40 |
Correct |
354 ms |
226588 KB |
Output is correct |
41 |
Correct |
382 ms |
226628 KB |
Output is correct |
42 |
Correct |
353 ms |
226688 KB |
Output is correct |
43 |
Correct |
353 ms |
226604 KB |
Output is correct |
44 |
Correct |
375 ms |
226516 KB |
Output is correct |
45 |
Correct |
371 ms |
226648 KB |
Output is correct |
46 |
Correct |
359 ms |
226640 KB |
Output is correct |
47 |
Correct |
357 ms |
226752 KB |
Output is correct |
48 |
Correct |
341 ms |
226688 KB |
Output is correct |
49 |
Correct |
363 ms |
226796 KB |
Output is correct |
50 |
Correct |
357 ms |
226736 KB |
Output is correct |
51 |
Correct |
360 ms |
226772 KB |
Output is correct |
52 |
Correct |
342 ms |
226820 KB |
Output is correct |
53 |
Correct |
341 ms |
226700 KB |
Output is correct |
54 |
Correct |
377 ms |
226668 KB |
Output is correct |
55 |
Correct |
353 ms |
226776 KB |
Output is correct |
56 |
Correct |
360 ms |
226828 KB |
Output is correct |
57 |
Correct |
366 ms |
226772 KB |
Output is correct |
58 |
Correct |
374 ms |
226740 KB |
Output is correct |
59 |
Correct |
365 ms |
226820 KB |
Output is correct |
60 |
Correct |
368 ms |
226660 KB |
Output is correct |
61 |
Correct |
366 ms |
226732 KB |
Output is correct |
62 |
Correct |
360 ms |
226840 KB |
Output is correct |
63 |
Correct |
378 ms |
226708 KB |
Output is correct |
64 |
Correct |
351 ms |
226740 KB |
Output is correct |
65 |
Correct |
351 ms |
226676 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
339 ms |
226568 KB |
Output is correct |
2 |
Correct |
329 ms |
226472 KB |
Output is correct |
3 |
Correct |
337 ms |
226612 KB |
Output is correct |
4 |
Correct |
341 ms |
226492 KB |
Output is correct |
5 |
Correct |
353 ms |
226572 KB |
Output is correct |
6 |
Correct |
336 ms |
226576 KB |
Output is correct |
7 |
Correct |
335 ms |
226580 KB |
Output is correct |
8 |
Correct |
324 ms |
226484 KB |
Output is correct |
9 |
Correct |
325 ms |
226636 KB |
Output is correct |
10 |
Correct |
324 ms |
226476 KB |
Output is correct |
11 |
Correct |
328 ms |
226584 KB |
Output is correct |
12 |
Correct |
320 ms |
226564 KB |
Output is correct |
13 |
Correct |
319 ms |
226624 KB |
Output is correct |
14 |
Correct |
298 ms |
226524 KB |
Output is correct |
15 |
Correct |
321 ms |
226584 KB |
Output is correct |
16 |
Correct |
320 ms |
226584 KB |
Output is correct |
17 |
Correct |
314 ms |
226564 KB |
Output is correct |
18 |
Correct |
307 ms |
226584 KB |
Output is correct |
19 |
Correct |
287 ms |
226500 KB |
Output is correct |
20 |
Correct |
315 ms |
226580 KB |
Output is correct |
21 |
Correct |
322 ms |
226704 KB |
Output is correct |
22 |
Correct |
300 ms |
226580 KB |
Output is correct |
23 |
Correct |
307 ms |
226708 KB |
Output is correct |
24 |
Correct |
341 ms |
226584 KB |
Output is correct |
25 |
Correct |
339 ms |
226584 KB |
Output is correct |
26 |
Correct |
340 ms |
226596 KB |
Output is correct |
27 |
Correct |
318 ms |
226700 KB |
Output is correct |
28 |
Correct |
332 ms |
226572 KB |
Output is correct |
29 |
Correct |
333 ms |
226696 KB |
Output is correct |
30 |
Correct |
332 ms |
226600 KB |
Output is correct |
31 |
Correct |
317 ms |
226580 KB |
Output is correct |
32 |
Correct |
321 ms |
226580 KB |
Output is correct |
33 |
Correct |
331 ms |
226560 KB |
Output is correct |
34 |
Correct |
334 ms |
226584 KB |
Output is correct |
35 |
Correct |
330 ms |
226572 KB |
Output is correct |
36 |
Correct |
342 ms |
226592 KB |
Output is correct |
37 |
Correct |
384 ms |
226592 KB |
Output is correct |
38 |
Correct |
406 ms |
226500 KB |
Output is correct |
39 |
Correct |
354 ms |
226628 KB |
Output is correct |
40 |
Correct |
354 ms |
226588 KB |
Output is correct |
41 |
Correct |
382 ms |
226628 KB |
Output is correct |
42 |
Correct |
353 ms |
226688 KB |
Output is correct |
43 |
Correct |
353 ms |
226604 KB |
Output is correct |
44 |
Correct |
375 ms |
226516 KB |
Output is correct |
45 |
Correct |
371 ms |
226648 KB |
Output is correct |
46 |
Correct |
359 ms |
226640 KB |
Output is correct |
47 |
Correct |
357 ms |
226752 KB |
Output is correct |
48 |
Correct |
341 ms |
226688 KB |
Output is correct |
49 |
Correct |
363 ms |
226796 KB |
Output is correct |
50 |
Correct |
357 ms |
226736 KB |
Output is correct |
51 |
Correct |
360 ms |
226772 KB |
Output is correct |
52 |
Correct |
342 ms |
226820 KB |
Output is correct |
53 |
Correct |
341 ms |
226700 KB |
Output is correct |
54 |
Correct |
377 ms |
226668 KB |
Output is correct |
55 |
Correct |
353 ms |
226776 KB |
Output is correct |
56 |
Correct |
360 ms |
226828 KB |
Output is correct |
57 |
Correct |
366 ms |
226772 KB |
Output is correct |
58 |
Correct |
374 ms |
226740 KB |
Output is correct |
59 |
Correct |
365 ms |
226820 KB |
Output is correct |
60 |
Correct |
368 ms |
226660 KB |
Output is correct |
61 |
Correct |
366 ms |
226732 KB |
Output is correct |
62 |
Correct |
360 ms |
226840 KB |
Output is correct |
63 |
Correct |
378 ms |
226708 KB |
Output is correct |
64 |
Correct |
351 ms |
226740 KB |
Output is correct |
65 |
Correct |
351 ms |
226676 KB |
Output is correct |
66 |
Correct |
379 ms |
231524 KB |
Output is correct |
67 |
Correct |
391 ms |
232220 KB |
Output is correct |
68 |
Correct |
399 ms |
231780 KB |
Output is correct |
69 |
Correct |
386 ms |
230308 KB |
Output is correct |
70 |
Correct |
377 ms |
230720 KB |
Output is correct |
71 |
Correct |
378 ms |
230788 KB |
Output is correct |
72 |
Correct |
386 ms |
231620 KB |
Output is correct |
73 |
Correct |
379 ms |
231932 KB |
Output is correct |
74 |
Correct |
384 ms |
231860 KB |
Output is correct |
75 |
Correct |
415 ms |
231900 KB |
Output is correct |
76 |
Correct |
397 ms |
231896 KB |
Output is correct |
77 |
Correct |
387 ms |
231504 KB |
Output is correct |
78 |
Correct |
372 ms |
231492 KB |
Output is correct |
79 |
Correct |
386 ms |
231492 KB |
Output is correct |
80 |
Correct |
387 ms |
231692 KB |
Output is correct |
81 |
Correct |
379 ms |
231452 KB |
Output is correct |
82 |
Correct |
382 ms |
232308 KB |
Output is correct |
83 |
Correct |
400 ms |
232168 KB |
Output is correct |
84 |
Correct |
364 ms |
231236 KB |
Output is correct |
85 |
Correct |
356 ms |
230388 KB |
Output is correct |
86 |
Correct |
358 ms |
230140 KB |
Output is correct |
87 |
Correct |
412 ms |
230744 KB |
Output is correct |
88 |
Correct |
374 ms |
231780 KB |
Output is correct |
89 |
Correct |
352 ms |
231348 KB |
Output is correct |
90 |
Correct |
358 ms |
231240 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
339 ms |
226568 KB |
Output is correct |
2 |
Correct |
329 ms |
226472 KB |
Output is correct |
3 |
Correct |
337 ms |
226612 KB |
Output is correct |
4 |
Correct |
341 ms |
226492 KB |
Output is correct |
5 |
Correct |
353 ms |
226572 KB |
Output is correct |
6 |
Correct |
336 ms |
226576 KB |
Output is correct |
7 |
Correct |
335 ms |
226580 KB |
Output is correct |
8 |
Correct |
324 ms |
226484 KB |
Output is correct |
9 |
Correct |
325 ms |
226636 KB |
Output is correct |
10 |
Correct |
324 ms |
226476 KB |
Output is correct |
11 |
Correct |
328 ms |
226584 KB |
Output is correct |
12 |
Correct |
320 ms |
226564 KB |
Output is correct |
13 |
Correct |
319 ms |
226624 KB |
Output is correct |
14 |
Correct |
298 ms |
226524 KB |
Output is correct |
15 |
Correct |
321 ms |
226584 KB |
Output is correct |
16 |
Correct |
320 ms |
226584 KB |
Output is correct |
17 |
Correct |
314 ms |
226564 KB |
Output is correct |
18 |
Correct |
307 ms |
226584 KB |
Output is correct |
19 |
Correct |
287 ms |
226500 KB |
Output is correct |
20 |
Correct |
315 ms |
226580 KB |
Output is correct |
21 |
Correct |
322 ms |
226704 KB |
Output is correct |
22 |
Correct |
300 ms |
226580 KB |
Output is correct |
23 |
Correct |
307 ms |
226708 KB |
Output is correct |
24 |
Correct |
341 ms |
226584 KB |
Output is correct |
25 |
Correct |
339 ms |
226584 KB |
Output is correct |
26 |
Correct |
340 ms |
226596 KB |
Output is correct |
27 |
Correct |
318 ms |
226700 KB |
Output is correct |
28 |
Correct |
332 ms |
226572 KB |
Output is correct |
29 |
Correct |
333 ms |
226696 KB |
Output is correct |
30 |
Correct |
332 ms |
226600 KB |
Output is correct |
31 |
Correct |
317 ms |
226580 KB |
Output is correct |
32 |
Correct |
321 ms |
226580 KB |
Output is correct |
33 |
Correct |
331 ms |
226560 KB |
Output is correct |
34 |
Correct |
334 ms |
226584 KB |
Output is correct |
35 |
Correct |
330 ms |
226572 KB |
Output is correct |
36 |
Correct |
342 ms |
226592 KB |
Output is correct |
37 |
Correct |
384 ms |
226592 KB |
Output is correct |
38 |
Correct |
406 ms |
226500 KB |
Output is correct |
39 |
Correct |
354 ms |
226628 KB |
Output is correct |
40 |
Correct |
354 ms |
226588 KB |
Output is correct |
41 |
Correct |
382 ms |
226628 KB |
Output is correct |
42 |
Correct |
353 ms |
226688 KB |
Output is correct |
43 |
Correct |
353 ms |
226604 KB |
Output is correct |
44 |
Correct |
375 ms |
226516 KB |
Output is correct |
45 |
Correct |
371 ms |
226648 KB |
Output is correct |
46 |
Correct |
359 ms |
226640 KB |
Output is correct |
47 |
Correct |
357 ms |
226752 KB |
Output is correct |
48 |
Correct |
341 ms |
226688 KB |
Output is correct |
49 |
Correct |
363 ms |
226796 KB |
Output is correct |
50 |
Correct |
357 ms |
226736 KB |
Output is correct |
51 |
Correct |
360 ms |
226772 KB |
Output is correct |
52 |
Correct |
342 ms |
226820 KB |
Output is correct |
53 |
Correct |
341 ms |
226700 KB |
Output is correct |
54 |
Correct |
377 ms |
226668 KB |
Output is correct |
55 |
Correct |
353 ms |
226776 KB |
Output is correct |
56 |
Correct |
360 ms |
226828 KB |
Output is correct |
57 |
Correct |
366 ms |
226772 KB |
Output is correct |
58 |
Correct |
374 ms |
226740 KB |
Output is correct |
59 |
Correct |
365 ms |
226820 KB |
Output is correct |
60 |
Correct |
368 ms |
226660 KB |
Output is correct |
61 |
Correct |
366 ms |
226732 KB |
Output is correct |
62 |
Correct |
360 ms |
226840 KB |
Output is correct |
63 |
Correct |
378 ms |
226708 KB |
Output is correct |
64 |
Correct |
351 ms |
226740 KB |
Output is correct |
65 |
Correct |
351 ms |
226676 KB |
Output is correct |
66 |
Correct |
1402 ms |
358804 KB |
Output is correct |
67 |
Correct |
1560 ms |
391248 KB |
Output is correct |
68 |
Correct |
1565 ms |
396352 KB |
Output is correct |
69 |
Correct |
1577 ms |
401088 KB |
Output is correct |
70 |
Correct |
2234 ms |
386616 KB |
Output is correct |
71 |
Correct |
1690 ms |
393708 KB |
Output is correct |
72 |
Correct |
1755 ms |
397480 KB |
Output is correct |
73 |
Correct |
1785 ms |
403340 KB |
Output is correct |
74 |
Correct |
1780 ms |
401344 KB |
Output is correct |
75 |
Correct |
2167 ms |
397392 KB |
Output is correct |
76 |
Correct |
1723 ms |
371080 KB |
Output is correct |
77 |
Correct |
1731 ms |
395372 KB |
Output is correct |
78 |
Correct |
1777 ms |
383228 KB |
Output is correct |
79 |
Correct |
1788 ms |
383168 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
339 ms |
226568 KB |
Output is correct |
2 |
Correct |
329 ms |
226472 KB |
Output is correct |
3 |
Correct |
337 ms |
226612 KB |
Output is correct |
4 |
Correct |
341 ms |
226492 KB |
Output is correct |
5 |
Correct |
353 ms |
226572 KB |
Output is correct |
6 |
Correct |
336 ms |
226576 KB |
Output is correct |
7 |
Correct |
335 ms |
226580 KB |
Output is correct |
8 |
Correct |
324 ms |
226484 KB |
Output is correct |
9 |
Correct |
325 ms |
226636 KB |
Output is correct |
10 |
Correct |
324 ms |
226476 KB |
Output is correct |
11 |
Correct |
328 ms |
226584 KB |
Output is correct |
12 |
Correct |
320 ms |
226564 KB |
Output is correct |
13 |
Correct |
319 ms |
226624 KB |
Output is correct |
14 |
Correct |
298 ms |
226524 KB |
Output is correct |
15 |
Correct |
321 ms |
226584 KB |
Output is correct |
16 |
Correct |
320 ms |
226584 KB |
Output is correct |
17 |
Correct |
314 ms |
226564 KB |
Output is correct |
18 |
Correct |
307 ms |
226584 KB |
Output is correct |
19 |
Correct |
287 ms |
226500 KB |
Output is correct |
20 |
Correct |
315 ms |
226580 KB |
Output is correct |
21 |
Correct |
322 ms |
226704 KB |
Output is correct |
22 |
Correct |
300 ms |
226580 KB |
Output is correct |
23 |
Correct |
307 ms |
226708 KB |
Output is correct |
24 |
Correct |
341 ms |
226584 KB |
Output is correct |
25 |
Correct |
339 ms |
226584 KB |
Output is correct |
26 |
Correct |
340 ms |
226596 KB |
Output is correct |
27 |
Correct |
318 ms |
226700 KB |
Output is correct |
28 |
Correct |
332 ms |
226572 KB |
Output is correct |
29 |
Correct |
333 ms |
226696 KB |
Output is correct |
30 |
Correct |
332 ms |
226600 KB |
Output is correct |
31 |
Correct |
317 ms |
226580 KB |
Output is correct |
32 |
Correct |
321 ms |
226580 KB |
Output is correct |
33 |
Correct |
331 ms |
226560 KB |
Output is correct |
34 |
Correct |
334 ms |
226584 KB |
Output is correct |
35 |
Correct |
330 ms |
226572 KB |
Output is correct |
36 |
Correct |
342 ms |
226592 KB |
Output is correct |
37 |
Correct |
384 ms |
226592 KB |
Output is correct |
38 |
Correct |
406 ms |
226500 KB |
Output is correct |
39 |
Correct |
354 ms |
226628 KB |
Output is correct |
40 |
Correct |
354 ms |
226588 KB |
Output is correct |
41 |
Correct |
382 ms |
226628 KB |
Output is correct |
42 |
Correct |
353 ms |
226688 KB |
Output is correct |
43 |
Correct |
353 ms |
226604 KB |
Output is correct |
44 |
Correct |
375 ms |
226516 KB |
Output is correct |
45 |
Correct |
371 ms |
226648 KB |
Output is correct |
46 |
Correct |
359 ms |
226640 KB |
Output is correct |
47 |
Correct |
357 ms |
226752 KB |
Output is correct |
48 |
Correct |
341 ms |
226688 KB |
Output is correct |
49 |
Correct |
363 ms |
226796 KB |
Output is correct |
50 |
Correct |
357 ms |
226736 KB |
Output is correct |
51 |
Correct |
360 ms |
226772 KB |
Output is correct |
52 |
Correct |
342 ms |
226820 KB |
Output is correct |
53 |
Correct |
341 ms |
226700 KB |
Output is correct |
54 |
Correct |
377 ms |
226668 KB |
Output is correct |
55 |
Correct |
353 ms |
226776 KB |
Output is correct |
56 |
Correct |
360 ms |
226828 KB |
Output is correct |
57 |
Correct |
366 ms |
226772 KB |
Output is correct |
58 |
Correct |
374 ms |
226740 KB |
Output is correct |
59 |
Correct |
365 ms |
226820 KB |
Output is correct |
60 |
Correct |
368 ms |
226660 KB |
Output is correct |
61 |
Correct |
366 ms |
226732 KB |
Output is correct |
62 |
Correct |
360 ms |
226840 KB |
Output is correct |
63 |
Correct |
378 ms |
226708 KB |
Output is correct |
64 |
Correct |
351 ms |
226740 KB |
Output is correct |
65 |
Correct |
351 ms |
226676 KB |
Output is correct |
66 |
Correct |
379 ms |
231524 KB |
Output is correct |
67 |
Correct |
391 ms |
232220 KB |
Output is correct |
68 |
Correct |
399 ms |
231780 KB |
Output is correct |
69 |
Correct |
386 ms |
230308 KB |
Output is correct |
70 |
Correct |
377 ms |
230720 KB |
Output is correct |
71 |
Correct |
378 ms |
230788 KB |
Output is correct |
72 |
Correct |
386 ms |
231620 KB |
Output is correct |
73 |
Correct |
379 ms |
231932 KB |
Output is correct |
74 |
Correct |
384 ms |
231860 KB |
Output is correct |
75 |
Correct |
415 ms |
231900 KB |
Output is correct |
76 |
Correct |
397 ms |
231896 KB |
Output is correct |
77 |
Correct |
387 ms |
231504 KB |
Output is correct |
78 |
Correct |
372 ms |
231492 KB |
Output is correct |
79 |
Correct |
386 ms |
231492 KB |
Output is correct |
80 |
Correct |
387 ms |
231692 KB |
Output is correct |
81 |
Correct |
379 ms |
231452 KB |
Output is correct |
82 |
Correct |
382 ms |
232308 KB |
Output is correct |
83 |
Correct |
400 ms |
232168 KB |
Output is correct |
84 |
Correct |
364 ms |
231236 KB |
Output is correct |
85 |
Correct |
356 ms |
230388 KB |
Output is correct |
86 |
Correct |
358 ms |
230140 KB |
Output is correct |
87 |
Correct |
412 ms |
230744 KB |
Output is correct |
88 |
Correct |
374 ms |
231780 KB |
Output is correct |
89 |
Correct |
352 ms |
231348 KB |
Output is correct |
90 |
Correct |
358 ms |
231240 KB |
Output is correct |
91 |
Correct |
1402 ms |
358804 KB |
Output is correct |
92 |
Correct |
1560 ms |
391248 KB |
Output is correct |
93 |
Correct |
1565 ms |
396352 KB |
Output is correct |
94 |
Correct |
1577 ms |
401088 KB |
Output is correct |
95 |
Correct |
2234 ms |
386616 KB |
Output is correct |
96 |
Correct |
1690 ms |
393708 KB |
Output is correct |
97 |
Correct |
1755 ms |
397480 KB |
Output is correct |
98 |
Correct |
1785 ms |
403340 KB |
Output is correct |
99 |
Correct |
1780 ms |
401344 KB |
Output is correct |
100 |
Correct |
2167 ms |
397392 KB |
Output is correct |
101 |
Correct |
1723 ms |
371080 KB |
Output is correct |
102 |
Correct |
1731 ms |
395372 KB |
Output is correct |
103 |
Correct |
1777 ms |
383228 KB |
Output is correct |
104 |
Correct |
1788 ms |
383168 KB |
Output is correct |
105 |
Correct |
1549 ms |
325216 KB |
Output is correct |
106 |
Correct |
2041 ms |
351316 KB |
Output is correct |
107 |
Correct |
2466 ms |
341628 KB |
Output is correct |
108 |
Correct |
2182 ms |
353456 KB |
Output is correct |
109 |
Correct |
1354 ms |
364892 KB |
Output is correct |
110 |
Correct |
1675 ms |
399392 KB |
Output is correct |
111 |
Correct |
1728 ms |
395472 KB |
Output is correct |
112 |
Correct |
1646 ms |
392936 KB |
Output is correct |
113 |
Correct |
2141 ms |
393928 KB |
Output is correct |
114 |
Correct |
2434 ms |
376028 KB |
Output is correct |
115 |
Correct |
1861 ms |
400268 KB |
Output is correct |
116 |
Correct |
1696 ms |
399816 KB |
Output is correct |
117 |
Correct |
2211 ms |
395680 KB |
Output is correct |
118 |
Correct |
2104 ms |
366672 KB |
Output is correct |
119 |
Correct |
1919 ms |
369228 KB |
Output is correct |
120 |
Correct |
1758 ms |
394388 KB |
Output is correct |
121 |
Correct |
1754 ms |
395172 KB |
Output is correct |
122 |
Correct |
1849 ms |
394940 KB |
Output is correct |
123 |
Correct |
1727 ms |
417708 KB |
Output is correct |
124 |
Correct |
1740 ms |
417324 KB |
Output is correct |
125 |
Correct |
830 ms |
376804 KB |
Output is correct |
126 |
Correct |
670 ms |
357204 KB |
Output is correct |
127 |
Correct |
759 ms |
343268 KB |
Output is correct |
128 |
Correct |
759 ms |
355776 KB |
Output is correct |
129 |
Correct |
925 ms |
361708 KB |
Output is correct |