#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pb push_back
#define ar array
#define all(x) x.begin(), x.end()
#define siz(x) (int) x.size()
#define uid(a, b) uniform_int_distribution<int>(a, b)(rng)
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define ROF(i, a, b) for(int i=(b-1); i>=(a); i--)
#define F0R(i, n) FOR(i, 0, n)
#define R0F(i, n) ROF(i, 0, n)
#define trav(x, y) for(auto&x:y)
using ll=long long;
using ld=long double;
using pii=pair<int, int>;
using pll=pair<ll, ll>;
using pli=pair<ll, int>;
using vi=vector<int>;
using vl=vector<ll>;
using vpii=vector<pii>;
template<class T> inline bool ckmin(T&a, const T&b) {return b<a?a=b,1:0;}
template<class T> inline bool ckmax(T&a, const T&b) {return b>a?a=b,1:0;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const char nl='\n';
const int mxN=1<<17;
const int MOD=1e9+7;
const ll infLL=1e18;
const ld eps=1e-6;
int m, n, p[mxN];
vector<ar<int, 3>> v;
vpii v2;
int Find(int u){
return p[u]=(u==p[u]?u:Find(p[u]));
}
void comb(int e1, int e2){
e1=Find(e1); e2=Find(e2);
if(e1!=e2)
p[e2]=e1;
}
struct segment{
int val[2*mxN], mset[2*mxN];
// segment() {memset(mset, -1, sizeof mset);}
void set(int L, int R, int v, int i=1, int lo=0, int hi=mxN){
if(lo>=R||L>=hi) return;
if(L<=lo&&hi<=R){
mset[i]=v;
val[i]=v*(hi-lo);
return;
}
push(i, lo, hi);
int m=(lo+hi)/2;
set(L, R, v, i*2, lo, m);
set(L, R, v, i*2+1, m, hi);
val[i]=val[2*i]+val[2*i+1];
}
int query(int L, int R, int i=1, int lo=0, int hi=mxN){
if(lo>=R||L>=hi) return 0;
if(L<=lo&&hi<=R)
return val[i];
push(i, lo, hi);
int m=(lo+hi)/2;
return query(L, R, i*2, lo, m)+query(L, R, i*2+1, m, hi);
}
void push(int i, int lo, int hi){
int m=(lo+hi)/2;
if(mset[i]!=-1){
set(lo, m, mset[i], i*2, lo, m);
set(m, hi, mset[i], i*2+1, m, hi);
mset[i]=-1;
}
}
} st[2];
set<pii> vals;
vi r;
vector<vi> pts;
void se(int l, int r, int t){
// cout << "SE: " << l << ' ' << r << ' ' << t << nl;
if(r>=m){
st[t].set(0, r+1-m, 1);
st[t].set(l, m, 1);
}
else{
st[t].set(l, r+1, 1);
}
}
int qq(int l, int r, int t){
int res=0;
if(r>=m){
res+=st[t].query(0, r+1-m);
res+=st[t].query(l, m);
}
else{
res+=st[t].query(l, r+1);
}
return res;
}
void proc(int v, int t){
se(v2[v].f, v2[v].s, t);
for(auto q:pts[v]){
se(v2[q].f, v2[q].s, t^1);
}
}
int sz(int l, int r){
if(r>=m){
return r+1-m+(m-l);
}
else{
return r-l+1;
}
}
int32_t main(){
cin.tie(0)->sync_with_stdio(0);
cin >> m >> n;
memset(st[0].mset, -1, sizeof st[0].mset);
memset(st[1].mset, -1, sizeof st[1].mset);
pts.resize(n);
F0R(i, n) p[i]=i;
F0R(i, n){
int l, r; cin >> l >> r;
l--; r--;
if(r<l) v.pb({l, r+m, i});
else v.pb({l, r, i}), v.pb({l+m, r+m, i});
if(r>=l)
v2.pb({l, r});
else
v2.pb({l, r+m});
se(v2[i].f, v2[i].s, 0);
}
if(st[0].query(0, m)!=m){
cout << "impossible\n";
return 0;
}
st[0].set(0, m, 0);
sort(all(v), [&](ar<int, 3> A, ar<int, 3> B){
if(A[0]==B[0]) return A[1]>B[1];
return A[0]<B[0];
});
for(auto[x, y, i]:v){
// cout << x << ' ' << y << ' ' << i << nl;
// for(auto v:vals) cout << "(" << v.f << ", " << v.s << ")" << ' ';
// cout << nl;
auto it=vals.lower_bound({y, -MOD});
if(i==Find(i)&&it!=vals.end()){
comb(it->s, i);
}
vals.insert({y, i});
}
// we have do deal with odds and evens
F0R(i, n){
if(Find(i)!=i)
pts[Find(i)].pb(i);
else
r.pb(i);
}
sort(all(r), [&](int e1, int e2){
return v2[e1]<v2[e2];
});
int R=siz(r);
// F0R(i, R){
// cout << r[i] << ": ";
// trav(v, pts[r[i]]) cout << v << ' ';
// cout << nl;
// }
// cout << nl;
if(R==1){
// cerr << "HERE\n";
// throw 69;
proc(r[0], 0);
if(qq(0, m-1, 0)!=m||qq(0, m-1, 1)!=m){
cout << "impossible\n";
}
else{
F0R(i, n){
if(i==r[0]) cout << 1;
else cout << 0;
}
cout << nl;
}
return 0;
}
F0R(i, R){
int lb=r[(i-1+R)%R], mb=r[i], rb=r[(i+1)%R];
// set lb with 1s
// cout << lb << ' ' << mb << ' ' << rb << nl;
proc(lb, 0); proc(mb, 1); proc(rb, 0);
// cout << qq(v2[mb].f, v2[mb].s, 0) << ' ' << qq(v2[mb].f, v2[mb].s, 1) << nl;
// F0R(i, m) cout << st[0].query(i, i+1) << ' ';
// cout << nl;
// F0R(i, m) cout << st[1].query(i, i+1) << ' ';
// cout << nl;
// cout << sz(v2[mb].f, v2[mb].s) << ' ' << qq(v2[mb].f, v2[mb].s, 0) << nl;
if(qq(v2[mb].f, v2[mb].s, 0)!=sz(v2[mb].f, v2[mb].s)){
cout << "impossible\n";
return 0;
}
st[0].set(0, m, 0);
st[1].set(0, m, 0);
}
if(R&1){
F0R(i, R){
int lb=r[(i-1+R)%R], mb1=r[i], mb2=r[(i+1)%R], rb=r[(i+2)%R];
proc(lb, 0); proc(mb1, 1); proc(mb2, 1); proc(rb, 0);
if(v2[mb1].s<v2[mb2].f-1) continue;
if(qq(v2[mb1].f, v2[mb1].s, 0)==sz(v2[mb1].f, v2[mb1].s)&&qq(v2[mb2].f, v2[mb2].s, 0)==sz(v2[mb2].f, v2[mb2].s)){
// we have found a sol
vi ans(n, -1);
int x=0;
F0R(j, R){
ans[r[j]]=j&1^x;
trav(v, pts[r[j]]) ans[v]=j&1^1^x;
if(j==i)
x=1;
}
F0R(i, n) cout << ans[i];
cout << nl;
return 0;
}
st[0].set(0, m, 0); st[1].set(0, m, 0);
}
cout << "impossible\n";
}
else{
vi ans(n, -1);
F0R(i, R){
ans[r[i]]=i&1;
trav(v, pts[r[i]]) ans[v]=i&1^1;
}
F0R(i, n) cout << ans[i];
cout << nl;
}
}
Compilation message
alternating.cpp: In function 'int32_t main()':
alternating.cpp:225:32: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
225 | ans[r[j]]=j&1^x;
| ~^~
alternating.cpp:226:48: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
226 | trav(v, pts[r[j]]) ans[v]=j&1^1^x;
| ~^~
alternating.cpp:242:40: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
242 | trav(v, pts[r[i]]) ans[v]=i&1^1;
| ~^~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
2380 KB |
Output is correct |
2 |
Correct |
1 ms |
2380 KB |
Output is correct |
3 |
Correct |
1 ms |
2380 KB |
Output is correct |
4 |
Correct |
2 ms |
2380 KB |
Output is correct |
5 |
Correct |
1 ms |
2380 KB |
Output is correct |
6 |
Correct |
2 ms |
2380 KB |
Output is correct |
7 |
Correct |
2 ms |
2380 KB |
Output is correct |
8 |
Correct |
2 ms |
2380 KB |
Output is correct |
9 |
Correct |
2 ms |
2380 KB |
Output is correct |
10 |
Correct |
2 ms |
2380 KB |
Output is correct |
11 |
Correct |
2 ms |
2380 KB |
Output is correct |
12 |
Correct |
2 ms |
2380 KB |
Output is correct |
13 |
Correct |
2 ms |
2380 KB |
Output is correct |
14 |
Correct |
2 ms |
2380 KB |
Output is correct |
15 |
Correct |
2 ms |
2380 KB |
Output is correct |
16 |
Correct |
2 ms |
2376 KB |
Output is correct |
17 |
Correct |
2 ms |
2392 KB |
Output is correct |
18 |
Correct |
2 ms |
2380 KB |
Output is correct |
19 |
Correct |
2 ms |
2380 KB |
Output is correct |
20 |
Correct |
2 ms |
2380 KB |
Output is correct |
21 |
Correct |
2 ms |
2388 KB |
Output is correct |
22 |
Correct |
2 ms |
2380 KB |
Output is correct |
23 |
Correct |
2 ms |
2380 KB |
Output is correct |
24 |
Correct |
2 ms |
2380 KB |
Output is correct |
25 |
Correct |
2 ms |
2384 KB |
Output is correct |
26 |
Correct |
2 ms |
2380 KB |
Output is correct |
27 |
Correct |
2 ms |
2380 KB |
Output is correct |
28 |
Correct |
2 ms |
2380 KB |
Output is correct |
29 |
Correct |
2 ms |
2392 KB |
Output is correct |
30 |
Correct |
2 ms |
2384 KB |
Output is correct |
31 |
Correct |
2 ms |
2380 KB |
Output is correct |
32 |
Correct |
2 ms |
2380 KB |
Output is correct |
33 |
Correct |
2 ms |
2380 KB |
Output is correct |
34 |
Correct |
2 ms |
2380 KB |
Output is correct |
35 |
Correct |
2 ms |
2380 KB |
Output is correct |
36 |
Correct |
2 ms |
2380 KB |
Output is correct |
37 |
Correct |
2 ms |
2380 KB |
Output is correct |
38 |
Correct |
2 ms |
2380 KB |
Output is correct |
39 |
Correct |
2 ms |
2380 KB |
Output is correct |
40 |
Correct |
2 ms |
2380 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
2380 KB |
Output is correct |
2 |
Correct |
1 ms |
2380 KB |
Output is correct |
3 |
Correct |
1 ms |
2380 KB |
Output is correct |
4 |
Correct |
2 ms |
2380 KB |
Output is correct |
5 |
Correct |
1 ms |
2380 KB |
Output is correct |
6 |
Correct |
2 ms |
2380 KB |
Output is correct |
7 |
Correct |
2 ms |
2380 KB |
Output is correct |
8 |
Correct |
2 ms |
2380 KB |
Output is correct |
9 |
Correct |
2 ms |
2380 KB |
Output is correct |
10 |
Correct |
2 ms |
2380 KB |
Output is correct |
11 |
Correct |
2 ms |
2380 KB |
Output is correct |
12 |
Correct |
2 ms |
2380 KB |
Output is correct |
13 |
Correct |
2 ms |
2380 KB |
Output is correct |
14 |
Correct |
2 ms |
2380 KB |
Output is correct |
15 |
Correct |
2 ms |
2380 KB |
Output is correct |
16 |
Correct |
2 ms |
2376 KB |
Output is correct |
17 |
Correct |
2 ms |
2392 KB |
Output is correct |
18 |
Correct |
2 ms |
2380 KB |
Output is correct |
19 |
Correct |
2 ms |
2380 KB |
Output is correct |
20 |
Correct |
2 ms |
2380 KB |
Output is correct |
21 |
Correct |
2 ms |
2388 KB |
Output is correct |
22 |
Correct |
2 ms |
2380 KB |
Output is correct |
23 |
Correct |
2 ms |
2380 KB |
Output is correct |
24 |
Correct |
2 ms |
2380 KB |
Output is correct |
25 |
Correct |
2 ms |
2384 KB |
Output is correct |
26 |
Correct |
2 ms |
2380 KB |
Output is correct |
27 |
Correct |
2 ms |
2380 KB |
Output is correct |
28 |
Correct |
2 ms |
2380 KB |
Output is correct |
29 |
Correct |
2 ms |
2392 KB |
Output is correct |
30 |
Correct |
2 ms |
2384 KB |
Output is correct |
31 |
Correct |
2 ms |
2380 KB |
Output is correct |
32 |
Correct |
2 ms |
2380 KB |
Output is correct |
33 |
Correct |
2 ms |
2380 KB |
Output is correct |
34 |
Correct |
2 ms |
2380 KB |
Output is correct |
35 |
Correct |
2 ms |
2380 KB |
Output is correct |
36 |
Correct |
2 ms |
2380 KB |
Output is correct |
37 |
Correct |
2 ms |
2380 KB |
Output is correct |
38 |
Correct |
2 ms |
2380 KB |
Output is correct |
39 |
Correct |
2 ms |
2380 KB |
Output is correct |
40 |
Correct |
2 ms |
2380 KB |
Output is correct |
41 |
Correct |
2 ms |
2380 KB |
Output is correct |
42 |
Correct |
2 ms |
2380 KB |
Output is correct |
43 |
Correct |
2 ms |
2380 KB |
Output is correct |
44 |
Correct |
2 ms |
2380 KB |
Output is correct |
45 |
Correct |
2 ms |
2380 KB |
Output is correct |
46 |
Correct |
2 ms |
2380 KB |
Output is correct |
47 |
Correct |
2 ms |
2380 KB |
Output is correct |
48 |
Correct |
2 ms |
2380 KB |
Output is correct |
49 |
Correct |
2 ms |
2380 KB |
Output is correct |
50 |
Correct |
2 ms |
2380 KB |
Output is correct |
51 |
Correct |
2 ms |
2380 KB |
Output is correct |
52 |
Correct |
2 ms |
2380 KB |
Output is correct |
53 |
Correct |
2 ms |
2380 KB |
Output is correct |
54 |
Correct |
2 ms |
2380 KB |
Output is correct |
55 |
Correct |
2 ms |
2380 KB |
Output is correct |
56 |
Correct |
2 ms |
2380 KB |
Output is correct |
57 |
Correct |
2 ms |
2380 KB |
Output is correct |
58 |
Correct |
2 ms |
2380 KB |
Output is correct |
59 |
Correct |
2 ms |
2368 KB |
Output is correct |
60 |
Correct |
2 ms |
2384 KB |
Output is correct |
61 |
Correct |
2 ms |
2380 KB |
Output is correct |
62 |
Correct |
2 ms |
2380 KB |
Output is correct |
63 |
Correct |
2 ms |
2380 KB |
Output is correct |
64 |
Correct |
2 ms |
2384 KB |
Output is correct |
65 |
Correct |
2 ms |
2380 KB |
Output is correct |
66 |
Correct |
2 ms |
2380 KB |
Output is correct |
67 |
Correct |
2 ms |
2380 KB |
Output is correct |
68 |
Correct |
2 ms |
2380 KB |
Output is correct |
69 |
Correct |
2 ms |
2380 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
2380 KB |
Output is correct |
2 |
Correct |
1 ms |
2380 KB |
Output is correct |
3 |
Correct |
1 ms |
2380 KB |
Output is correct |
4 |
Correct |
2 ms |
2380 KB |
Output is correct |
5 |
Correct |
1 ms |
2380 KB |
Output is correct |
6 |
Correct |
2 ms |
2380 KB |
Output is correct |
7 |
Correct |
2 ms |
2380 KB |
Output is correct |
8 |
Correct |
2 ms |
2380 KB |
Output is correct |
9 |
Correct |
2 ms |
2380 KB |
Output is correct |
10 |
Correct |
2 ms |
2380 KB |
Output is correct |
11 |
Correct |
2 ms |
2380 KB |
Output is correct |
12 |
Correct |
2 ms |
2380 KB |
Output is correct |
13 |
Correct |
2 ms |
2380 KB |
Output is correct |
14 |
Correct |
2 ms |
2380 KB |
Output is correct |
15 |
Correct |
2 ms |
2380 KB |
Output is correct |
16 |
Correct |
2 ms |
2376 KB |
Output is correct |
17 |
Correct |
2 ms |
2392 KB |
Output is correct |
18 |
Correct |
2 ms |
2380 KB |
Output is correct |
19 |
Correct |
2 ms |
2380 KB |
Output is correct |
20 |
Correct |
2 ms |
2380 KB |
Output is correct |
21 |
Correct |
2 ms |
2388 KB |
Output is correct |
22 |
Correct |
2 ms |
2380 KB |
Output is correct |
23 |
Correct |
2 ms |
2380 KB |
Output is correct |
24 |
Correct |
2 ms |
2380 KB |
Output is correct |
25 |
Correct |
2 ms |
2384 KB |
Output is correct |
26 |
Correct |
2 ms |
2380 KB |
Output is correct |
27 |
Correct |
2 ms |
2380 KB |
Output is correct |
28 |
Correct |
2 ms |
2380 KB |
Output is correct |
29 |
Correct |
2 ms |
2392 KB |
Output is correct |
30 |
Correct |
2 ms |
2384 KB |
Output is correct |
31 |
Correct |
2 ms |
2380 KB |
Output is correct |
32 |
Correct |
2 ms |
2380 KB |
Output is correct |
33 |
Correct |
2 ms |
2380 KB |
Output is correct |
34 |
Correct |
2 ms |
2380 KB |
Output is correct |
35 |
Correct |
2 ms |
2380 KB |
Output is correct |
36 |
Correct |
2 ms |
2380 KB |
Output is correct |
37 |
Correct |
2 ms |
2380 KB |
Output is correct |
38 |
Correct |
2 ms |
2380 KB |
Output is correct |
39 |
Correct |
2 ms |
2380 KB |
Output is correct |
40 |
Correct |
2 ms |
2380 KB |
Output is correct |
41 |
Correct |
2 ms |
2380 KB |
Output is correct |
42 |
Correct |
2 ms |
2380 KB |
Output is correct |
43 |
Correct |
2 ms |
2380 KB |
Output is correct |
44 |
Correct |
2 ms |
2380 KB |
Output is correct |
45 |
Correct |
2 ms |
2380 KB |
Output is correct |
46 |
Correct |
2 ms |
2380 KB |
Output is correct |
47 |
Correct |
2 ms |
2380 KB |
Output is correct |
48 |
Correct |
2 ms |
2380 KB |
Output is correct |
49 |
Correct |
2 ms |
2380 KB |
Output is correct |
50 |
Correct |
2 ms |
2380 KB |
Output is correct |
51 |
Correct |
2 ms |
2380 KB |
Output is correct |
52 |
Correct |
2 ms |
2380 KB |
Output is correct |
53 |
Correct |
2 ms |
2380 KB |
Output is correct |
54 |
Correct |
2 ms |
2380 KB |
Output is correct |
55 |
Correct |
2 ms |
2380 KB |
Output is correct |
56 |
Correct |
2 ms |
2380 KB |
Output is correct |
57 |
Correct |
2 ms |
2380 KB |
Output is correct |
58 |
Correct |
2 ms |
2380 KB |
Output is correct |
59 |
Correct |
2 ms |
2368 KB |
Output is correct |
60 |
Correct |
2 ms |
2384 KB |
Output is correct |
61 |
Correct |
2 ms |
2380 KB |
Output is correct |
62 |
Correct |
2 ms |
2380 KB |
Output is correct |
63 |
Correct |
2 ms |
2380 KB |
Output is correct |
64 |
Correct |
2 ms |
2384 KB |
Output is correct |
65 |
Correct |
2 ms |
2380 KB |
Output is correct |
66 |
Correct |
2 ms |
2380 KB |
Output is correct |
67 |
Correct |
2 ms |
2380 KB |
Output is correct |
68 |
Correct |
2 ms |
2380 KB |
Output is correct |
69 |
Correct |
2 ms |
2380 KB |
Output is correct |
70 |
Correct |
3 ms |
2508 KB |
Output is correct |
71 |
Correct |
5 ms |
2636 KB |
Output is correct |
72 |
Correct |
2 ms |
2508 KB |
Output is correct |
73 |
Correct |
2 ms |
2384 KB |
Output is correct |
74 |
Correct |
2 ms |
2380 KB |
Output is correct |
75 |
Correct |
2 ms |
2380 KB |
Output is correct |
76 |
Correct |
2 ms |
2508 KB |
Output is correct |
77 |
Correct |
2 ms |
2508 KB |
Output is correct |
78 |
Correct |
2 ms |
2380 KB |
Output is correct |
79 |
Correct |
2 ms |
2380 KB |
Output is correct |
80 |
Correct |
3 ms |
2520 KB |
Output is correct |
81 |
Correct |
2 ms |
2508 KB |
Output is correct |
82 |
Correct |
2 ms |
2400 KB |
Output is correct |
83 |
Correct |
3 ms |
2508 KB |
Output is correct |
84 |
Correct |
4 ms |
2636 KB |
Output is correct |
85 |
Correct |
2 ms |
2380 KB |
Output is correct |
86 |
Correct |
2 ms |
2380 KB |
Output is correct |
87 |
Correct |
3 ms |
2512 KB |
Output is correct |
88 |
Correct |
2 ms |
2380 KB |
Output is correct |
89 |
Correct |
3 ms |
2508 KB |
Output is correct |
90 |
Correct |
4 ms |
2508 KB |
Output is correct |
91 |
Correct |
2 ms |
2388 KB |
Output is correct |
92 |
Correct |
4 ms |
2508 KB |
Output is correct |
93 |
Correct |
2 ms |
2380 KB |
Output is correct |
94 |
Correct |
2 ms |
2384 KB |
Output is correct |
95 |
Correct |
2 ms |
2392 KB |
Output is correct |
96 |
Correct |
4 ms |
2636 KB |
Output is correct |
97 |
Correct |
4 ms |
2636 KB |
Output is correct |
98 |
Correct |
4 ms |
2636 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
112 ms |
18644 KB |
Output is correct |
2 |
Correct |
1 ms |
2380 KB |
Output is correct |
3 |
Correct |
92 ms |
12020 KB |
Output is correct |
4 |
Correct |
92 ms |
12040 KB |
Output is correct |
5 |
Correct |
254 ms |
20188 KB |
Output is correct |
6 |
Correct |
171 ms |
19696 KB |
Output is correct |
7 |
Correct |
195 ms |
18796 KB |
Output is correct |
8 |
Correct |
9 ms |
4428 KB |
Output is correct |
9 |
Correct |
4 ms |
4044 KB |
Output is correct |
10 |
Correct |
260 ms |
22120 KB |
Output is correct |
11 |
Correct |
181 ms |
17144 KB |
Output is correct |
12 |
Correct |
171 ms |
19616 KB |
Output is correct |
13 |
Correct |
2 ms |
2384 KB |
Output is correct |
14 |
Correct |
2 ms |
2512 KB |
Output is correct |
15 |
Correct |
220 ms |
21360 KB |
Output is correct |
16 |
Correct |
169 ms |
12564 KB |
Output is correct |
17 |
Correct |
436 ms |
21708 KB |
Output is correct |
18 |
Correct |
373 ms |
19700 KB |
Output is correct |
19 |
Correct |
8 ms |
3660 KB |
Output is correct |
20 |
Correct |
252 ms |
21876 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
2380 KB |
Output is correct |
2 |
Correct |
1 ms |
2380 KB |
Output is correct |
3 |
Correct |
1 ms |
2380 KB |
Output is correct |
4 |
Correct |
2 ms |
2380 KB |
Output is correct |
5 |
Correct |
1 ms |
2380 KB |
Output is correct |
6 |
Correct |
2 ms |
2380 KB |
Output is correct |
7 |
Correct |
2 ms |
2380 KB |
Output is correct |
8 |
Correct |
2 ms |
2380 KB |
Output is correct |
9 |
Correct |
2 ms |
2380 KB |
Output is correct |
10 |
Correct |
2 ms |
2380 KB |
Output is correct |
11 |
Correct |
2 ms |
2380 KB |
Output is correct |
12 |
Correct |
2 ms |
2380 KB |
Output is correct |
13 |
Correct |
2 ms |
2380 KB |
Output is correct |
14 |
Correct |
2 ms |
2380 KB |
Output is correct |
15 |
Correct |
2 ms |
2380 KB |
Output is correct |
16 |
Correct |
2 ms |
2376 KB |
Output is correct |
17 |
Correct |
2 ms |
2392 KB |
Output is correct |
18 |
Correct |
2 ms |
2380 KB |
Output is correct |
19 |
Correct |
2 ms |
2380 KB |
Output is correct |
20 |
Correct |
2 ms |
2380 KB |
Output is correct |
21 |
Correct |
2 ms |
2388 KB |
Output is correct |
22 |
Correct |
2 ms |
2380 KB |
Output is correct |
23 |
Correct |
2 ms |
2380 KB |
Output is correct |
24 |
Correct |
2 ms |
2380 KB |
Output is correct |
25 |
Correct |
2 ms |
2384 KB |
Output is correct |
26 |
Correct |
2 ms |
2380 KB |
Output is correct |
27 |
Correct |
2 ms |
2380 KB |
Output is correct |
28 |
Correct |
2 ms |
2380 KB |
Output is correct |
29 |
Correct |
2 ms |
2392 KB |
Output is correct |
30 |
Correct |
2 ms |
2384 KB |
Output is correct |
31 |
Correct |
2 ms |
2380 KB |
Output is correct |
32 |
Correct |
2 ms |
2380 KB |
Output is correct |
33 |
Correct |
2 ms |
2380 KB |
Output is correct |
34 |
Correct |
2 ms |
2380 KB |
Output is correct |
35 |
Correct |
2 ms |
2380 KB |
Output is correct |
36 |
Correct |
2 ms |
2380 KB |
Output is correct |
37 |
Correct |
2 ms |
2380 KB |
Output is correct |
38 |
Correct |
2 ms |
2380 KB |
Output is correct |
39 |
Correct |
2 ms |
2380 KB |
Output is correct |
40 |
Correct |
2 ms |
2380 KB |
Output is correct |
41 |
Correct |
2 ms |
2380 KB |
Output is correct |
42 |
Correct |
2 ms |
2380 KB |
Output is correct |
43 |
Correct |
2 ms |
2380 KB |
Output is correct |
44 |
Correct |
2 ms |
2380 KB |
Output is correct |
45 |
Correct |
2 ms |
2380 KB |
Output is correct |
46 |
Correct |
2 ms |
2380 KB |
Output is correct |
47 |
Correct |
2 ms |
2380 KB |
Output is correct |
48 |
Correct |
2 ms |
2380 KB |
Output is correct |
49 |
Correct |
2 ms |
2380 KB |
Output is correct |
50 |
Correct |
2 ms |
2380 KB |
Output is correct |
51 |
Correct |
2 ms |
2380 KB |
Output is correct |
52 |
Correct |
2 ms |
2380 KB |
Output is correct |
53 |
Correct |
2 ms |
2380 KB |
Output is correct |
54 |
Correct |
2 ms |
2380 KB |
Output is correct |
55 |
Correct |
2 ms |
2380 KB |
Output is correct |
56 |
Correct |
2 ms |
2380 KB |
Output is correct |
57 |
Correct |
2 ms |
2380 KB |
Output is correct |
58 |
Correct |
2 ms |
2380 KB |
Output is correct |
59 |
Correct |
2 ms |
2368 KB |
Output is correct |
60 |
Correct |
2 ms |
2384 KB |
Output is correct |
61 |
Correct |
2 ms |
2380 KB |
Output is correct |
62 |
Correct |
2 ms |
2380 KB |
Output is correct |
63 |
Correct |
2 ms |
2380 KB |
Output is correct |
64 |
Correct |
2 ms |
2384 KB |
Output is correct |
65 |
Correct |
2 ms |
2380 KB |
Output is correct |
66 |
Correct |
2 ms |
2380 KB |
Output is correct |
67 |
Correct |
2 ms |
2380 KB |
Output is correct |
68 |
Correct |
2 ms |
2380 KB |
Output is correct |
69 |
Correct |
2 ms |
2380 KB |
Output is correct |
70 |
Correct |
3 ms |
2508 KB |
Output is correct |
71 |
Correct |
5 ms |
2636 KB |
Output is correct |
72 |
Correct |
2 ms |
2508 KB |
Output is correct |
73 |
Correct |
2 ms |
2384 KB |
Output is correct |
74 |
Correct |
2 ms |
2380 KB |
Output is correct |
75 |
Correct |
2 ms |
2380 KB |
Output is correct |
76 |
Correct |
2 ms |
2508 KB |
Output is correct |
77 |
Correct |
2 ms |
2508 KB |
Output is correct |
78 |
Correct |
2 ms |
2380 KB |
Output is correct |
79 |
Correct |
2 ms |
2380 KB |
Output is correct |
80 |
Correct |
3 ms |
2520 KB |
Output is correct |
81 |
Correct |
2 ms |
2508 KB |
Output is correct |
82 |
Correct |
2 ms |
2400 KB |
Output is correct |
83 |
Correct |
3 ms |
2508 KB |
Output is correct |
84 |
Correct |
4 ms |
2636 KB |
Output is correct |
85 |
Correct |
2 ms |
2380 KB |
Output is correct |
86 |
Correct |
2 ms |
2380 KB |
Output is correct |
87 |
Correct |
3 ms |
2512 KB |
Output is correct |
88 |
Correct |
2 ms |
2380 KB |
Output is correct |
89 |
Correct |
3 ms |
2508 KB |
Output is correct |
90 |
Correct |
4 ms |
2508 KB |
Output is correct |
91 |
Correct |
2 ms |
2388 KB |
Output is correct |
92 |
Correct |
4 ms |
2508 KB |
Output is correct |
93 |
Correct |
2 ms |
2380 KB |
Output is correct |
94 |
Correct |
2 ms |
2384 KB |
Output is correct |
95 |
Correct |
2 ms |
2392 KB |
Output is correct |
96 |
Correct |
4 ms |
2636 KB |
Output is correct |
97 |
Correct |
4 ms |
2636 KB |
Output is correct |
98 |
Correct |
4 ms |
2636 KB |
Output is correct |
99 |
Correct |
112 ms |
18644 KB |
Output is correct |
100 |
Correct |
1 ms |
2380 KB |
Output is correct |
101 |
Correct |
92 ms |
12020 KB |
Output is correct |
102 |
Correct |
92 ms |
12040 KB |
Output is correct |
103 |
Correct |
254 ms |
20188 KB |
Output is correct |
104 |
Correct |
171 ms |
19696 KB |
Output is correct |
105 |
Correct |
195 ms |
18796 KB |
Output is correct |
106 |
Correct |
9 ms |
4428 KB |
Output is correct |
107 |
Correct |
4 ms |
4044 KB |
Output is correct |
108 |
Correct |
260 ms |
22120 KB |
Output is correct |
109 |
Correct |
181 ms |
17144 KB |
Output is correct |
110 |
Correct |
171 ms |
19616 KB |
Output is correct |
111 |
Correct |
2 ms |
2384 KB |
Output is correct |
112 |
Correct |
2 ms |
2512 KB |
Output is correct |
113 |
Correct |
220 ms |
21360 KB |
Output is correct |
114 |
Correct |
169 ms |
12564 KB |
Output is correct |
115 |
Correct |
436 ms |
21708 KB |
Output is correct |
116 |
Correct |
373 ms |
19700 KB |
Output is correct |
117 |
Correct |
8 ms |
3660 KB |
Output is correct |
118 |
Correct |
252 ms |
21876 KB |
Output is correct |
119 |
Correct |
2 ms |
3276 KB |
Output is correct |
120 |
Correct |
291 ms |
16608 KB |
Output is correct |
121 |
Correct |
154 ms |
11924 KB |
Output is correct |
122 |
Correct |
2 ms |
2380 KB |
Output is correct |
123 |
Correct |
10 ms |
4180 KB |
Output is correct |
124 |
Correct |
63 ms |
9768 KB |
Output is correct |
125 |
Correct |
71 ms |
8892 KB |
Output is correct |
126 |
Correct |
3 ms |
3792 KB |
Output is correct |
127 |
Correct |
23 ms |
5540 KB |
Output is correct |
128 |
Correct |
204 ms |
18292 KB |
Output is correct |
129 |
Correct |
116 ms |
12300 KB |
Output is correct |
130 |
Correct |
143 ms |
14200 KB |
Output is correct |
131 |
Correct |
2 ms |
3148 KB |
Output is correct |
132 |
Correct |
3 ms |
3404 KB |
Output is correct |
133 |
Correct |
360 ms |
18516 KB |
Output is correct |
134 |
Correct |
96 ms |
7896 KB |
Output is correct |
135 |
Correct |
2 ms |
2892 KB |
Output is correct |
136 |
Correct |
91 ms |
13300 KB |
Output is correct |
137 |
Correct |
177 ms |
17484 KB |
Output is correct |
138 |
Correct |
5 ms |
4172 KB |
Output is correct |