#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define gibon ios::sync_with_stdio(false); cin.tie(0);
#define fi first
#define se second
#define pdd pair<long double, long double>
#define pii pair<int, int>
#define pll pair<ll, ll>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
typedef long long ll;
using namespace std;
const int mxN=300020;
const int mxK=14;
const int MOD=1000000007;
const ll INF=1e18;
int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};
ll N[2], K, M;
pll A[2][mxN];
vector <pll> coor;
ll dp[2][mxN];
ll ans;
bool add_zero;
pll seg1[2][4*mxN];
ll seg2[2][4*mxN];
void upd2(int idx, int s, int e, int pos, int val, int i)
{
if(s==e)
{
seg2[i][idx]=val;
return;
}
int mid=(s+e)/2;
if(pos<=mid) upd2(2*idx, s, mid, pos, val, i);
else upd2(2*idx+1, mid+1, e, pos, val, i);
seg2[i][idx]=max(seg2[i][2*idx], seg2[i][2*idx+1]);
}
int solv2(int idx, int s1, int e1, int s2, int e2, int i)
{
if(s2<=s1 && e1<=e2) return seg2[i][idx];
if(s2>e1 || s1>e2) return 0;
int mid=(s1+e1)/2;
return max(solv2(2*idx, s1, mid, s2, e2, i), solv2(2*idx+1, mid+1, e1, s2, e2, i));
}
void init1(int idx, int s, int e)
{
if(s==e) seg1[0][idx]=pll(A[0][s].fi-2*K*s, A[0][s].se-2*K*s), seg1[1][idx]=pll(A[1][s].fi-2*K*s, A[1][s].se-2*K*s);
else
{
int mid=(s+e)/2;
init1(2*idx, s, mid);
init1(2*idx+1, mid+1, e);
for(int i=0;i<2;i++)
{
seg1[i][idx].fi=max(seg1[i][2*idx].fi, seg1[i][2*idx+1].fi);
seg1[i][idx].se=min(seg1[i][2*idx].se, seg1[i][2*idx+1].se);
}
}
}
pll solv1(int idx, int s1, int e1, int s2, int e2, int i)
{
if(s2<=s1 && e1<=e2) return seg1[i][idx];
if(s2>e1 || s1>e2) return pll(-INF, INF);
int mid=(s1+e1)/2;
pll r1=solv1(2*idx, s1, mid, s2, e2, i), r2=solv1(2*idx+1, mid+1, e1, s2, e2, i);
return pll(max(r1.fi, r2.fi), min(r1.se, r2.se));
}
void input()
{
cin >> N[0] >> N[1] >> K;
for(int i=0;i<N[0];i++) cin >> A[0][i].fi >> A[0][i].se, A[0][i].se--;
for(int i=0;i<N[1];i++) cin >> A[1][i].fi >> A[1][i].se, A[1][i].se--;
sort(A[0], A[0]+N[0]);
sort(A[1], A[1]+N[1]);
if(A[0][0].fi!=0)
{
add_zero=true;
for(int i=N[0];i>=1;i--) A[0][i]=A[0][i-1];
A[0][0]=pii(0, 0);
N[0]++;
}
M=max(N[0], N[1]);
}
void make_coor()
{
for(int i=0;i<2;i++) for(int j=0;j<N[i];j++) coor.emplace_back(i, j);
sort(all(coor), [](pii a, pii b){return A[a.fi][a.se].fi>A[b.fi][b.se].fi;});
}
ll f(int idx, int s, int lim)
{
if(s==N[idx]) return 0;
if(A[idx][s].fi>lim-K) return dp[idx][s];
int e1=lower_bound(A[idx], A[idx]+N[idx], pll(lim-K+1, 0), [](pll a, pll b){return a.fi<b.fi;})-A[idx];
int e2=lower_bound(A[1-idx], A[1-idx]+N[1-idx], pll(lim+1, 0), [](pll a, pll b){return a.fi<b.fi;})-A[1-idx];
ll res=0;
res=max(res, e1-s+dp[idx][e1]);
res=max(res, e1-s-2+dp[idx][e1-1]);
return res;
}
int bin_search1(int idx, ll val, int s, int e)
{
pll tmp=solv1(1, 0, M-1, s, e, idx);
if(val<=tmp.se && val>=tmp.fi) return e;
while(s!=e)
{
int mid=(s+e)/2;
tmp=solv1(1, 0, M-1, s, mid, idx);
if(val<=tmp.se && val>=tmp.fi) s=mid+1;
else e=mid;
}
return s-1;
}
void mx(ll &a, ll b){a=max(a, b);}
int main()
{
gibon
input();
make_coor();
init1(1, 0, M-1);
upd2(1, 0, M, N[0], 2*N[0], 0);
upd2(1, 0, M, N[1], 2*N[1], 1);
for(auto [idx, now] : coor)
{
ll nc=A[idx][now].fi;
dp[idx][now]=dp[idx][now+1]+1;
ll s1=now, s2=lower_bound(A[1-idx], A[1-idx]+N[1-idx], pll(nc+K, nc+K), [](pll a, pll b){return a.se<b.se;})-A[1-idx];
if(s2==N[1-idx])
{
upd2(1, 0, M, now, dp[idx][now]+2*now, idx);
continue;
}
if(A[1-idx][s2].fi>nc+K)
{
mx(dp[idx][now], f(1-idx, s2, A[idx][now].se)+1);
upd2(1, 0, M, now, dp[idx][now]+2*now, idx);
continue;
}
ll c1=bin_search1(idx, nc-2*K*s1, s1, N[idx]-1), c2=bin_search1(1-idx, nc+K-2*K*s2, s2, N[1-idx]-1);
/*
ll c1=s1, c2=s2;
while(c1+1<N[idx] && nc+2*K*(c1+1-s1)<=A[idx][c1+1].se && nc+2*K*(c1+1-s1)>=A[idx][c1+1].fi) c1++;
while(c2+1<N[1-idx] && nc+2*K*(c2+1-s2)+K<=A[1-idx][c2+1].se && nc+2*K*(c2+1-s2)+K>=A[1-idx][c2+1].fi) c2++;
*/
if(c2-s2<c1-s1-1) c1=c2-s2+s1+1;
if(c2-s2>c1-s1) c2=c1-s1+s2;
if(c2-s2==c1-s1)
{
mx(dp[idx][now], solv2(1, 0, M, s1+1, c1+1, idx)-2*s1-1);
if(s2<=c2-1) mx(dp[idx][now], solv2(1, 0, M, s2+1, c2, 1-idx)-2*s2);
/*
for(int i=s1;i<=c1;i++) mx(dp[idx][now], dp[idx][i+1]+2*(i-s1)+1);
for(int i=s2;i<c2;i++) mx(dp[idx][now], dp[1-idx][i+1]+2*(i-s2)+2);
*/
mx(dp[idx][now], f(1-idx, c2+1, A[idx][c1].se)+c1-s1+c2-s2+2);
ll nxt=nc+2*K*(c1-s1+1);
if(c1+1<N[idx] && nxt<A[idx][c1+1].fi) mx(dp[idx][now], f(idx, c1+1, A[1-idx][c2].se)+2*(c1-s1+1));
}
else
{
if(s1<=c1-1) mx(dp[idx][now], solv2(1, 0, M, s1+1, c1, idx)-2*s1-1);
mx(dp[idx][now], solv2(1, 0, M, s2+1, c2+1, 1-idx)-2*s2);
/*
for(int i=s1;i<c1;i++) mx(dp[idx][now], dp[idx][i+1]+2*(i-s1)+1);
for(int i=s2;i<=c2;i++) mx(dp[idx][now], dp[1-idx][i+1]+2*(i-s2)+2);
*/
mx(dp[idx][now], f(idx, c1+1, A[1-idx][c2].se)+2*(c1-s1)+1);
ll nxt=nc+2*K*(c1-s1)+K;
if(c2+1<N[1-idx] && nxt<A[1-idx][c2+1].fi) mx(dp[idx][now], f(1-idx, c2+1, A[idx][c1].se)+2*(c1-s1)+1);
}
upd2(1, 0, M, now, dp[idx][now]+2*now, idx);
}
cout << dp[0][0]-(add_zero ? 1 : 0);
}
/*
3 3 10
1 30
31 60
61 90
15 45
45 90
90 120
*/
Compilation message
Main.cpp: In function 'll f(int, int, int)':
Main.cpp:96:9: warning: unused variable 'e2' [-Wunused-variable]
96 | int e2=lower_bound(A[1-idx], A[1-idx]+N[1-idx], pll(lim+1, 0), [](pll a, pll b){return a.fi<b.fi;})-A[1-idx];
| ^~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
0 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
0 ms |
340 KB |
Output is correct |
11 |
Correct |
0 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
0 ms |
340 KB |
Output is correct |
14 |
Correct |
0 ms |
340 KB |
Output is correct |
15 |
Correct |
0 ms |
340 KB |
Output is correct |
16 |
Correct |
0 ms |
340 KB |
Output is correct |
17 |
Correct |
0 ms |
340 KB |
Output is correct |
18 |
Correct |
0 ms |
340 KB |
Output is correct |
19 |
Correct |
1 ms |
340 KB |
Output is correct |
20 |
Correct |
1 ms |
340 KB |
Output is correct |
21 |
Correct |
0 ms |
340 KB |
Output is correct |
22 |
Correct |
0 ms |
340 KB |
Output is correct |
23 |
Correct |
0 ms |
340 KB |
Output is correct |
24 |
Correct |
1 ms |
340 KB |
Output is correct |
25 |
Correct |
0 ms |
340 KB |
Output is correct |
26 |
Correct |
0 ms |
340 KB |
Output is correct |
27 |
Correct |
0 ms |
340 KB |
Output is correct |
28 |
Correct |
0 ms |
340 KB |
Output is correct |
29 |
Correct |
0 ms |
340 KB |
Output is correct |
30 |
Correct |
0 ms |
340 KB |
Output is correct |
31 |
Correct |
1 ms |
384 KB |
Output is correct |
32 |
Correct |
0 ms |
340 KB |
Output is correct |
33 |
Correct |
0 ms |
340 KB |
Output is correct |
34 |
Correct |
0 ms |
340 KB |
Output is correct |
35 |
Correct |
0 ms |
340 KB |
Output is correct |
36 |
Correct |
0 ms |
340 KB |
Output is correct |
37 |
Correct |
0 ms |
340 KB |
Output is correct |
38 |
Correct |
0 ms |
340 KB |
Output is correct |
39 |
Correct |
0 ms |
340 KB |
Output is correct |
40 |
Correct |
0 ms |
340 KB |
Output is correct |
41 |
Correct |
0 ms |
340 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
0 ms |
340 KB |
Output is correct |
44 |
Correct |
0 ms |
340 KB |
Output is correct |
45 |
Correct |
1 ms |
340 KB |
Output is correct |
46 |
Correct |
0 ms |
340 KB |
Output is correct |
47 |
Correct |
0 ms |
340 KB |
Output is correct |
48 |
Correct |
0 ms |
340 KB |
Output is correct |
49 |
Correct |
0 ms |
340 KB |
Output is correct |
50 |
Correct |
0 ms |
340 KB |
Output is correct |
51 |
Correct |
0 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
0 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
0 ms |
340 KB |
Output is correct |
11 |
Correct |
0 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
0 ms |
340 KB |
Output is correct |
14 |
Correct |
0 ms |
340 KB |
Output is correct |
15 |
Correct |
0 ms |
340 KB |
Output is correct |
16 |
Correct |
0 ms |
340 KB |
Output is correct |
17 |
Correct |
0 ms |
340 KB |
Output is correct |
18 |
Correct |
0 ms |
340 KB |
Output is correct |
19 |
Correct |
1 ms |
340 KB |
Output is correct |
20 |
Correct |
1 ms |
340 KB |
Output is correct |
21 |
Correct |
0 ms |
340 KB |
Output is correct |
22 |
Correct |
0 ms |
340 KB |
Output is correct |
23 |
Correct |
0 ms |
340 KB |
Output is correct |
24 |
Correct |
1 ms |
340 KB |
Output is correct |
25 |
Correct |
0 ms |
340 KB |
Output is correct |
26 |
Correct |
0 ms |
340 KB |
Output is correct |
27 |
Correct |
0 ms |
340 KB |
Output is correct |
28 |
Correct |
0 ms |
340 KB |
Output is correct |
29 |
Correct |
0 ms |
340 KB |
Output is correct |
30 |
Correct |
0 ms |
340 KB |
Output is correct |
31 |
Correct |
1 ms |
384 KB |
Output is correct |
32 |
Correct |
0 ms |
340 KB |
Output is correct |
33 |
Correct |
0 ms |
340 KB |
Output is correct |
34 |
Correct |
0 ms |
340 KB |
Output is correct |
35 |
Correct |
0 ms |
340 KB |
Output is correct |
36 |
Correct |
0 ms |
340 KB |
Output is correct |
37 |
Correct |
0 ms |
340 KB |
Output is correct |
38 |
Correct |
0 ms |
340 KB |
Output is correct |
39 |
Correct |
0 ms |
340 KB |
Output is correct |
40 |
Correct |
0 ms |
340 KB |
Output is correct |
41 |
Correct |
0 ms |
340 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
0 ms |
340 KB |
Output is correct |
44 |
Correct |
0 ms |
340 KB |
Output is correct |
45 |
Correct |
1 ms |
340 KB |
Output is correct |
46 |
Correct |
0 ms |
340 KB |
Output is correct |
47 |
Correct |
0 ms |
340 KB |
Output is correct |
48 |
Correct |
0 ms |
340 KB |
Output is correct |
49 |
Correct |
0 ms |
340 KB |
Output is correct |
50 |
Correct |
0 ms |
340 KB |
Output is correct |
51 |
Correct |
0 ms |
340 KB |
Output is correct |
52 |
Correct |
1 ms |
340 KB |
Output is correct |
53 |
Correct |
0 ms |
340 KB |
Output is correct |
54 |
Correct |
1 ms |
340 KB |
Output is correct |
55 |
Correct |
1 ms |
340 KB |
Output is correct |
56 |
Correct |
0 ms |
340 KB |
Output is correct |
57 |
Correct |
3 ms |
596 KB |
Output is correct |
58 |
Correct |
2 ms |
468 KB |
Output is correct |
59 |
Correct |
2 ms |
468 KB |
Output is correct |
60 |
Correct |
0 ms |
340 KB |
Output is correct |
61 |
Correct |
0 ms |
340 KB |
Output is correct |
62 |
Correct |
1 ms |
340 KB |
Output is correct |
63 |
Correct |
1 ms |
340 KB |
Output is correct |
64 |
Correct |
7 ms |
724 KB |
Output is correct |
65 |
Correct |
2 ms |
724 KB |
Output is correct |
66 |
Correct |
2 ms |
724 KB |
Output is correct |
67 |
Correct |
4 ms |
724 KB |
Output is correct |
68 |
Correct |
6 ms |
708 KB |
Output is correct |
69 |
Correct |
7 ms |
788 KB |
Output is correct |
70 |
Correct |
8 ms |
772 KB |
Output is correct |
71 |
Correct |
3 ms |
724 KB |
Output is correct |
72 |
Correct |
1 ms |
340 KB |
Output is correct |
73 |
Correct |
1 ms |
340 KB |
Output is correct |
74 |
Correct |
1 ms |
340 KB |
Output is correct |
75 |
Correct |
1 ms |
340 KB |
Output is correct |
76 |
Correct |
1 ms |
332 KB |
Output is correct |
77 |
Correct |
2 ms |
596 KB |
Output is correct |
78 |
Correct |
5 ms |
752 KB |
Output is correct |
79 |
Correct |
8 ms |
724 KB |
Output is correct |
80 |
Correct |
7 ms |
776 KB |
Output is correct |
81 |
Correct |
5 ms |
724 KB |
Output is correct |
82 |
Correct |
1 ms |
468 KB |
Output is correct |
83 |
Correct |
5 ms |
724 KB |
Output is correct |
84 |
Correct |
2 ms |
724 KB |
Output is correct |
85 |
Correct |
5 ms |
772 KB |
Output is correct |
86 |
Correct |
2 ms |
640 KB |
Output is correct |
87 |
Correct |
1 ms |
340 KB |
Output is correct |
88 |
Correct |
1 ms |
340 KB |
Output is correct |
89 |
Correct |
1 ms |
340 KB |
Output is correct |
90 |
Correct |
1 ms |
340 KB |
Output is correct |
91 |
Correct |
1 ms |
340 KB |
Output is correct |
92 |
Correct |
1 ms |
340 KB |
Output is correct |
93 |
Correct |
1 ms |
340 KB |
Output is correct |
94 |
Correct |
1 ms |
336 KB |
Output is correct |
95 |
Correct |
1 ms |
340 KB |
Output is correct |
96 |
Correct |
1 ms |
344 KB |
Output is correct |
97 |
Correct |
1 ms |
472 KB |
Output is correct |
98 |
Correct |
1 ms |
468 KB |
Output is correct |
99 |
Correct |
1 ms |
468 KB |
Output is correct |
100 |
Correct |
1 ms |
468 KB |
Output is correct |
101 |
Correct |
1 ms |
468 KB |
Output is correct |
102 |
Correct |
1 ms |
340 KB |
Output is correct |
103 |
Correct |
1 ms |
340 KB |
Output is correct |
104 |
Correct |
1 ms |
340 KB |
Output is correct |
105 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
596 KB |
Output is correct |
3 |
Correct |
3 ms |
724 KB |
Output is correct |
4 |
Correct |
4 ms |
724 KB |
Output is correct |
5 |
Correct |
5 ms |
724 KB |
Output is correct |
6 |
Correct |
9 ms |
800 KB |
Output is correct |
7 |
Correct |
3 ms |
724 KB |
Output is correct |
8 |
Correct |
2 ms |
724 KB |
Output is correct |
9 |
Correct |
2 ms |
724 KB |
Output is correct |
10 |
Correct |
2 ms |
724 KB |
Output is correct |
11 |
Correct |
1 ms |
596 KB |
Output is correct |
12 |
Correct |
7 ms |
708 KB |
Output is correct |
13 |
Correct |
2 ms |
596 KB |
Output is correct |
14 |
Correct |
2 ms |
724 KB |
Output is correct |
15 |
Correct |
2 ms |
724 KB |
Output is correct |
16 |
Correct |
2 ms |
724 KB |
Output is correct |
17 |
Correct |
7 ms |
724 KB |
Output is correct |
18 |
Correct |
3 ms |
468 KB |
Output is correct |
19 |
Correct |
7 ms |
760 KB |
Output is correct |
20 |
Correct |
2 ms |
724 KB |
Output is correct |
21 |
Correct |
2 ms |
724 KB |
Output is correct |
22 |
Correct |
2 ms |
724 KB |
Output is correct |
23 |
Correct |
5 ms |
724 KB |
Output is correct |
24 |
Correct |
1 ms |
596 KB |
Output is correct |
25 |
Correct |
4 ms |
724 KB |
Output is correct |
26 |
Correct |
2 ms |
740 KB |
Output is correct |
27 |
Correct |
1 ms |
596 KB |
Output is correct |
28 |
Correct |
3 ms |
852 KB |
Output is correct |
29 |
Correct |
3 ms |
724 KB |
Output is correct |
30 |
Correct |
2 ms |
724 KB |
Output is correct |
31 |
Correct |
5 ms |
852 KB |
Output is correct |
32 |
Correct |
3 ms |
852 KB |
Output is correct |
33 |
Correct |
1 ms |
336 KB |
Output is correct |
34 |
Correct |
0 ms |
340 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
1 ms |
340 KB |
Output is correct |
37 |
Correct |
1 ms |
340 KB |
Output is correct |
38 |
Correct |
1 ms |
340 KB |
Output is correct |
39 |
Correct |
1 ms |
344 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
344 KB |
Output is correct |
42 |
Correct |
3 ms |
856 KB |
Output is correct |
43 |
Correct |
5 ms |
860 KB |
Output is correct |
44 |
Correct |
5 ms |
852 KB |
Output is correct |
45 |
Correct |
4 ms |
812 KB |
Output is correct |
46 |
Correct |
6 ms |
856 KB |
Output is correct |
47 |
Correct |
1 ms |
596 KB |
Output is correct |
48 |
Correct |
1 ms |
596 KB |
Output is correct |
49 |
Correct |
1 ms |
604 KB |
Output is correct |
50 |
Correct |
1 ms |
596 KB |
Output is correct |
51 |
Correct |
1 ms |
596 KB |
Output is correct |
52 |
Correct |
1 ms |
596 KB |
Output is correct |
53 |
Correct |
2 ms |
596 KB |
Output is correct |
54 |
Correct |
1 ms |
608 KB |
Output is correct |
55 |
Correct |
2 ms |
596 KB |
Output is correct |
56 |
Correct |
2 ms |
604 KB |
Output is correct |
57 |
Correct |
1 ms |
596 KB |
Output is correct |
58 |
Correct |
1 ms |
608 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
0 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
0 ms |
340 KB |
Output is correct |
11 |
Correct |
0 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
0 ms |
340 KB |
Output is correct |
14 |
Correct |
0 ms |
340 KB |
Output is correct |
15 |
Correct |
0 ms |
340 KB |
Output is correct |
16 |
Correct |
0 ms |
340 KB |
Output is correct |
17 |
Correct |
0 ms |
340 KB |
Output is correct |
18 |
Correct |
0 ms |
340 KB |
Output is correct |
19 |
Correct |
1 ms |
340 KB |
Output is correct |
20 |
Correct |
1 ms |
340 KB |
Output is correct |
21 |
Correct |
0 ms |
340 KB |
Output is correct |
22 |
Correct |
0 ms |
340 KB |
Output is correct |
23 |
Correct |
0 ms |
340 KB |
Output is correct |
24 |
Correct |
1 ms |
340 KB |
Output is correct |
25 |
Correct |
0 ms |
340 KB |
Output is correct |
26 |
Correct |
0 ms |
340 KB |
Output is correct |
27 |
Correct |
0 ms |
340 KB |
Output is correct |
28 |
Correct |
0 ms |
340 KB |
Output is correct |
29 |
Correct |
0 ms |
340 KB |
Output is correct |
30 |
Correct |
0 ms |
340 KB |
Output is correct |
31 |
Correct |
1 ms |
384 KB |
Output is correct |
32 |
Correct |
0 ms |
340 KB |
Output is correct |
33 |
Correct |
0 ms |
340 KB |
Output is correct |
34 |
Correct |
0 ms |
340 KB |
Output is correct |
35 |
Correct |
0 ms |
340 KB |
Output is correct |
36 |
Correct |
0 ms |
340 KB |
Output is correct |
37 |
Correct |
0 ms |
340 KB |
Output is correct |
38 |
Correct |
0 ms |
340 KB |
Output is correct |
39 |
Correct |
0 ms |
340 KB |
Output is correct |
40 |
Correct |
0 ms |
340 KB |
Output is correct |
41 |
Correct |
0 ms |
340 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
0 ms |
340 KB |
Output is correct |
44 |
Correct |
0 ms |
340 KB |
Output is correct |
45 |
Correct |
1 ms |
340 KB |
Output is correct |
46 |
Correct |
0 ms |
340 KB |
Output is correct |
47 |
Correct |
0 ms |
340 KB |
Output is correct |
48 |
Correct |
0 ms |
340 KB |
Output is correct |
49 |
Correct |
0 ms |
340 KB |
Output is correct |
50 |
Correct |
0 ms |
340 KB |
Output is correct |
51 |
Correct |
0 ms |
340 KB |
Output is correct |
52 |
Correct |
1 ms |
340 KB |
Output is correct |
53 |
Correct |
0 ms |
340 KB |
Output is correct |
54 |
Correct |
1 ms |
340 KB |
Output is correct |
55 |
Correct |
1 ms |
340 KB |
Output is correct |
56 |
Correct |
0 ms |
340 KB |
Output is correct |
57 |
Correct |
3 ms |
596 KB |
Output is correct |
58 |
Correct |
2 ms |
468 KB |
Output is correct |
59 |
Correct |
2 ms |
468 KB |
Output is correct |
60 |
Correct |
0 ms |
340 KB |
Output is correct |
61 |
Correct |
0 ms |
340 KB |
Output is correct |
62 |
Correct |
1 ms |
340 KB |
Output is correct |
63 |
Correct |
1 ms |
340 KB |
Output is correct |
64 |
Correct |
7 ms |
724 KB |
Output is correct |
65 |
Correct |
2 ms |
724 KB |
Output is correct |
66 |
Correct |
2 ms |
724 KB |
Output is correct |
67 |
Correct |
4 ms |
724 KB |
Output is correct |
68 |
Correct |
6 ms |
708 KB |
Output is correct |
69 |
Correct |
7 ms |
788 KB |
Output is correct |
70 |
Correct |
8 ms |
772 KB |
Output is correct |
71 |
Correct |
3 ms |
724 KB |
Output is correct |
72 |
Correct |
1 ms |
340 KB |
Output is correct |
73 |
Correct |
1 ms |
340 KB |
Output is correct |
74 |
Correct |
1 ms |
340 KB |
Output is correct |
75 |
Correct |
1 ms |
340 KB |
Output is correct |
76 |
Correct |
1 ms |
332 KB |
Output is correct |
77 |
Correct |
2 ms |
596 KB |
Output is correct |
78 |
Correct |
5 ms |
752 KB |
Output is correct |
79 |
Correct |
8 ms |
724 KB |
Output is correct |
80 |
Correct |
7 ms |
776 KB |
Output is correct |
81 |
Correct |
5 ms |
724 KB |
Output is correct |
82 |
Correct |
1 ms |
468 KB |
Output is correct |
83 |
Correct |
5 ms |
724 KB |
Output is correct |
84 |
Correct |
2 ms |
724 KB |
Output is correct |
85 |
Correct |
5 ms |
772 KB |
Output is correct |
86 |
Correct |
2 ms |
640 KB |
Output is correct |
87 |
Correct |
1 ms |
340 KB |
Output is correct |
88 |
Correct |
1 ms |
340 KB |
Output is correct |
89 |
Correct |
1 ms |
340 KB |
Output is correct |
90 |
Correct |
1 ms |
340 KB |
Output is correct |
91 |
Correct |
1 ms |
340 KB |
Output is correct |
92 |
Correct |
1 ms |
340 KB |
Output is correct |
93 |
Correct |
1 ms |
340 KB |
Output is correct |
94 |
Correct |
1 ms |
336 KB |
Output is correct |
95 |
Correct |
1 ms |
340 KB |
Output is correct |
96 |
Correct |
1 ms |
344 KB |
Output is correct |
97 |
Correct |
1 ms |
472 KB |
Output is correct |
98 |
Correct |
1 ms |
468 KB |
Output is correct |
99 |
Correct |
1 ms |
468 KB |
Output is correct |
100 |
Correct |
1 ms |
468 KB |
Output is correct |
101 |
Correct |
1 ms |
468 KB |
Output is correct |
102 |
Correct |
1 ms |
340 KB |
Output is correct |
103 |
Correct |
1 ms |
340 KB |
Output is correct |
104 |
Correct |
1 ms |
340 KB |
Output is correct |
105 |
Correct |
1 ms |
340 KB |
Output is correct |
106 |
Correct |
0 ms |
340 KB |
Output is correct |
107 |
Correct |
2 ms |
596 KB |
Output is correct |
108 |
Correct |
3 ms |
724 KB |
Output is correct |
109 |
Correct |
4 ms |
724 KB |
Output is correct |
110 |
Correct |
5 ms |
724 KB |
Output is correct |
111 |
Correct |
9 ms |
800 KB |
Output is correct |
112 |
Correct |
3 ms |
724 KB |
Output is correct |
113 |
Correct |
2 ms |
724 KB |
Output is correct |
114 |
Correct |
2 ms |
724 KB |
Output is correct |
115 |
Correct |
2 ms |
724 KB |
Output is correct |
116 |
Correct |
1 ms |
596 KB |
Output is correct |
117 |
Correct |
7 ms |
708 KB |
Output is correct |
118 |
Correct |
2 ms |
596 KB |
Output is correct |
119 |
Correct |
2 ms |
724 KB |
Output is correct |
120 |
Correct |
2 ms |
724 KB |
Output is correct |
121 |
Correct |
2 ms |
724 KB |
Output is correct |
122 |
Correct |
7 ms |
724 KB |
Output is correct |
123 |
Correct |
3 ms |
468 KB |
Output is correct |
124 |
Correct |
7 ms |
760 KB |
Output is correct |
125 |
Correct |
2 ms |
724 KB |
Output is correct |
126 |
Correct |
2 ms |
724 KB |
Output is correct |
127 |
Correct |
2 ms |
724 KB |
Output is correct |
128 |
Correct |
5 ms |
724 KB |
Output is correct |
129 |
Correct |
1 ms |
596 KB |
Output is correct |
130 |
Correct |
4 ms |
724 KB |
Output is correct |
131 |
Correct |
2 ms |
740 KB |
Output is correct |
132 |
Correct |
1 ms |
596 KB |
Output is correct |
133 |
Correct |
3 ms |
852 KB |
Output is correct |
134 |
Correct |
3 ms |
724 KB |
Output is correct |
135 |
Correct |
2 ms |
724 KB |
Output is correct |
136 |
Correct |
5 ms |
852 KB |
Output is correct |
137 |
Correct |
3 ms |
852 KB |
Output is correct |
138 |
Correct |
1 ms |
336 KB |
Output is correct |
139 |
Correct |
0 ms |
340 KB |
Output is correct |
140 |
Correct |
1 ms |
340 KB |
Output is correct |
141 |
Correct |
1 ms |
340 KB |
Output is correct |
142 |
Correct |
1 ms |
340 KB |
Output is correct |
143 |
Correct |
1 ms |
340 KB |
Output is correct |
144 |
Correct |
1 ms |
344 KB |
Output is correct |
145 |
Correct |
1 ms |
348 KB |
Output is correct |
146 |
Correct |
1 ms |
344 KB |
Output is correct |
147 |
Correct |
3 ms |
856 KB |
Output is correct |
148 |
Correct |
5 ms |
860 KB |
Output is correct |
149 |
Correct |
5 ms |
852 KB |
Output is correct |
150 |
Correct |
4 ms |
812 KB |
Output is correct |
151 |
Correct |
6 ms |
856 KB |
Output is correct |
152 |
Correct |
1 ms |
596 KB |
Output is correct |
153 |
Correct |
1 ms |
596 KB |
Output is correct |
154 |
Correct |
1 ms |
604 KB |
Output is correct |
155 |
Correct |
1 ms |
596 KB |
Output is correct |
156 |
Correct |
1 ms |
596 KB |
Output is correct |
157 |
Correct |
1 ms |
596 KB |
Output is correct |
158 |
Correct |
2 ms |
596 KB |
Output is correct |
159 |
Correct |
1 ms |
608 KB |
Output is correct |
160 |
Correct |
2 ms |
596 KB |
Output is correct |
161 |
Correct |
2 ms |
604 KB |
Output is correct |
162 |
Correct |
1 ms |
596 KB |
Output is correct |
163 |
Correct |
1 ms |
608 KB |
Output is correct |
164 |
Correct |
1 ms |
340 KB |
Output is correct |
165 |
Correct |
1018 ms |
57104 KB |
Output is correct |
166 |
Correct |
661 ms |
84708 KB |
Output is correct |
167 |
Correct |
767 ms |
84888 KB |
Output is correct |
168 |
Correct |
6 ms |
852 KB |
Output is correct |
169 |
Correct |
8 ms |
852 KB |
Output is correct |
170 |
Correct |
74 ms |
5704 KB |
Output is correct |
171 |
Correct |
131 ms |
5756 KB |
Output is correct |
172 |
Correct |
651 ms |
84684 KB |
Output is correct |
173 |
Execution timed out |
3037 ms |
83764 KB |
Time limit exceeded |
174 |
Halted |
0 ms |
0 KB |
- |