#include<bits/stdc++.h>
using namespace std;
const long long inf = (long long) 1e18 + 10;
const int inf1 = (int) 1e9 + 10;
#define int long long
#define dbl long double
#define endl '\n'
#define sc second
#define fr first
#define mp make_pair
#define pb push_back
#define all(x) x.begin(), x.end()
const int maxn = 2e5+10;
int n, m, pai[maxn], ps[maxn], ans[maxn];
int find(int v) {
if(pai[v] == v) return v;
return pai[v] = find(pai[v]);
}
bool cmp(pair<pair<int,int>,int> a, pair<pair<int,int>,int> b) {
if(a.fr.fr == b.fr.fr) {
return a.fr.sc > b.fr.sc;
}
return a.fr.fr < b.fr.fr;
}
void solve() {
cin >> n >> m;
vector<pair<pair<int,int>,int>> segs;
vector<pair<int,int>> vec;
for(int i = 0; i < m; i++) {
int a,b; cin >> a >> b;
vec.pb(mp(a,b));
pai[i] = i;
if(b >= a) {
ps[a]++;
ps[b+1]--;
ps[a+n]++;
ps[b+n+1]--;
segs.pb(mp(mp(a,b),i));
segs.pb(mp(mp(a+n,b+n),i));
}
else {
ps[a]++;
ps[b+n+1]--;
ps[1]++;
ps[b+1]--;
ps[a+n]++;
ps[2*n+1]--;
segs.pb(mp(mp(a,b+n),i));
}
}
sort(all(segs),cmp); //menor L, maior R
priority_queue<pair<pair<int,int>,int>,vector<pair<pair<int,int>,int>>,greater<pair<pair<int,int>,int>>> pq;
for(auto X : segs) {
int l = X.fr.fr;
int r = X.fr.sc;
int id = X.sc;
// cout << l << " " << r << " -" << id << endl;
while(pq.size() && pq.top().fr.sc < r) pq.pop();
if(pq.size() && pq.top().fr.fr <= l) {
pai[id] = pq.top().sc;
// cout << " " << pai[id] << endl;
}
else {
pq.push(mp(mp(l,r),id));
}
}
segs.clear();
for(int i = 0; i < m; i++) {
// cout << i << " " << pai[i] << endl;
if(pai[i] == i) {
int a = vec[i].fr;
int b = vec[i].sc;
if(b >= a) {
segs.pb(mp(mp(a,b),i));
}
else {
segs.pb(mp(mp(a,b+n),i));
}
}
}
sort(all(segs));
for(int i = 0; i < m; i++) {
if(pai[i] == i) continue;
int l1 = vec[i].fr;
int r1 = vec[i].sc;
//ve o ultimo com l menor ou igual a l1
auto it = lower_bound(all(segs),mp(mp(l1,inf),0LL));
if(it != segs.end()) {
int l2,r2,id;
l2 = it->fr.fr;
r2 = it->fr.sc;
id = it->sc;
//ve se da certo com esse
if(l1 >= l2 && r1 <= r2) {
pai[i] = id;
continue;
}
}
//tenta com l1+n e r1+n
l1+= n;
r1+= n;
it = lower_bound(all(segs),mp(mp(l1,inf),0LL));
if(it != segs.end()) {
int l2,r2,id;
l2 = it->fr.fr;
r2 = it->fr.sc;
id = it->sc;
//ve se da certo com esse
if(l1 >= l2 && r1 <= r2) {
pai[i] = id;
continue;
}
}
}
bool ok = true;
for(int i = 1; i <= 2*n; i++) {
ps[i]+=ps[i-1];
if(ps[i] < 2) ok = false;
}
if(!ok) {
cout << "impossible" << endl;
return;
}
if((((int) segs.size())&1) == 0) {
for(int i = 0; i < segs.size(); i++) {
int id = segs[i].sc;
ans[id] = i&1;
}
for(int i = 0; i < m; i++) {
if(pai[i] == i) continue;
ans[i] = ans[pai[i]]^1;
}
for(int i = 0; i < m; i++) {
cout << ans[i];
}
}
else {
if(segs.size() == 1) {
ans[segs[0].sc] = 1;
for(int i = 0; i < m; i++) {
cout << ans[i];
}
return;
}
bool ok = false;
for(int i = 0; i+1 < segs.size(); i++) {
int l1 = segs[i].fr.fr;
int r1 = segs[i].fr.sc;
int l2 = segs[i+1].fr.fr;
int r2 = segs[i+1].fr.sc;
//a area coberta por dois é l2 até r1
int l = l2;
int r = r1;
bool ok1 = true;
for(int i = l; i <= r; i++) {
if(ps[i] < 3) {
ok1 = false;
break;
}
}
if(ok1) {
int cnt = 0;
for(int j = i+1; j < segs.size(); j++) {
int id = segs[j].sc;
ans[id]=cnt;
cnt^=1;
}
for(int j = 0; j <= i; j++) {
int id = segs[j].sc;
ans[id]=cnt;
cnt^=1;
}
ok = true;
break;
}
}
if(ok == false) {
//ultimo com o primeiro
int l1 = segs.back().fr.fr;
int r1 = segs.back().fr.sc;
int l2 = segs[0].fr.fr+n;
int r2 = segs[0].fr.sc+n;
int l = l2;
int r = r1;
bool ok1 = true;
for(int i = l; i <= r; i++) {
if(ps[i] < 3) {
ok1 = false;
break;
}
}
if(ok1) {
int cnt = 0;
for(int j = 0; j < segs.size(); j++) {
int id = segs[j].sc;
ans[id]=cnt;
cnt^=1;
}
ok = true;
}
}
if(ok == false) {
cout << "impossible" << endl;
return;
}
for(int i = 0; i < m; i++) {
if(pai[i] == i) continue;
ans[i] = ans[pai[i]]^1;
}
for(int i = 0; i < m; i++) {
cout << ans[i];
}
}
int ps0[maxn], ps1[maxn];
for(int i = 0; i <= n; i++) {
ps0[i] = ps1[0] = 0;
}
for(auto x : segs) {
// cout << x.fr.fr << " " << x.fr.sc << " " << x.sc << endl;
}
for(int i = 0; i < m; i++) {
// cout << i << " -> " << vec[pai[i]].fr << " " << vec[pai[i]].sc << endl;
int a = vec[i].fr;
int b = vec[i].sc;
if(b >= a) {
if(ans[i] == 0) {
ps0[a]++;
ps0[b+1]--;
}
else {
ps1[a]++;
ps1[b+1]--;
}
}
else {
if(ans[i] == 0) {
ps0[b]++;
ps0[1]++;
ps0[a+1]--;
}
else {
ps1[b]++;
ps1[1]++;
ps1[a+1]--;
}
}
}
bool okk = false;
for(int i = 1; i <= n; i++) {
ps0[i]+= ps0[i-1];
ps1[i]+= ps1[i-1];
if(ps0[i] == 0 || ps1[i] == 0) {
okk = true;
}
}
if(okk) {
cout << "penis";
}cout << endl;
}
int32_t main() {
ios::sync_with_stdio(false); cin.tie(0);
// freopen("in.in", "r", stdin);
// freopen("out.out", "w", stdout);
int tt = 1;
// cin >> tt;
while(tt--) {
solve();
}
}
Compilation message
alternating.cpp: In function 'void solve()':
alternating.cpp:138:26: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<std::pair<long long int, long long int>, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
138 | for(int i = 0; i < segs.size(); i++) {
| ~~^~~~~~~~~~~~~
alternating.cpp:160:28: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<std::pair<long long int, long long int>, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
160 | for(int i = 0; i+1 < segs.size(); i++) {
| ~~~~^~~~~~~~~~~~~
alternating.cpp:178:36: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<std::pair<long long int, long long int>, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
178 | for(int j = i+1; j < segs.size(); j++) {
| ~~^~~~~~~~~~~~~
alternating.cpp:161:17: warning: unused variable 'l1' [-Wunused-variable]
161 | int l1 = segs[i].fr.fr;
| ^~
alternating.cpp:164:17: warning: unused variable 'r2' [-Wunused-variable]
164 | int r2 = segs[i+1].fr.sc;
| ^~
alternating.cpp:210:34: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<std::pair<long long int, long long int>, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
210 | for(int j = 0; j < segs.size(); j++) {
| ~~^~~~~~~~~~~~~
alternating.cpp:195:17: warning: unused variable 'l1' [-Wunused-variable]
195 | int l1 = segs.back().fr.fr;
| ^~
alternating.cpp:198:17: warning: unused variable 'r2' [-Wunused-variable]
198 | int r2 = segs[0].fr.sc+n;
| ^~
alternating.cpp:242:14: warning: variable 'x' set but not used [-Wunused-but-set-variable]
242 | for(auto x : segs) {
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3412 KB |
Output is correct |
2 |
Correct |
1 ms |
3412 KB |
Output is correct |
3 |
Correct |
2 ms |
3412 KB |
Output is correct |
4 |
Correct |
2 ms |
3412 KB |
Output is correct |
5 |
Correct |
2 ms |
3412 KB |
Output is correct |
6 |
Correct |
2 ms |
3412 KB |
Output is correct |
7 |
Correct |
2 ms |
3412 KB |
Output is correct |
8 |
Correct |
2 ms |
3412 KB |
Output is correct |
9 |
Correct |
2 ms |
3412 KB |
Output is correct |
10 |
Correct |
3 ms |
3412 KB |
Output is correct |
11 |
Correct |
2 ms |
3412 KB |
Output is correct |
12 |
Correct |
2 ms |
3412 KB |
Output is correct |
13 |
Correct |
2 ms |
3412 KB |
Output is correct |
14 |
Correct |
2 ms |
3412 KB |
Output is correct |
15 |
Correct |
2 ms |
3412 KB |
Output is correct |
16 |
Correct |
2 ms |
3412 KB |
Output is correct |
17 |
Correct |
3 ms |
3412 KB |
Output is correct |
18 |
Correct |
2 ms |
3412 KB |
Output is correct |
19 |
Correct |
2 ms |
3412 KB |
Output is correct |
20 |
Correct |
2 ms |
3412 KB |
Output is correct |
21 |
Correct |
2 ms |
3412 KB |
Output is correct |
22 |
Correct |
2 ms |
3412 KB |
Output is correct |
23 |
Correct |
2 ms |
3412 KB |
Output is correct |
24 |
Correct |
2 ms |
3412 KB |
Output is correct |
25 |
Correct |
2 ms |
3412 KB |
Output is correct |
26 |
Correct |
2 ms |
3412 KB |
Output is correct |
27 |
Correct |
2 ms |
3412 KB |
Output is correct |
28 |
Correct |
2 ms |
3412 KB |
Output is correct |
29 |
Correct |
3 ms |
3412 KB |
Output is correct |
30 |
Correct |
2 ms |
3412 KB |
Output is correct |
31 |
Correct |
2 ms |
3412 KB |
Output is correct |
32 |
Correct |
3 ms |
3412 KB |
Output is correct |
33 |
Correct |
2 ms |
3412 KB |
Output is correct |
34 |
Correct |
2 ms |
3412 KB |
Output is correct |
35 |
Correct |
2 ms |
3412 KB |
Output is correct |
36 |
Correct |
2 ms |
3412 KB |
Output is correct |
37 |
Correct |
2 ms |
3412 KB |
Output is correct |
38 |
Correct |
2 ms |
3412 KB |
Output is correct |
39 |
Correct |
2 ms |
3412 KB |
Output is correct |
40 |
Correct |
2 ms |
3412 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3412 KB |
Output is correct |
2 |
Correct |
1 ms |
3412 KB |
Output is correct |
3 |
Correct |
2 ms |
3412 KB |
Output is correct |
4 |
Correct |
2 ms |
3412 KB |
Output is correct |
5 |
Correct |
2 ms |
3412 KB |
Output is correct |
6 |
Correct |
2 ms |
3412 KB |
Output is correct |
7 |
Correct |
2 ms |
3412 KB |
Output is correct |
8 |
Correct |
2 ms |
3412 KB |
Output is correct |
9 |
Correct |
2 ms |
3412 KB |
Output is correct |
10 |
Correct |
3 ms |
3412 KB |
Output is correct |
11 |
Correct |
2 ms |
3412 KB |
Output is correct |
12 |
Correct |
2 ms |
3412 KB |
Output is correct |
13 |
Correct |
2 ms |
3412 KB |
Output is correct |
14 |
Correct |
2 ms |
3412 KB |
Output is correct |
15 |
Correct |
2 ms |
3412 KB |
Output is correct |
16 |
Correct |
2 ms |
3412 KB |
Output is correct |
17 |
Correct |
3 ms |
3412 KB |
Output is correct |
18 |
Correct |
2 ms |
3412 KB |
Output is correct |
19 |
Correct |
2 ms |
3412 KB |
Output is correct |
20 |
Correct |
2 ms |
3412 KB |
Output is correct |
21 |
Correct |
2 ms |
3412 KB |
Output is correct |
22 |
Correct |
2 ms |
3412 KB |
Output is correct |
23 |
Correct |
2 ms |
3412 KB |
Output is correct |
24 |
Correct |
2 ms |
3412 KB |
Output is correct |
25 |
Correct |
2 ms |
3412 KB |
Output is correct |
26 |
Correct |
2 ms |
3412 KB |
Output is correct |
27 |
Correct |
2 ms |
3412 KB |
Output is correct |
28 |
Correct |
2 ms |
3412 KB |
Output is correct |
29 |
Correct |
3 ms |
3412 KB |
Output is correct |
30 |
Correct |
2 ms |
3412 KB |
Output is correct |
31 |
Correct |
2 ms |
3412 KB |
Output is correct |
32 |
Correct |
3 ms |
3412 KB |
Output is correct |
33 |
Correct |
2 ms |
3412 KB |
Output is correct |
34 |
Correct |
2 ms |
3412 KB |
Output is correct |
35 |
Correct |
2 ms |
3412 KB |
Output is correct |
36 |
Correct |
2 ms |
3412 KB |
Output is correct |
37 |
Correct |
2 ms |
3412 KB |
Output is correct |
38 |
Correct |
2 ms |
3412 KB |
Output is correct |
39 |
Correct |
2 ms |
3412 KB |
Output is correct |
40 |
Correct |
2 ms |
3412 KB |
Output is correct |
41 |
Correct |
2 ms |
3412 KB |
Output is correct |
42 |
Correct |
2 ms |
3412 KB |
Output is correct |
43 |
Correct |
2 ms |
3412 KB |
Output is correct |
44 |
Correct |
3 ms |
3408 KB |
Output is correct |
45 |
Correct |
2 ms |
3412 KB |
Output is correct |
46 |
Correct |
1 ms |
3412 KB |
Output is correct |
47 |
Correct |
2 ms |
3412 KB |
Output is correct |
48 |
Correct |
2 ms |
3412 KB |
Output is correct |
49 |
Correct |
2 ms |
3412 KB |
Output is correct |
50 |
Correct |
2 ms |
3412 KB |
Output is correct |
51 |
Correct |
2 ms |
3412 KB |
Output is correct |
52 |
Correct |
3 ms |
3412 KB |
Output is correct |
53 |
Correct |
2 ms |
3448 KB |
Output is correct |
54 |
Correct |
2 ms |
3412 KB |
Output is correct |
55 |
Correct |
2 ms |
3412 KB |
Output is correct |
56 |
Correct |
3 ms |
3412 KB |
Output is correct |
57 |
Correct |
2 ms |
3412 KB |
Output is correct |
58 |
Correct |
2 ms |
3412 KB |
Output is correct |
59 |
Correct |
2 ms |
3412 KB |
Output is correct |
60 |
Correct |
2 ms |
3412 KB |
Output is correct |
61 |
Correct |
2 ms |
3412 KB |
Output is correct |
62 |
Correct |
2 ms |
3412 KB |
Output is correct |
63 |
Correct |
2 ms |
3412 KB |
Output is correct |
64 |
Correct |
2 ms |
3412 KB |
Output is correct |
65 |
Correct |
2 ms |
3412 KB |
Output is correct |
66 |
Correct |
2 ms |
3412 KB |
Output is correct |
67 |
Correct |
2 ms |
3412 KB |
Output is correct |
68 |
Correct |
2 ms |
3412 KB |
Output is correct |
69 |
Correct |
2 ms |
3412 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3412 KB |
Output is correct |
2 |
Correct |
1 ms |
3412 KB |
Output is correct |
3 |
Correct |
2 ms |
3412 KB |
Output is correct |
4 |
Correct |
2 ms |
3412 KB |
Output is correct |
5 |
Correct |
2 ms |
3412 KB |
Output is correct |
6 |
Correct |
2 ms |
3412 KB |
Output is correct |
7 |
Correct |
2 ms |
3412 KB |
Output is correct |
8 |
Correct |
2 ms |
3412 KB |
Output is correct |
9 |
Correct |
2 ms |
3412 KB |
Output is correct |
10 |
Correct |
3 ms |
3412 KB |
Output is correct |
11 |
Correct |
2 ms |
3412 KB |
Output is correct |
12 |
Correct |
2 ms |
3412 KB |
Output is correct |
13 |
Correct |
2 ms |
3412 KB |
Output is correct |
14 |
Correct |
2 ms |
3412 KB |
Output is correct |
15 |
Correct |
2 ms |
3412 KB |
Output is correct |
16 |
Correct |
2 ms |
3412 KB |
Output is correct |
17 |
Correct |
3 ms |
3412 KB |
Output is correct |
18 |
Correct |
2 ms |
3412 KB |
Output is correct |
19 |
Correct |
2 ms |
3412 KB |
Output is correct |
20 |
Correct |
2 ms |
3412 KB |
Output is correct |
21 |
Correct |
2 ms |
3412 KB |
Output is correct |
22 |
Correct |
2 ms |
3412 KB |
Output is correct |
23 |
Correct |
2 ms |
3412 KB |
Output is correct |
24 |
Correct |
2 ms |
3412 KB |
Output is correct |
25 |
Correct |
2 ms |
3412 KB |
Output is correct |
26 |
Correct |
2 ms |
3412 KB |
Output is correct |
27 |
Correct |
2 ms |
3412 KB |
Output is correct |
28 |
Correct |
2 ms |
3412 KB |
Output is correct |
29 |
Correct |
3 ms |
3412 KB |
Output is correct |
30 |
Correct |
2 ms |
3412 KB |
Output is correct |
31 |
Correct |
2 ms |
3412 KB |
Output is correct |
32 |
Correct |
3 ms |
3412 KB |
Output is correct |
33 |
Correct |
2 ms |
3412 KB |
Output is correct |
34 |
Correct |
2 ms |
3412 KB |
Output is correct |
35 |
Correct |
2 ms |
3412 KB |
Output is correct |
36 |
Correct |
2 ms |
3412 KB |
Output is correct |
37 |
Correct |
2 ms |
3412 KB |
Output is correct |
38 |
Correct |
2 ms |
3412 KB |
Output is correct |
39 |
Correct |
2 ms |
3412 KB |
Output is correct |
40 |
Correct |
2 ms |
3412 KB |
Output is correct |
41 |
Correct |
2 ms |
3412 KB |
Output is correct |
42 |
Correct |
2 ms |
3412 KB |
Output is correct |
43 |
Correct |
2 ms |
3412 KB |
Output is correct |
44 |
Correct |
3 ms |
3408 KB |
Output is correct |
45 |
Correct |
2 ms |
3412 KB |
Output is correct |
46 |
Correct |
1 ms |
3412 KB |
Output is correct |
47 |
Correct |
2 ms |
3412 KB |
Output is correct |
48 |
Correct |
2 ms |
3412 KB |
Output is correct |
49 |
Correct |
2 ms |
3412 KB |
Output is correct |
50 |
Correct |
2 ms |
3412 KB |
Output is correct |
51 |
Correct |
2 ms |
3412 KB |
Output is correct |
52 |
Correct |
3 ms |
3412 KB |
Output is correct |
53 |
Correct |
2 ms |
3448 KB |
Output is correct |
54 |
Correct |
2 ms |
3412 KB |
Output is correct |
55 |
Correct |
2 ms |
3412 KB |
Output is correct |
56 |
Correct |
3 ms |
3412 KB |
Output is correct |
57 |
Correct |
2 ms |
3412 KB |
Output is correct |
58 |
Correct |
2 ms |
3412 KB |
Output is correct |
59 |
Correct |
2 ms |
3412 KB |
Output is correct |
60 |
Correct |
2 ms |
3412 KB |
Output is correct |
61 |
Correct |
2 ms |
3412 KB |
Output is correct |
62 |
Correct |
2 ms |
3412 KB |
Output is correct |
63 |
Correct |
2 ms |
3412 KB |
Output is correct |
64 |
Correct |
2 ms |
3412 KB |
Output is correct |
65 |
Correct |
2 ms |
3412 KB |
Output is correct |
66 |
Correct |
2 ms |
3412 KB |
Output is correct |
67 |
Correct |
2 ms |
3412 KB |
Output is correct |
68 |
Correct |
2 ms |
3412 KB |
Output is correct |
69 |
Correct |
2 ms |
3412 KB |
Output is correct |
70 |
Correct |
2 ms |
3540 KB |
Output is correct |
71 |
Correct |
2 ms |
3540 KB |
Output is correct |
72 |
Correct |
2 ms |
3412 KB |
Output is correct |
73 |
Correct |
2 ms |
3412 KB |
Output is correct |
74 |
Correct |
2 ms |
3536 KB |
Output is correct |
75 |
Correct |
2 ms |
3412 KB |
Output is correct |
76 |
Correct |
2 ms |
3412 KB |
Output is correct |
77 |
Correct |
2 ms |
3540 KB |
Output is correct |
78 |
Correct |
2 ms |
3412 KB |
Output is correct |
79 |
Correct |
2 ms |
3412 KB |
Output is correct |
80 |
Correct |
4 ms |
3476 KB |
Output is correct |
81 |
Correct |
2 ms |
3444 KB |
Output is correct |
82 |
Correct |
2 ms |
3412 KB |
Output is correct |
83 |
Correct |
3 ms |
3540 KB |
Output is correct |
84 |
Correct |
3 ms |
3540 KB |
Output is correct |
85 |
Correct |
2 ms |
3412 KB |
Output is correct |
86 |
Correct |
2 ms |
3412 KB |
Output is correct |
87 |
Correct |
2 ms |
3540 KB |
Output is correct |
88 |
Correct |
1 ms |
3412 KB |
Output is correct |
89 |
Correct |
2 ms |
3540 KB |
Output is correct |
90 |
Correct |
2 ms |
3540 KB |
Output is correct |
91 |
Correct |
2 ms |
3412 KB |
Output is correct |
92 |
Correct |
2 ms |
3540 KB |
Output is correct |
93 |
Correct |
2 ms |
3412 KB |
Output is correct |
94 |
Correct |
2 ms |
3412 KB |
Output is correct |
95 |
Correct |
2 ms |
3412 KB |
Output is correct |
96 |
Correct |
3 ms |
3540 KB |
Output is correct |
97 |
Correct |
3 ms |
3540 KB |
Output is correct |
98 |
Correct |
4 ms |
3540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
58 ms |
13040 KB |
Output is correct |
2 |
Correct |
3 ms |
4948 KB |
Output is correct |
3 |
Correct |
24 ms |
8668 KB |
Output is correct |
4 |
Correct |
28 ms |
8732 KB |
Output is correct |
5 |
Correct |
77 ms |
12856 KB |
Output is correct |
6 |
Correct |
74 ms |
12884 KB |
Output is correct |
7 |
Correct |
70 ms |
12848 KB |
Output is correct |
8 |
Correct |
5 ms |
5332 KB |
Output is correct |
9 |
Correct |
4 ms |
4948 KB |
Output is correct |
10 |
Correct |
90 ms |
13096 KB |
Output is correct |
11 |
Correct |
61 ms |
12864 KB |
Output is correct |
12 |
Correct |
57 ms |
12896 KB |
Output is correct |
13 |
Correct |
3 ms |
4948 KB |
Output is correct |
14 |
Correct |
3 ms |
4948 KB |
Output is correct |
15 |
Incorrect |
75 ms |
12820 KB |
no wires in direction 1 between segments 1 and 1 |
16 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3412 KB |
Output is correct |
2 |
Correct |
1 ms |
3412 KB |
Output is correct |
3 |
Correct |
2 ms |
3412 KB |
Output is correct |
4 |
Correct |
2 ms |
3412 KB |
Output is correct |
5 |
Correct |
2 ms |
3412 KB |
Output is correct |
6 |
Correct |
2 ms |
3412 KB |
Output is correct |
7 |
Correct |
2 ms |
3412 KB |
Output is correct |
8 |
Correct |
2 ms |
3412 KB |
Output is correct |
9 |
Correct |
2 ms |
3412 KB |
Output is correct |
10 |
Correct |
3 ms |
3412 KB |
Output is correct |
11 |
Correct |
2 ms |
3412 KB |
Output is correct |
12 |
Correct |
2 ms |
3412 KB |
Output is correct |
13 |
Correct |
2 ms |
3412 KB |
Output is correct |
14 |
Correct |
2 ms |
3412 KB |
Output is correct |
15 |
Correct |
2 ms |
3412 KB |
Output is correct |
16 |
Correct |
2 ms |
3412 KB |
Output is correct |
17 |
Correct |
3 ms |
3412 KB |
Output is correct |
18 |
Correct |
2 ms |
3412 KB |
Output is correct |
19 |
Correct |
2 ms |
3412 KB |
Output is correct |
20 |
Correct |
2 ms |
3412 KB |
Output is correct |
21 |
Correct |
2 ms |
3412 KB |
Output is correct |
22 |
Correct |
2 ms |
3412 KB |
Output is correct |
23 |
Correct |
2 ms |
3412 KB |
Output is correct |
24 |
Correct |
2 ms |
3412 KB |
Output is correct |
25 |
Correct |
2 ms |
3412 KB |
Output is correct |
26 |
Correct |
2 ms |
3412 KB |
Output is correct |
27 |
Correct |
2 ms |
3412 KB |
Output is correct |
28 |
Correct |
2 ms |
3412 KB |
Output is correct |
29 |
Correct |
3 ms |
3412 KB |
Output is correct |
30 |
Correct |
2 ms |
3412 KB |
Output is correct |
31 |
Correct |
2 ms |
3412 KB |
Output is correct |
32 |
Correct |
3 ms |
3412 KB |
Output is correct |
33 |
Correct |
2 ms |
3412 KB |
Output is correct |
34 |
Correct |
2 ms |
3412 KB |
Output is correct |
35 |
Correct |
2 ms |
3412 KB |
Output is correct |
36 |
Correct |
2 ms |
3412 KB |
Output is correct |
37 |
Correct |
2 ms |
3412 KB |
Output is correct |
38 |
Correct |
2 ms |
3412 KB |
Output is correct |
39 |
Correct |
2 ms |
3412 KB |
Output is correct |
40 |
Correct |
2 ms |
3412 KB |
Output is correct |
41 |
Correct |
2 ms |
3412 KB |
Output is correct |
42 |
Correct |
2 ms |
3412 KB |
Output is correct |
43 |
Correct |
2 ms |
3412 KB |
Output is correct |
44 |
Correct |
3 ms |
3408 KB |
Output is correct |
45 |
Correct |
2 ms |
3412 KB |
Output is correct |
46 |
Correct |
1 ms |
3412 KB |
Output is correct |
47 |
Correct |
2 ms |
3412 KB |
Output is correct |
48 |
Correct |
2 ms |
3412 KB |
Output is correct |
49 |
Correct |
2 ms |
3412 KB |
Output is correct |
50 |
Correct |
2 ms |
3412 KB |
Output is correct |
51 |
Correct |
2 ms |
3412 KB |
Output is correct |
52 |
Correct |
3 ms |
3412 KB |
Output is correct |
53 |
Correct |
2 ms |
3448 KB |
Output is correct |
54 |
Correct |
2 ms |
3412 KB |
Output is correct |
55 |
Correct |
2 ms |
3412 KB |
Output is correct |
56 |
Correct |
3 ms |
3412 KB |
Output is correct |
57 |
Correct |
2 ms |
3412 KB |
Output is correct |
58 |
Correct |
2 ms |
3412 KB |
Output is correct |
59 |
Correct |
2 ms |
3412 KB |
Output is correct |
60 |
Correct |
2 ms |
3412 KB |
Output is correct |
61 |
Correct |
2 ms |
3412 KB |
Output is correct |
62 |
Correct |
2 ms |
3412 KB |
Output is correct |
63 |
Correct |
2 ms |
3412 KB |
Output is correct |
64 |
Correct |
2 ms |
3412 KB |
Output is correct |
65 |
Correct |
2 ms |
3412 KB |
Output is correct |
66 |
Correct |
2 ms |
3412 KB |
Output is correct |
67 |
Correct |
2 ms |
3412 KB |
Output is correct |
68 |
Correct |
2 ms |
3412 KB |
Output is correct |
69 |
Correct |
2 ms |
3412 KB |
Output is correct |
70 |
Correct |
2 ms |
3540 KB |
Output is correct |
71 |
Correct |
2 ms |
3540 KB |
Output is correct |
72 |
Correct |
2 ms |
3412 KB |
Output is correct |
73 |
Correct |
2 ms |
3412 KB |
Output is correct |
74 |
Correct |
2 ms |
3536 KB |
Output is correct |
75 |
Correct |
2 ms |
3412 KB |
Output is correct |
76 |
Correct |
2 ms |
3412 KB |
Output is correct |
77 |
Correct |
2 ms |
3540 KB |
Output is correct |
78 |
Correct |
2 ms |
3412 KB |
Output is correct |
79 |
Correct |
2 ms |
3412 KB |
Output is correct |
80 |
Correct |
4 ms |
3476 KB |
Output is correct |
81 |
Correct |
2 ms |
3444 KB |
Output is correct |
82 |
Correct |
2 ms |
3412 KB |
Output is correct |
83 |
Correct |
3 ms |
3540 KB |
Output is correct |
84 |
Correct |
3 ms |
3540 KB |
Output is correct |
85 |
Correct |
2 ms |
3412 KB |
Output is correct |
86 |
Correct |
2 ms |
3412 KB |
Output is correct |
87 |
Correct |
2 ms |
3540 KB |
Output is correct |
88 |
Correct |
1 ms |
3412 KB |
Output is correct |
89 |
Correct |
2 ms |
3540 KB |
Output is correct |
90 |
Correct |
2 ms |
3540 KB |
Output is correct |
91 |
Correct |
2 ms |
3412 KB |
Output is correct |
92 |
Correct |
2 ms |
3540 KB |
Output is correct |
93 |
Correct |
2 ms |
3412 KB |
Output is correct |
94 |
Correct |
2 ms |
3412 KB |
Output is correct |
95 |
Correct |
2 ms |
3412 KB |
Output is correct |
96 |
Correct |
3 ms |
3540 KB |
Output is correct |
97 |
Correct |
3 ms |
3540 KB |
Output is correct |
98 |
Correct |
4 ms |
3540 KB |
Output is correct |
99 |
Correct |
58 ms |
13040 KB |
Output is correct |
100 |
Correct |
3 ms |
4948 KB |
Output is correct |
101 |
Correct |
24 ms |
8668 KB |
Output is correct |
102 |
Correct |
28 ms |
8732 KB |
Output is correct |
103 |
Correct |
77 ms |
12856 KB |
Output is correct |
104 |
Correct |
74 ms |
12884 KB |
Output is correct |
105 |
Correct |
70 ms |
12848 KB |
Output is correct |
106 |
Correct |
5 ms |
5332 KB |
Output is correct |
107 |
Correct |
4 ms |
4948 KB |
Output is correct |
108 |
Correct |
90 ms |
13096 KB |
Output is correct |
109 |
Correct |
61 ms |
12864 KB |
Output is correct |
110 |
Correct |
57 ms |
12896 KB |
Output is correct |
111 |
Correct |
3 ms |
4948 KB |
Output is correct |
112 |
Correct |
3 ms |
4948 KB |
Output is correct |
113 |
Incorrect |
75 ms |
12820 KB |
no wires in direction 1 between segments 1 and 1 |
114 |
Halted |
0 ms |
0 KB |
- |