#include <iostream>
#include <algorithm>
#include <cstring>
#include <queue>
#include <cstdio>
#include <vector>
using namespace std;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define _ << " " <<
#define trace(x) cerr << #x << " " << x << endl
#define ll long long
const int N = 1e5 + 11;
int n, m, unutra[N];
pair <int, int> f1[N], f2[N];
pair <int, int> a1[N];
pair <pair <int, int> , pair <int,int> > izb[N];
vector <pair <pair <int, int>, int> > v;
int ak[N], sv[N], res[N], brojac = 0;
void ubaci1 (int x, int koliko, int ind) {
for (; x <= n; x+=x&-x) {
f1[x] = max(f1[x], mp(koliko, ind));
}
}
pair <int, int> upit1 (int x) {
pair <int, int> ret = mp(0, 0);
for (; x > 0; x-=x&-x) {
ret = max(ret, f1[x]);
}
return ret;
}
void ubaci2 (int x, int koliko, int ind) {
for (; x <= n; x+=x&-x) {
f2[x] = max(f2[x], mp(koliko, ind));
}
}
pair <int, int> upit2 (int x) {
pair <int, int> ret = mp(0, 0);
for (; x > 0; x-=x&-x) {
ret = max(ret, f2[x]);
}
return ret;
}
bool sijeku (int x, int y) {
int a = v[x].ff.ff, b = v[x].ff.ss;
int c = v[y].ff.ff, d = v[y].ff.ss;
if (a <= b && c <= d) {
if (c >= a && c <= b+1) return 1;
if (a >= c && a <= d+1) return 1;
if (a == 1 && d == n) return 1;
if (c == 1 && b == n) return 1;
}
if (a > b && c > d) {
return 1;
}
if (a > b) {
if (c <= b+1) return 1;
if (d >= a-1) return 1;
return 0;
}
if (b >= c-1) return 1;
if (a <= d+1) return 1;
return 0;
}
bool popl (int x, int y, int z) {
int poc = v[x].ff.ss, kraj = v[z].ff.ff;
if (!sijeku(x, y)) return 1;
if (!sijeku(y, z)) return 1;
if (v[y].ff.ff > v[y].ff.ss) {
if (v[x].ff.ff > v[x].ff.ss && poc >= kraj-1) return 0;
if (v[z].ff.ff > v[z].ff.ss && poc >= kraj-1) return 0;
if (v[z].ff.ff > v[z].ff.ss && v[x].ff.ff > v[x].ff.ss) return 0;
if (kraj == 1 && poc == n) return 0;
}
else if (poc >= kraj-1 && poc != n && kraj != 1) return 0;
if (v[y].ff.ff > v[y].ff.ss && v[x].ff.ff <= v[x].ff.ss && v[z].ff.ff <= v[z].ff.ss) {
if (ak[n] - ak[poc] == n-poc && ak[kraj-1] == kraj-1) return 0;
return 1;
}
if (kraj != 1 && poc != n) {
if (ak[kraj-1] - ak[poc] == kraj-1-poc) return 0;
return 1;
}
if (kraj == 1) {
if (ak[n] - ak[poc] == n-poc) return 0;
return 1;
}
if (poc == n) {
if (ak[kraj-1] == kraj-1) return 0;
}
return 1;
}
void tri (int x) {
int a = v[x].ff.ff, b = v[x].ff.ss;
if (a > b) {
if (ak[a-1]-ak[b] < a-1-b) return;
}
else {
if (ak[a-1] < a-1 || ak[n] - ak[b] < n-b) return;
}
for (int i=0;i<3;i++) {
if (i == x) res[v[i].ss] = 1;
else res[v[i].ss] = 0;
}
for (int i=0;i<m;i++) {
if (unutra[i] > 0) {
res[i] = !res[unutra[i]-1];
}
}
brojac++;
}
bool poplo (int x, int z, int q, int y) {
int a = v[x].ff.ff, b = v[x].ff.ss;
int c = v[y].ff.ff, d = v[y].ff.ss;
if (v[z].ff.ff > v[z].ff.ss || v[q].ff.ff > v[q].ff.ss || (v[z].ff.ss == n && v[q].ff.ff == 1)) {
if (a > b && c > d) return 1;
if (b == n && c == 1) return 1;
if (a > b) {
if (c <= b+1) return 1;
if (ak[c-1] - ak[b] == c-1-b) return 1;
return 0;
}
if (c > d) {
if (b >= c-1) return 1;
if (ak[c-1] - ak[b] == c-1-b) return 1;
return 0;
}
if (ak[n] - ak[b] == n-b && ak[c-1] == c-1) return 1;
return 0;
}
if (b == n) {
if (ak[c-1] == c-1) return 1;
return 0;
}
if (c == 1) {
if (ak[n] - ak[b] == n-b) return 1;
return 0;
}
if (b >= c-1) return 1;
if (ak[c-1]-ak[b] == c-1-b) return 1;
return 0;
}
int main() {
cin >> n >> m;
for (int i=0;i<m;i++) {
scanf("%d%d", &a1[i].ff, &a1[i].ss);
izb[i].ff.ff = a1[i].ss-a1[i].ff+1;
if (izb[i].ff.ff <= 0) izb[i].ff.ff = a1[i].ss+n-a1[i].ff+1;
izb[i].ff.ss = i;
izb[i].ss.ff = a1[i].ff;
izb[i].ss.ss = a1[i].ss;
}
sort (izb, izb + m);
for (int i=m-1;i>=0;i--) {
if (izb[i].ss.ff > izb[i].ss.ss) {
pair <int, int> sada = upit2(izb[i].ss.ff);
if (sada.ff >= izb[i].ss.ss) {
sv[1]++;
sv[izb[i].ss.ss+1]--;
sv[izb[i].ss.ff]++;
unutra[izb[i].ff.ss] = sada.ss+1;
}
else v.pb(mp(izb[i].ss, izb[i].ff.ss));
ubaci2(izb[i].ss.ff, izb[i].ss.ss, izb[i].ff.ss);
ubaci1(1, izb[i].ss.ss, izb[i].ff.ss);
ubaci1(izb[i].ss.ff, n, izb[i].ff.ss);
}
else {
pair <int, int> sada = upit1(izb[i].ss.ff);
if (sada.ff >= izb[i].ss.ss) {
sv[izb[i].ss.ff]++;
sv[izb[i].ss.ss+1]--;
unutra[izb[i].ff.ss] = sada.ss+1;
}
else v.pb(mp(izb[i].ss, izb[i].ff.ss));
ubaci1(izb[i].ss.ff, izb[i].ss.ss, izb[i].ff.ss);
}
}
for (int i=1;i<=n;i++) {
sv[i] += sv[i-1];
if (sv[i] > 0) ak[i]=1+ak[i-1];
else ak[i]=ak[i-1];
}
sort(v.begin(), v.end());
int br = 0;
int siz = v.size();
if (siz == 1) {
int a = v[0].ff.ff, b = v[0].ff.ss;
for (int i=1;i<=n;i++) {
if (sv[i] == 0) {
cout << "impossible";
return 0;
}
}
if ((a == 1 && b == n) || a == b+1) {
res[v[0].ss]=1;
for (int i=0;i<m;i++) printf("%d", res[i]);
return 0;
}
cout << "impossible";
return 0;
}
if (siz == 2) {
int a = v[0].ff.ff, b = v[0].ff.ss;
int c = v[1].ff.ff, d = v[1].ff.ss;
int dva[N];
memset(dva, 0, sizeof dva);
if (a <= b) {
for (int i=a;i<=b;i++) dva[i]++;
}
else {
for (int i=a;i<=n;i++) dva[i]++;
for (int i=1;i<=b;i++) dva[i]++;
}
if (c <= d) {
for (int i=c;i<=d;i++) dva[i]++;
}
else {
for (int i=c;i<=n;i++) dva[i]++;
for (int i=1;i<=d;i++) dva[i]++;
}
for (int i=1;i<=n;i++) {
if (dva[i] == 0) {
cout << "impossible";
return 0;
}
if (dva[i] == 1 && sv[i] < 1) {
cout << "impossible";
return 0;
}
}
for (int i=0;i<siz;i++) {
res[v[i].ss] = i%2;
}
for (int i=0;i<m;i++) {
if (unutra[i] > 0) {
res[i] = !res[unutra[i]-1];
}
}
for (int i=0;i<m;i++) printf("%d", res[i]);
return 0;
}
for (int i=1;i<siz-1;i++) {
if (popl(i-1, i, i+1)) br++;
}
if (popl(siz-1, 0, 1)) br++;
if (popl(siz-2, siz-1, 0)) br++;
if (br > 0) {
cout << "impossible";
return 0;
}
if (siz % 2 == 0) {
for (int i=0;i<siz;i++) {
res[v[i].ss] = i%2;
}
for (int i=0;i<m;i++) {
if (unutra[i] > 0) {
res[i] = !res[unutra[i]-1];
}
}
for (int i=0;i<m;i++) printf("%d", res[i]);
return 0;
}
if (siz == 3) {
tri(0);
tri(1);
tri(2);
if (brojac > 0) {
for (int i=0;i<m;i++) printf("%d", res[i]);
}
else cout << "impossible";
return 0;
}
for (int i=0;i<siz-3;i++) {
if (poplo(i, i+1, i+2, i+3)) {
res[v[i+1].ss] = 1;
res[v[i+2].ss] = 1;
for (int j=i;j>=0;j--) res[v[j].ss] = !res[v[j+1].ss];
for (int j=i+3;j<siz;j++) res[v[j].ss] = !res[v[j-1].ss];
for (int j=0;j<m;j++) {
if (unutra[j] > 0) {
res[j] = !res[unutra[j]-1];
}
}
for (int j=0;j<m;j++) printf("%d", res[j]);
return 0;
}
}
if (poplo(siz-3, siz-2, siz-1, 0)) {
for (int i=1;i<siz;i++) {
if (i == siz-1) res[v[i].ss] = res[v[i-1].ss];
else res[v[i].ss] = !res[v[i-1].ss];
}
}
else if (poplo(siz-2, siz-1, 0, 1)) {
for (int i=1;i<siz;i++) {
if (i == siz-1) res[v[i].ss] = 0;
else res[v[i].ss] = !res[v[i-1].ss];
}
}
else if (poplo(siz-1, 0, 1, 2)) {
for (int i=1;i<siz;i++) {
if (i == 1) res[v[i].ss] = 0;
else res[v[i].ss] = !res[v[i-1].ss];
}
}
else {
cout << "impossible";
return 0;
}
for (int i=0;i<m;i++) {
if (unutra[i] > 0) {
res[i] = !res[unutra[i]-1];
}
}
for (int i=0;i<m;i++) printf("%d", res[i]);
return 0;
}
Compilation message
alternating.cpp: In function 'int main()':
alternating.cpp:160:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", &a1[i].ff, &a1[i].ss);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
380 KB |
Output is correct |
5 |
Correct |
2 ms |
376 KB |
Output is correct |
6 |
Correct |
2 ms |
376 KB |
Output is correct |
7 |
Correct |
2 ms |
376 KB |
Output is correct |
8 |
Correct |
2 ms |
376 KB |
Output is correct |
9 |
Correct |
11 ms |
376 KB |
Output is correct |
10 |
Correct |
2 ms |
376 KB |
Output is correct |
11 |
Correct |
2 ms |
760 KB |
Output is correct |
12 |
Correct |
2 ms |
376 KB |
Output is correct |
13 |
Correct |
2 ms |
376 KB |
Output is correct |
14 |
Correct |
2 ms |
760 KB |
Output is correct |
15 |
Correct |
2 ms |
380 KB |
Output is correct |
16 |
Correct |
2 ms |
888 KB |
Output is correct |
17 |
Correct |
2 ms |
376 KB |
Output is correct |
18 |
Correct |
2 ms |
376 KB |
Output is correct |
19 |
Correct |
2 ms |
760 KB |
Output is correct |
20 |
Correct |
2 ms |
760 KB |
Output is correct |
21 |
Correct |
2 ms |
760 KB |
Output is correct |
22 |
Correct |
2 ms |
376 KB |
Output is correct |
23 |
Correct |
2 ms |
760 KB |
Output is correct |
24 |
Correct |
2 ms |
376 KB |
Output is correct |
25 |
Correct |
2 ms |
376 KB |
Output is correct |
26 |
Correct |
2 ms |
760 KB |
Output is correct |
27 |
Correct |
2 ms |
376 KB |
Output is correct |
28 |
Correct |
2 ms |
376 KB |
Output is correct |
29 |
Correct |
2 ms |
376 KB |
Output is correct |
30 |
Correct |
2 ms |
376 KB |
Output is correct |
31 |
Correct |
2 ms |
376 KB |
Output is correct |
32 |
Correct |
2 ms |
760 KB |
Output is correct |
33 |
Correct |
2 ms |
376 KB |
Output is correct |
34 |
Correct |
2 ms |
380 KB |
Output is correct |
35 |
Correct |
2 ms |
376 KB |
Output is correct |
36 |
Correct |
2 ms |
376 KB |
Output is correct |
37 |
Correct |
2 ms |
376 KB |
Output is correct |
38 |
Correct |
2 ms |
376 KB |
Output is correct |
39 |
Correct |
2 ms |
376 KB |
Output is correct |
40 |
Correct |
2 ms |
376 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
380 KB |
Output is correct |
5 |
Correct |
2 ms |
376 KB |
Output is correct |
6 |
Correct |
2 ms |
376 KB |
Output is correct |
7 |
Correct |
2 ms |
376 KB |
Output is correct |
8 |
Correct |
2 ms |
376 KB |
Output is correct |
9 |
Correct |
11 ms |
376 KB |
Output is correct |
10 |
Correct |
2 ms |
376 KB |
Output is correct |
11 |
Correct |
2 ms |
760 KB |
Output is correct |
12 |
Correct |
2 ms |
376 KB |
Output is correct |
13 |
Correct |
2 ms |
376 KB |
Output is correct |
14 |
Correct |
2 ms |
760 KB |
Output is correct |
15 |
Correct |
2 ms |
380 KB |
Output is correct |
16 |
Correct |
2 ms |
888 KB |
Output is correct |
17 |
Correct |
2 ms |
376 KB |
Output is correct |
18 |
Correct |
2 ms |
376 KB |
Output is correct |
19 |
Correct |
2 ms |
760 KB |
Output is correct |
20 |
Correct |
2 ms |
760 KB |
Output is correct |
21 |
Correct |
2 ms |
760 KB |
Output is correct |
22 |
Correct |
2 ms |
376 KB |
Output is correct |
23 |
Correct |
2 ms |
760 KB |
Output is correct |
24 |
Correct |
2 ms |
376 KB |
Output is correct |
25 |
Correct |
2 ms |
376 KB |
Output is correct |
26 |
Correct |
2 ms |
760 KB |
Output is correct |
27 |
Correct |
2 ms |
376 KB |
Output is correct |
28 |
Correct |
2 ms |
376 KB |
Output is correct |
29 |
Correct |
2 ms |
376 KB |
Output is correct |
30 |
Correct |
2 ms |
376 KB |
Output is correct |
31 |
Correct |
2 ms |
376 KB |
Output is correct |
32 |
Correct |
2 ms |
760 KB |
Output is correct |
33 |
Correct |
2 ms |
376 KB |
Output is correct |
34 |
Correct |
2 ms |
380 KB |
Output is correct |
35 |
Correct |
2 ms |
376 KB |
Output is correct |
36 |
Correct |
2 ms |
376 KB |
Output is correct |
37 |
Correct |
2 ms |
376 KB |
Output is correct |
38 |
Correct |
2 ms |
376 KB |
Output is correct |
39 |
Correct |
2 ms |
376 KB |
Output is correct |
40 |
Correct |
2 ms |
376 KB |
Output is correct |
41 |
Correct |
2 ms |
376 KB |
Output is correct |
42 |
Correct |
2 ms |
376 KB |
Output is correct |
43 |
Correct |
2 ms |
376 KB |
Output is correct |
44 |
Correct |
2 ms |
376 KB |
Output is correct |
45 |
Correct |
2 ms |
376 KB |
Output is correct |
46 |
Correct |
2 ms |
376 KB |
Output is correct |
47 |
Correct |
2 ms |
376 KB |
Output is correct |
48 |
Correct |
2 ms |
376 KB |
Output is correct |
49 |
Correct |
2 ms |
376 KB |
Output is correct |
50 |
Correct |
2 ms |
376 KB |
Output is correct |
51 |
Correct |
2 ms |
376 KB |
Output is correct |
52 |
Correct |
2 ms |
376 KB |
Output is correct |
53 |
Correct |
2 ms |
376 KB |
Output is correct |
54 |
Correct |
2 ms |
376 KB |
Output is correct |
55 |
Correct |
2 ms |
376 KB |
Output is correct |
56 |
Correct |
2 ms |
376 KB |
Output is correct |
57 |
Correct |
2 ms |
376 KB |
Output is correct |
58 |
Correct |
2 ms |
376 KB |
Output is correct |
59 |
Correct |
2 ms |
760 KB |
Output is correct |
60 |
Correct |
2 ms |
376 KB |
Output is correct |
61 |
Correct |
2 ms |
376 KB |
Output is correct |
62 |
Correct |
2 ms |
376 KB |
Output is correct |
63 |
Correct |
2 ms |
376 KB |
Output is correct |
64 |
Correct |
2 ms |
376 KB |
Output is correct |
65 |
Correct |
2 ms |
760 KB |
Output is correct |
66 |
Correct |
2 ms |
760 KB |
Output is correct |
67 |
Correct |
2 ms |
376 KB |
Output is correct |
68 |
Correct |
2 ms |
376 KB |
Output is correct |
69 |
Correct |
2 ms |
376 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
380 KB |
Output is correct |
5 |
Correct |
2 ms |
376 KB |
Output is correct |
6 |
Correct |
2 ms |
376 KB |
Output is correct |
7 |
Correct |
2 ms |
376 KB |
Output is correct |
8 |
Correct |
2 ms |
376 KB |
Output is correct |
9 |
Correct |
11 ms |
376 KB |
Output is correct |
10 |
Correct |
2 ms |
376 KB |
Output is correct |
11 |
Correct |
2 ms |
760 KB |
Output is correct |
12 |
Correct |
2 ms |
376 KB |
Output is correct |
13 |
Correct |
2 ms |
376 KB |
Output is correct |
14 |
Correct |
2 ms |
760 KB |
Output is correct |
15 |
Correct |
2 ms |
380 KB |
Output is correct |
16 |
Correct |
2 ms |
888 KB |
Output is correct |
17 |
Correct |
2 ms |
376 KB |
Output is correct |
18 |
Correct |
2 ms |
376 KB |
Output is correct |
19 |
Correct |
2 ms |
760 KB |
Output is correct |
20 |
Correct |
2 ms |
760 KB |
Output is correct |
21 |
Correct |
2 ms |
760 KB |
Output is correct |
22 |
Correct |
2 ms |
376 KB |
Output is correct |
23 |
Correct |
2 ms |
760 KB |
Output is correct |
24 |
Correct |
2 ms |
376 KB |
Output is correct |
25 |
Correct |
2 ms |
376 KB |
Output is correct |
26 |
Correct |
2 ms |
760 KB |
Output is correct |
27 |
Correct |
2 ms |
376 KB |
Output is correct |
28 |
Correct |
2 ms |
376 KB |
Output is correct |
29 |
Correct |
2 ms |
376 KB |
Output is correct |
30 |
Correct |
2 ms |
376 KB |
Output is correct |
31 |
Correct |
2 ms |
376 KB |
Output is correct |
32 |
Correct |
2 ms |
760 KB |
Output is correct |
33 |
Correct |
2 ms |
376 KB |
Output is correct |
34 |
Correct |
2 ms |
380 KB |
Output is correct |
35 |
Correct |
2 ms |
376 KB |
Output is correct |
36 |
Correct |
2 ms |
376 KB |
Output is correct |
37 |
Correct |
2 ms |
376 KB |
Output is correct |
38 |
Correct |
2 ms |
376 KB |
Output is correct |
39 |
Correct |
2 ms |
376 KB |
Output is correct |
40 |
Correct |
2 ms |
376 KB |
Output is correct |
41 |
Correct |
2 ms |
376 KB |
Output is correct |
42 |
Correct |
2 ms |
376 KB |
Output is correct |
43 |
Correct |
2 ms |
376 KB |
Output is correct |
44 |
Correct |
2 ms |
376 KB |
Output is correct |
45 |
Correct |
2 ms |
376 KB |
Output is correct |
46 |
Correct |
2 ms |
376 KB |
Output is correct |
47 |
Correct |
2 ms |
376 KB |
Output is correct |
48 |
Correct |
2 ms |
376 KB |
Output is correct |
49 |
Correct |
2 ms |
376 KB |
Output is correct |
50 |
Correct |
2 ms |
376 KB |
Output is correct |
51 |
Correct |
2 ms |
376 KB |
Output is correct |
52 |
Correct |
2 ms |
376 KB |
Output is correct |
53 |
Correct |
2 ms |
376 KB |
Output is correct |
54 |
Correct |
2 ms |
376 KB |
Output is correct |
55 |
Correct |
2 ms |
376 KB |
Output is correct |
56 |
Correct |
2 ms |
376 KB |
Output is correct |
57 |
Correct |
2 ms |
376 KB |
Output is correct |
58 |
Correct |
2 ms |
376 KB |
Output is correct |
59 |
Correct |
2 ms |
760 KB |
Output is correct |
60 |
Correct |
2 ms |
376 KB |
Output is correct |
61 |
Correct |
2 ms |
376 KB |
Output is correct |
62 |
Correct |
2 ms |
376 KB |
Output is correct |
63 |
Correct |
2 ms |
376 KB |
Output is correct |
64 |
Correct |
2 ms |
376 KB |
Output is correct |
65 |
Correct |
2 ms |
760 KB |
Output is correct |
66 |
Correct |
2 ms |
760 KB |
Output is correct |
67 |
Correct |
2 ms |
376 KB |
Output is correct |
68 |
Correct |
2 ms |
376 KB |
Output is correct |
69 |
Correct |
2 ms |
376 KB |
Output is correct |
70 |
Correct |
2 ms |
376 KB |
Output is correct |
71 |
Correct |
3 ms |
504 KB |
Output is correct |
72 |
Correct |
2 ms |
404 KB |
Output is correct |
73 |
Correct |
2 ms |
376 KB |
Output is correct |
74 |
Correct |
2 ms |
376 KB |
Output is correct |
75 |
Correct |
2 ms |
376 KB |
Output is correct |
76 |
Correct |
2 ms |
348 KB |
Output is correct |
77 |
Correct |
2 ms |
376 KB |
Output is correct |
78 |
Correct |
3 ms |
376 KB |
Output is correct |
79 |
Correct |
2 ms |
376 KB |
Output is correct |
80 |
Correct |
3 ms |
376 KB |
Output is correct |
81 |
Correct |
2 ms |
376 KB |
Output is correct |
82 |
Correct |
2 ms |
376 KB |
Output is correct |
83 |
Correct |
2 ms |
376 KB |
Output is correct |
84 |
Correct |
3 ms |
504 KB |
Output is correct |
85 |
Correct |
2 ms |
376 KB |
Output is correct |
86 |
Correct |
2 ms |
760 KB |
Output is correct |
87 |
Correct |
3 ms |
376 KB |
Output is correct |
88 |
Correct |
3 ms |
376 KB |
Output is correct |
89 |
Correct |
4 ms |
376 KB |
Output is correct |
90 |
Correct |
3 ms |
376 KB |
Output is correct |
91 |
Correct |
2 ms |
376 KB |
Output is correct |
92 |
Correct |
3 ms |
380 KB |
Output is correct |
93 |
Correct |
2 ms |
376 KB |
Output is correct |
94 |
Correct |
2 ms |
760 KB |
Output is correct |
95 |
Correct |
2 ms |
376 KB |
Output is correct |
96 |
Correct |
2 ms |
380 KB |
Output is correct |
97 |
Correct |
3 ms |
376 KB |
Output is correct |
98 |
Correct |
2 ms |
376 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
40 ms |
4916 KB |
Output is correct |
2 |
Correct |
3 ms |
1144 KB |
Output is correct |
3 |
Correct |
18 ms |
3448 KB |
Output is correct |
4 |
Correct |
21 ms |
3576 KB |
Output is correct |
5 |
Correct |
62 ms |
6736 KB |
Output is correct |
6 |
Correct |
56 ms |
6264 KB |
Output is correct |
7 |
Correct |
52 ms |
6076 KB |
Output is correct |
8 |
Correct |
5 ms |
2040 KB |
Output is correct |
9 |
Correct |
4 ms |
1912 KB |
Output is correct |
10 |
Correct |
64 ms |
6892 KB |
Output is correct |
11 |
Correct |
46 ms |
5616 KB |
Output is correct |
12 |
Correct |
48 ms |
5520 KB |
Output is correct |
13 |
Correct |
3 ms |
1272 KB |
Output is correct |
14 |
Correct |
4 ms |
1272 KB |
Output is correct |
15 |
Correct |
60 ms |
6648 KB |
Output is correct |
16 |
Correct |
21 ms |
4080 KB |
Output is correct |
17 |
Correct |
60 ms |
6264 KB |
Output is correct |
18 |
Correct |
52 ms |
4600 KB |
Output is correct |
19 |
Incorrect |
7 ms |
2168 KB |
no wires in direction 0 between segments 1 and 18 |
20 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
380 KB |
Output is correct |
5 |
Correct |
2 ms |
376 KB |
Output is correct |
6 |
Correct |
2 ms |
376 KB |
Output is correct |
7 |
Correct |
2 ms |
376 KB |
Output is correct |
8 |
Correct |
2 ms |
376 KB |
Output is correct |
9 |
Correct |
11 ms |
376 KB |
Output is correct |
10 |
Correct |
2 ms |
376 KB |
Output is correct |
11 |
Correct |
2 ms |
760 KB |
Output is correct |
12 |
Correct |
2 ms |
376 KB |
Output is correct |
13 |
Correct |
2 ms |
376 KB |
Output is correct |
14 |
Correct |
2 ms |
760 KB |
Output is correct |
15 |
Correct |
2 ms |
380 KB |
Output is correct |
16 |
Correct |
2 ms |
888 KB |
Output is correct |
17 |
Correct |
2 ms |
376 KB |
Output is correct |
18 |
Correct |
2 ms |
376 KB |
Output is correct |
19 |
Correct |
2 ms |
760 KB |
Output is correct |
20 |
Correct |
2 ms |
760 KB |
Output is correct |
21 |
Correct |
2 ms |
760 KB |
Output is correct |
22 |
Correct |
2 ms |
376 KB |
Output is correct |
23 |
Correct |
2 ms |
760 KB |
Output is correct |
24 |
Correct |
2 ms |
376 KB |
Output is correct |
25 |
Correct |
2 ms |
376 KB |
Output is correct |
26 |
Correct |
2 ms |
760 KB |
Output is correct |
27 |
Correct |
2 ms |
376 KB |
Output is correct |
28 |
Correct |
2 ms |
376 KB |
Output is correct |
29 |
Correct |
2 ms |
376 KB |
Output is correct |
30 |
Correct |
2 ms |
376 KB |
Output is correct |
31 |
Correct |
2 ms |
376 KB |
Output is correct |
32 |
Correct |
2 ms |
760 KB |
Output is correct |
33 |
Correct |
2 ms |
376 KB |
Output is correct |
34 |
Correct |
2 ms |
380 KB |
Output is correct |
35 |
Correct |
2 ms |
376 KB |
Output is correct |
36 |
Correct |
2 ms |
376 KB |
Output is correct |
37 |
Correct |
2 ms |
376 KB |
Output is correct |
38 |
Correct |
2 ms |
376 KB |
Output is correct |
39 |
Correct |
2 ms |
376 KB |
Output is correct |
40 |
Correct |
2 ms |
376 KB |
Output is correct |
41 |
Correct |
2 ms |
376 KB |
Output is correct |
42 |
Correct |
2 ms |
376 KB |
Output is correct |
43 |
Correct |
2 ms |
376 KB |
Output is correct |
44 |
Correct |
2 ms |
376 KB |
Output is correct |
45 |
Correct |
2 ms |
376 KB |
Output is correct |
46 |
Correct |
2 ms |
376 KB |
Output is correct |
47 |
Correct |
2 ms |
376 KB |
Output is correct |
48 |
Correct |
2 ms |
376 KB |
Output is correct |
49 |
Correct |
2 ms |
376 KB |
Output is correct |
50 |
Correct |
2 ms |
376 KB |
Output is correct |
51 |
Correct |
2 ms |
376 KB |
Output is correct |
52 |
Correct |
2 ms |
376 KB |
Output is correct |
53 |
Correct |
2 ms |
376 KB |
Output is correct |
54 |
Correct |
2 ms |
376 KB |
Output is correct |
55 |
Correct |
2 ms |
376 KB |
Output is correct |
56 |
Correct |
2 ms |
376 KB |
Output is correct |
57 |
Correct |
2 ms |
376 KB |
Output is correct |
58 |
Correct |
2 ms |
376 KB |
Output is correct |
59 |
Correct |
2 ms |
760 KB |
Output is correct |
60 |
Correct |
2 ms |
376 KB |
Output is correct |
61 |
Correct |
2 ms |
376 KB |
Output is correct |
62 |
Correct |
2 ms |
376 KB |
Output is correct |
63 |
Correct |
2 ms |
376 KB |
Output is correct |
64 |
Correct |
2 ms |
376 KB |
Output is correct |
65 |
Correct |
2 ms |
760 KB |
Output is correct |
66 |
Correct |
2 ms |
760 KB |
Output is correct |
67 |
Correct |
2 ms |
376 KB |
Output is correct |
68 |
Correct |
2 ms |
376 KB |
Output is correct |
69 |
Correct |
2 ms |
376 KB |
Output is correct |
70 |
Correct |
2 ms |
376 KB |
Output is correct |
71 |
Correct |
3 ms |
504 KB |
Output is correct |
72 |
Correct |
2 ms |
404 KB |
Output is correct |
73 |
Correct |
2 ms |
376 KB |
Output is correct |
74 |
Correct |
2 ms |
376 KB |
Output is correct |
75 |
Correct |
2 ms |
376 KB |
Output is correct |
76 |
Correct |
2 ms |
348 KB |
Output is correct |
77 |
Correct |
2 ms |
376 KB |
Output is correct |
78 |
Correct |
3 ms |
376 KB |
Output is correct |
79 |
Correct |
2 ms |
376 KB |
Output is correct |
80 |
Correct |
3 ms |
376 KB |
Output is correct |
81 |
Correct |
2 ms |
376 KB |
Output is correct |
82 |
Correct |
2 ms |
376 KB |
Output is correct |
83 |
Correct |
2 ms |
376 KB |
Output is correct |
84 |
Correct |
3 ms |
504 KB |
Output is correct |
85 |
Correct |
2 ms |
376 KB |
Output is correct |
86 |
Correct |
2 ms |
760 KB |
Output is correct |
87 |
Correct |
3 ms |
376 KB |
Output is correct |
88 |
Correct |
3 ms |
376 KB |
Output is correct |
89 |
Correct |
4 ms |
376 KB |
Output is correct |
90 |
Correct |
3 ms |
376 KB |
Output is correct |
91 |
Correct |
2 ms |
376 KB |
Output is correct |
92 |
Correct |
3 ms |
380 KB |
Output is correct |
93 |
Correct |
2 ms |
376 KB |
Output is correct |
94 |
Correct |
2 ms |
760 KB |
Output is correct |
95 |
Correct |
2 ms |
376 KB |
Output is correct |
96 |
Correct |
2 ms |
380 KB |
Output is correct |
97 |
Correct |
3 ms |
376 KB |
Output is correct |
98 |
Correct |
2 ms |
376 KB |
Output is correct |
99 |
Correct |
40 ms |
4916 KB |
Output is correct |
100 |
Correct |
3 ms |
1144 KB |
Output is correct |
101 |
Correct |
18 ms |
3448 KB |
Output is correct |
102 |
Correct |
21 ms |
3576 KB |
Output is correct |
103 |
Correct |
62 ms |
6736 KB |
Output is correct |
104 |
Correct |
56 ms |
6264 KB |
Output is correct |
105 |
Correct |
52 ms |
6076 KB |
Output is correct |
106 |
Correct |
5 ms |
2040 KB |
Output is correct |
107 |
Correct |
4 ms |
1912 KB |
Output is correct |
108 |
Correct |
64 ms |
6892 KB |
Output is correct |
109 |
Correct |
46 ms |
5616 KB |
Output is correct |
110 |
Correct |
48 ms |
5520 KB |
Output is correct |
111 |
Correct |
3 ms |
1272 KB |
Output is correct |
112 |
Correct |
4 ms |
1272 KB |
Output is correct |
113 |
Correct |
60 ms |
6648 KB |
Output is correct |
114 |
Correct |
21 ms |
4080 KB |
Output is correct |
115 |
Correct |
60 ms |
6264 KB |
Output is correct |
116 |
Correct |
52 ms |
4600 KB |
Output is correct |
117 |
Incorrect |
7 ms |
2168 KB |
no wires in direction 0 between segments 1 and 18 |
118 |
Halted |
0 ms |
0 KB |
- |