#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define all(x) x.begin(),x.end()
const int inf = 1e9+10;
const int maxn = 3e5+10;
const int maxd = 5e6;
int n, m, k;
int szrt[maxn], idrt[maxn], thrt[maxn], isrt[maxn], nxrt[maxn], pvrt[maxn], dlol[maxn];
int fqt1[maxn];
int cntwtf = 0;
vector<int> g[maxn], gdiffrt[maxn], d[maxn];
vector<pair<int,int>> withdist[maxd+1];
int32_t main() {
// freopen("in.in", "r", stdin);
cin >> n >> m;
for(int i = 1; i <= m; i++) {
int u,v; cin >> u >> v;
g[u].pb(v);
g[v].pb(u);
}
cin >> k;
for(int i = 1; i <= k; i++) {
cin >> szrt[i];
for(int j = 0; j < szrt[i]; j++) {
int v; cin >> v;
idrt[v] = i;
isrt[v] = 1;
thrt[v] = j;
}
}
szrt[0] = 1;
for(int i = 1; i <= n; i++) {
dlol[i] = inf;
if(isrt[i]) {
for(int j = 0; j < szrt[idrt[i]]; j++) {
d[i].pb(inf);
}
int u = i;
for(auto v : g[u]) {
if(isrt[v] && idrt[u] == idrt[v] && thrt[v] == (thrt[u]+1)%szrt[idrt[u]]) {
nxrt[u] = v;
}
if(isrt[v] && idrt[u] == idrt[v] && thrt[u] == (thrt[v]+1)%szrt[idrt[u]]) {
pvrt[u] = v;
}
if(isrt[v] && idrt[v] != idrt[u]) {
gdiffrt[u].pb(v);
}
}
}
else {
d[i].pb(inf);
}
}
d[1][0] = 0;
withdist[0].pb(mp(1,0));
for(int distcur = 0; distcur <= maxd; distcur++) {
while(withdist[distcur].size()) {
auto X = withdist[distcur].back();
withdist[distcur].pop_back();
int u = X.fr;
int t = X.sc;
if(t != -1 && distcur != d[u][t]) continue;
if(t == -1 && distcur != dlol[u]) continue;
if(t == -1) {
for(auto v : g[u]) {
if(isrt[v]) {
int d1 = dlol[u]+1;
int t1 = d1%szrt[idrt[v]];
// Vou encontrar o guarda em v ou indo para v
// indo para v == u é depois de v e em t1 ele vai estar em u
if(t1 == thrt[v] || (thrt[u] == (thrt[v]+1)%szrt[idrt[u]] && t1 == thrt[u]) && idrt[u] == idrt[v]) continue;
if(d[v][t1] > d1) {
d[v][t1] = d1;
withdist[d[v][t1]].pb(mp(v,t1));
}
// if(idrt[v] != idrt[u]) {
// set<int> stt1;
// d1 = dlol[u]+1;
// while(true) {
// int t1 = d1%szrt[idrt[v]];
// if(stt1.count(t1)) break;
// stt1.insert(t1);
// // Vou encontrar o guarda em v ou indo para v
// // indo para v == u é depois de v e em t1 ele vai estar em u
// if(d[v][t1] > d1 && t1 != thrt[v]) {
// d[v][t1] = d1;
// withdist[d[v][t1]].pb(mp(v,t1));
// }
// d1+= szrt[idrt[u]];
// }
// }
}
else {
int d1 = dlol[u]+1;
int t1 = 0;
if(d[v][t1] > d1) {
d[v][t1] = d1;
withdist[d[v][t1]].pb(mp(v,t1));
}
}
}
continue;
}
if(isrt[u]) {
int v,d1,t1;
v = nxrt[u];
d1 = d[u][t]+1;
t1 = d1%szrt[idrt[v]];
// Vou encontrar o guarda em v ou indo para v
// indo para v == u é depois de v e em t1 ele vai estar em u
if(!(t1 == thrt[v] || (thrt[u] == (thrt[v]+1)%szrt[idrt[u]] && t1 == thrt[u] && idrt[u] == idrt[v])) && d[v][t1] > d1) {
d[v][t1] = d1;
withdist[d[v][t1]].pb(mp(v,t1));
}
v = pvrt[u];
d1 = d[u][t]+1;
t1 = d1%szrt[idrt[v]];
// Vou encontrar o guarda em v ou indo para v
// indo para v == u é depois de v e em t1 ele vai estar em u
if(!(t1 == thrt[v] || (thrt[u] == (thrt[v]+1)%szrt[idrt[u]] && t1 == thrt[u] && idrt[u] == idrt[v])) && d[v][t1] > d1) {
d[v][t1] = d1;
withdist[d[v][t1]].pb(mp(v,t1));
}
if(dlol[u] > d[u][t]) {
dlol[u] = d[u][t];
withdist[dlol[u]].pb(mp(u,-1));
}
v = u;
d1 = d[u][t]+1;
t1 = d1%szrt[idrt[v]];
if(!(t1 == thrt[v]) && d[v][t1] > d1) {
d[v][t1] = d1;
withdist[d[v][t1]].pb(mp(v,t1));
}
for(auto v : gdiffrt[u]) {
set<int> stt1;
d1 = d[u][t]+1;
++cntwtf;
while(true) {
int t1 = d1%szrt[idrt[v]];
// if(stt1.count(t1)) break;
// stt1.insert(t1);
if(fqt1[t1] == cntwtf) break;
fqt1[t1] = cntwtf;
// Vou encontrar o guarda em v ou indo para v
// indo para v == u é depois de v e em t1 ele vai estar em u
if(d[v][t1] > d1 && t1 != thrt[v]) {
d[v][t1] = d1;
withdist[d[v][t1]].pb(mp(v,t1));
}
d1+= szrt[idrt[u]];
}
}
}
else {
for(auto v : g[u]) {
if(isrt[v]) {
// d[u][t]+1+i = (thrt[v]+1) MOD
// i = trrt[v]-d[u][t] MOD
int i = ((thrt[v]-d[u][t])%szrt[idrt[v]]+szrt[idrt[v]])%szrt[idrt[v]];
int d1 = d[u][t]+1+i;
int t1 = d1%szrt[idrt[v]];
if(t1 == thrt[v]) continue;
if(d[v][t1] > d1) {
d[v][t1] = d1;
withdist[d[v][t1]].pb(mp(v,t1));
}
d1 = d[u][t]+1;
t1 = d1%szrt[idrt[v]];
if(t1 == thrt[v]) continue;
if(d[v][t1] > d1) {
d[v][t1] = d1;
withdist[d[v][t1]].pb(mp(v,t1));
}
}
else {
int d1 = d[u][t]+1;
int t1 = 0;
if(d[v][t1] > d1) {
d[v][t1] = d1;
withdist[d[v][t1]].pb(mp(v,t1));
}
}
}
}
}
}
if(d[n][0] == inf) cout << "impossible" << endl;
else cout << d[n][0] << endl;
}
Compilation message
watchmen.cpp: In function 'int32_t main()':
watchmen.cpp:87:97: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
87 | if(t1 == thrt[v] || (thrt[u] == (thrt[v]+1)%szrt[idrt[u]] && t1 == thrt[u]) && idrt[u] == idrt[v]) continue;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
129 ms |
140564 KB |
Output is correct |
2 |
Correct |
210 ms |
151272 KB |
Output is correct |
3 |
Correct |
211 ms |
149860 KB |
Output is correct |
4 |
Correct |
181 ms |
149472 KB |
Output is correct |
5 |
Correct |
87 ms |
139216 KB |
Output is correct |
6 |
Correct |
197 ms |
149588 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
120 ms |
140548 KB |
Output is correct |
2 |
Correct |
205 ms |
151188 KB |
Output is correct |
3 |
Correct |
197 ms |
149812 KB |
Output is correct |
4 |
Correct |
219 ms |
149544 KB |
Output is correct |
5 |
Correct |
84 ms |
139096 KB |
Output is correct |
6 |
Correct |
183 ms |
149648 KB |
Output is correct |
7 |
Correct |
211 ms |
149836 KB |
Output is correct |
8 |
Correct |
173 ms |
149928 KB |
Output is correct |
9 |
Correct |
199 ms |
150208 KB |
Output is correct |
10 |
Correct |
187 ms |
148864 KB |
Output is correct |
11 |
Correct |
167 ms |
148476 KB |
Output is correct |
12 |
Correct |
174 ms |
149436 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
120 ms |
140548 KB |
Output is correct |
2 |
Correct |
205 ms |
151188 KB |
Output is correct |
3 |
Correct |
197 ms |
149812 KB |
Output is correct |
4 |
Correct |
219 ms |
149544 KB |
Output is correct |
5 |
Correct |
84 ms |
139096 KB |
Output is correct |
6 |
Correct |
183 ms |
149648 KB |
Output is correct |
7 |
Correct |
211 ms |
149836 KB |
Output is correct |
8 |
Correct |
173 ms |
149928 KB |
Output is correct |
9 |
Correct |
199 ms |
150208 KB |
Output is correct |
10 |
Correct |
187 ms |
148864 KB |
Output is correct |
11 |
Correct |
167 ms |
148476 KB |
Output is correct |
12 |
Correct |
174 ms |
149436 KB |
Output is correct |
13 |
Correct |
118 ms |
140552 KB |
Output is correct |
14 |
Correct |
190 ms |
151276 KB |
Output is correct |
15 |
Correct |
214 ms |
149816 KB |
Output is correct |
16 |
Correct |
203 ms |
149584 KB |
Output is correct |
17 |
Correct |
87 ms |
139140 KB |
Output is correct |
18 |
Correct |
184 ms |
149648 KB |
Output is correct |
19 |
Correct |
197 ms |
149896 KB |
Output is correct |
20 |
Correct |
205 ms |
149996 KB |
Output is correct |
21 |
Correct |
188 ms |
150168 KB |
Output is correct |
22 |
Correct |
216 ms |
148944 KB |
Output is correct |
23 |
Correct |
178 ms |
148424 KB |
Output is correct |
24 |
Correct |
170 ms |
149516 KB |
Output is correct |
25 |
Correct |
2857 ms |
199180 KB |
Output is correct |
26 |
Correct |
2849 ms |
203976 KB |
Output is correct |
27 |
Correct |
2919 ms |
199520 KB |
Output is correct |
28 |
Correct |
2684 ms |
203276 KB |
Output is correct |
29 |
Correct |
2759 ms |
189872 KB |
Output is correct |
30 |
Correct |
2557 ms |
192616 KB |
Output is correct |
31 |
Correct |
3049 ms |
201132 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
120 ms |
140548 KB |
Output is correct |
2 |
Correct |
205 ms |
151188 KB |
Output is correct |
3 |
Correct |
197 ms |
149812 KB |
Output is correct |
4 |
Correct |
219 ms |
149544 KB |
Output is correct |
5 |
Correct |
84 ms |
139096 KB |
Output is correct |
6 |
Correct |
183 ms |
149648 KB |
Output is correct |
7 |
Correct |
211 ms |
149836 KB |
Output is correct |
8 |
Correct |
173 ms |
149928 KB |
Output is correct |
9 |
Correct |
199 ms |
150208 KB |
Output is correct |
10 |
Correct |
187 ms |
148864 KB |
Output is correct |
11 |
Correct |
167 ms |
148476 KB |
Output is correct |
12 |
Correct |
174 ms |
149436 KB |
Output is correct |
13 |
Correct |
118 ms |
140552 KB |
Output is correct |
14 |
Correct |
190 ms |
151276 KB |
Output is correct |
15 |
Correct |
214 ms |
149816 KB |
Output is correct |
16 |
Correct |
203 ms |
149584 KB |
Output is correct |
17 |
Correct |
87 ms |
139140 KB |
Output is correct |
18 |
Correct |
184 ms |
149648 KB |
Output is correct |
19 |
Correct |
197 ms |
149896 KB |
Output is correct |
20 |
Correct |
205 ms |
149996 KB |
Output is correct |
21 |
Correct |
188 ms |
150168 KB |
Output is correct |
22 |
Correct |
216 ms |
148944 KB |
Output is correct |
23 |
Correct |
178 ms |
148424 KB |
Output is correct |
24 |
Correct |
170 ms |
149516 KB |
Output is correct |
25 |
Correct |
2857 ms |
199180 KB |
Output is correct |
26 |
Correct |
2849 ms |
203976 KB |
Output is correct |
27 |
Correct |
2919 ms |
199520 KB |
Output is correct |
28 |
Correct |
2684 ms |
203276 KB |
Output is correct |
29 |
Correct |
2759 ms |
189872 KB |
Output is correct |
30 |
Correct |
2557 ms |
192616 KB |
Output is correct |
31 |
Correct |
3049 ms |
201132 KB |
Output is correct |
32 |
Correct |
116 ms |
140048 KB |
Output is correct |
33 |
Correct |
241 ms |
150276 KB |
Output is correct |
34 |
Correct |
211 ms |
148844 KB |
Output is correct |
35 |
Correct |
199 ms |
148540 KB |
Output is correct |
36 |
Correct |
101 ms |
139212 KB |
Output is correct |
37 |
Correct |
223 ms |
148624 KB |
Output is correct |
38 |
Correct |
189 ms |
148800 KB |
Output is correct |
39 |
Correct |
191 ms |
148916 KB |
Output is correct |
40 |
Correct |
200 ms |
149144 KB |
Output is correct |
41 |
Correct |
200 ms |
148008 KB |
Output is correct |
42 |
Correct |
192 ms |
147428 KB |
Output is correct |
43 |
Correct |
192 ms |
148440 KB |
Output is correct |
44 |
Correct |
3033 ms |
196500 KB |
Output is correct |
45 |
Correct |
2799 ms |
202892 KB |
Output is correct |
46 |
Correct |
2657 ms |
198336 KB |
Output is correct |
47 |
Correct |
2437 ms |
203092 KB |
Output is correct |
48 |
Correct |
2814 ms |
189424 KB |
Output is correct |
49 |
Correct |
2765 ms |
192460 KB |
Output is correct |
50 |
Correct |
2999 ms |
201152 KB |
Output is correct |
51 |
Correct |
3289 ms |
233656 KB |
Output is correct |
52 |
Correct |
3085 ms |
266056 KB |
Output is correct |
53 |
Correct |
3016 ms |
233872 KB |
Output is correct |
54 |
Correct |
2338 ms |
199096 KB |
Output is correct |
55 |
Correct |
2983 ms |
231924 KB |
Output is correct |
56 |
Correct |
3135 ms |
212708 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
129 ms |
140564 KB |
Output is correct |
2 |
Correct |
210 ms |
151272 KB |
Output is correct |
3 |
Correct |
211 ms |
149860 KB |
Output is correct |
4 |
Correct |
181 ms |
149472 KB |
Output is correct |
5 |
Correct |
87 ms |
139216 KB |
Output is correct |
6 |
Correct |
197 ms |
149588 KB |
Output is correct |
7 |
Correct |
120 ms |
140548 KB |
Output is correct |
8 |
Correct |
205 ms |
151188 KB |
Output is correct |
9 |
Correct |
197 ms |
149812 KB |
Output is correct |
10 |
Correct |
219 ms |
149544 KB |
Output is correct |
11 |
Correct |
84 ms |
139096 KB |
Output is correct |
12 |
Correct |
183 ms |
149648 KB |
Output is correct |
13 |
Correct |
211 ms |
149836 KB |
Output is correct |
14 |
Correct |
173 ms |
149928 KB |
Output is correct |
15 |
Correct |
199 ms |
150208 KB |
Output is correct |
16 |
Correct |
187 ms |
148864 KB |
Output is correct |
17 |
Correct |
167 ms |
148476 KB |
Output is correct |
18 |
Correct |
174 ms |
149436 KB |
Output is correct |
19 |
Correct |
81 ms |
138884 KB |
Output is correct |
20 |
Correct |
90 ms |
138788 KB |
Output is correct |
21 |
Correct |
101 ms |
138956 KB |
Output is correct |
22 |
Correct |
124 ms |
139884 KB |
Output is correct |
23 |
Correct |
193 ms |
150144 KB |
Output is correct |
24 |
Correct |
192 ms |
148620 KB |
Output is correct |
25 |
Correct |
230 ms |
148372 KB |
Output is correct |
26 |
Correct |
91 ms |
139208 KB |
Output is correct |
27 |
Correct |
179 ms |
148496 KB |
Output is correct |
28 |
Correct |
217 ms |
148740 KB |
Output is correct |
29 |
Correct |
239 ms |
148844 KB |
Output is correct |
30 |
Correct |
186 ms |
149044 KB |
Output is correct |
31 |
Correct |
216 ms |
147776 KB |
Output is correct |
32 |
Correct |
221 ms |
147224 KB |
Output is correct |
33 |
Correct |
184 ms |
148388 KB |
Output is correct |
34 |
Correct |
3075 ms |
193548 KB |
Output is correct |
35 |
Correct |
2904 ms |
188436 KB |
Output is correct |
36 |
Correct |
3091 ms |
190656 KB |
Output is correct |
37 |
Correct |
2640 ms |
196112 KB |
Output is correct |
38 |
Correct |
2949 ms |
194988 KB |
Output is correct |
39 |
Correct |
2612 ms |
190692 KB |
Output is correct |
40 |
Correct |
2967 ms |
192836 KB |
Output is correct |
41 |
Correct |
2652 ms |
193540 KB |
Output is correct |
42 |
Correct |
2823 ms |
199384 KB |
Output is correct |
43 |
Correct |
2824 ms |
200012 KB |
Output is correct |
44 |
Correct |
2936 ms |
201808 KB |
Output is correct |
45 |
Correct |
3070 ms |
194512 KB |
Output is correct |
46 |
Correct |
3078 ms |
196864 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
129 ms |
140564 KB |
Output is correct |
2 |
Correct |
210 ms |
151272 KB |
Output is correct |
3 |
Correct |
211 ms |
149860 KB |
Output is correct |
4 |
Correct |
181 ms |
149472 KB |
Output is correct |
5 |
Correct |
87 ms |
139216 KB |
Output is correct |
6 |
Correct |
197 ms |
149588 KB |
Output is correct |
7 |
Correct |
120 ms |
140548 KB |
Output is correct |
8 |
Correct |
205 ms |
151188 KB |
Output is correct |
9 |
Correct |
197 ms |
149812 KB |
Output is correct |
10 |
Correct |
219 ms |
149544 KB |
Output is correct |
11 |
Correct |
84 ms |
139096 KB |
Output is correct |
12 |
Correct |
183 ms |
149648 KB |
Output is correct |
13 |
Correct |
211 ms |
149836 KB |
Output is correct |
14 |
Correct |
173 ms |
149928 KB |
Output is correct |
15 |
Correct |
199 ms |
150208 KB |
Output is correct |
16 |
Correct |
187 ms |
148864 KB |
Output is correct |
17 |
Correct |
167 ms |
148476 KB |
Output is correct |
18 |
Correct |
174 ms |
149436 KB |
Output is correct |
19 |
Correct |
118 ms |
140552 KB |
Output is correct |
20 |
Correct |
190 ms |
151276 KB |
Output is correct |
21 |
Correct |
214 ms |
149816 KB |
Output is correct |
22 |
Correct |
203 ms |
149584 KB |
Output is correct |
23 |
Correct |
87 ms |
139140 KB |
Output is correct |
24 |
Correct |
184 ms |
149648 KB |
Output is correct |
25 |
Correct |
197 ms |
149896 KB |
Output is correct |
26 |
Correct |
205 ms |
149996 KB |
Output is correct |
27 |
Correct |
188 ms |
150168 KB |
Output is correct |
28 |
Correct |
216 ms |
148944 KB |
Output is correct |
29 |
Correct |
178 ms |
148424 KB |
Output is correct |
30 |
Correct |
170 ms |
149516 KB |
Output is correct |
31 |
Correct |
2857 ms |
199180 KB |
Output is correct |
32 |
Correct |
2849 ms |
203976 KB |
Output is correct |
33 |
Correct |
2919 ms |
199520 KB |
Output is correct |
34 |
Correct |
2684 ms |
203276 KB |
Output is correct |
35 |
Correct |
2759 ms |
189872 KB |
Output is correct |
36 |
Correct |
2557 ms |
192616 KB |
Output is correct |
37 |
Correct |
3049 ms |
201132 KB |
Output is correct |
38 |
Correct |
81 ms |
138884 KB |
Output is correct |
39 |
Correct |
90 ms |
138788 KB |
Output is correct |
40 |
Correct |
101 ms |
138956 KB |
Output is correct |
41 |
Correct |
124 ms |
139884 KB |
Output is correct |
42 |
Correct |
193 ms |
150144 KB |
Output is correct |
43 |
Correct |
192 ms |
148620 KB |
Output is correct |
44 |
Correct |
230 ms |
148372 KB |
Output is correct |
45 |
Correct |
91 ms |
139208 KB |
Output is correct |
46 |
Correct |
179 ms |
148496 KB |
Output is correct |
47 |
Correct |
217 ms |
148740 KB |
Output is correct |
48 |
Correct |
239 ms |
148844 KB |
Output is correct |
49 |
Correct |
186 ms |
149044 KB |
Output is correct |
50 |
Correct |
216 ms |
147776 KB |
Output is correct |
51 |
Correct |
221 ms |
147224 KB |
Output is correct |
52 |
Correct |
184 ms |
148388 KB |
Output is correct |
53 |
Correct |
3075 ms |
193548 KB |
Output is correct |
54 |
Correct |
2904 ms |
188436 KB |
Output is correct |
55 |
Correct |
3091 ms |
190656 KB |
Output is correct |
56 |
Correct |
2640 ms |
196112 KB |
Output is correct |
57 |
Correct |
2949 ms |
194988 KB |
Output is correct |
58 |
Correct |
2612 ms |
190692 KB |
Output is correct |
59 |
Correct |
2967 ms |
192836 KB |
Output is correct |
60 |
Correct |
2652 ms |
193540 KB |
Output is correct |
61 |
Correct |
2823 ms |
199384 KB |
Output is correct |
62 |
Correct |
2824 ms |
200012 KB |
Output is correct |
63 |
Correct |
2936 ms |
201808 KB |
Output is correct |
64 |
Correct |
3070 ms |
194512 KB |
Output is correct |
65 |
Correct |
3078 ms |
196864 KB |
Output is correct |
66 |
Correct |
94 ms |
138788 KB |
Output is correct |
67 |
Correct |
97 ms |
138888 KB |
Output is correct |
68 |
Correct |
97 ms |
138852 KB |
Output is correct |
69 |
Correct |
124 ms |
139964 KB |
Output is correct |
70 |
Correct |
196 ms |
150448 KB |
Output is correct |
71 |
Correct |
199 ms |
148664 KB |
Output is correct |
72 |
Correct |
214 ms |
148444 KB |
Output is correct |
73 |
Correct |
95 ms |
138996 KB |
Output is correct |
74 |
Correct |
195 ms |
149532 KB |
Output is correct |
75 |
Correct |
195 ms |
148872 KB |
Output is correct |
76 |
Correct |
200 ms |
148940 KB |
Output is correct |
77 |
Correct |
199 ms |
150012 KB |
Output is correct |
78 |
Correct |
191 ms |
147808 KB |
Output is correct |
79 |
Correct |
181 ms |
148044 KB |
Output is correct |
80 |
Correct |
194 ms |
148340 KB |
Output is correct |
81 |
Correct |
2876 ms |
196708 KB |
Output is correct |
82 |
Correct |
2777 ms |
202744 KB |
Output is correct |
83 |
Correct |
2628 ms |
199844 KB |
Output is correct |
84 |
Correct |
2539 ms |
204952 KB |
Output is correct |
85 |
Correct |
2644 ms |
196084 KB |
Output is correct |
86 |
Correct |
2874 ms |
197848 KB |
Output is correct |
87 |
Correct |
3289 ms |
201956 KB |
Output is correct |
88 |
Correct |
3242 ms |
194128 KB |
Output is correct |
89 |
Correct |
3323 ms |
188308 KB |
Output is correct |
90 |
Correct |
3297 ms |
195672 KB |
Output is correct |
91 |
Correct |
2734 ms |
197952 KB |
Output is correct |
92 |
Correct |
3191 ms |
197180 KB |
Output is correct |
93 |
Correct |
2703 ms |
198552 KB |
Output is correct |
94 |
Correct |
2954 ms |
193640 KB |
Output is correct |
95 |
Correct |
2925 ms |
196940 KB |
Output is correct |
96 |
Correct |
3016 ms |
200460 KB |
Output is correct |
97 |
Correct |
3208 ms |
204060 KB |
Output is correct |
98 |
Correct |
3190 ms |
198356 KB |
Output is correct |
99 |
Correct |
3185 ms |
194520 KB |
Output is correct |
100 |
Correct |
3046 ms |
195272 KB |
Output is correct |
101 |
Correct |
3331 ms |
195540 KB |
Output is correct |
102 |
Correct |
2861 ms |
198068 KB |
Output is correct |
103 |
Correct |
2866 ms |
197628 KB |
Output is correct |
104 |
Execution timed out |
6069 ms |
196500 KB |
Time limit exceeded |
105 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
129 ms |
140564 KB |
Output is correct |
2 |
Correct |
210 ms |
151272 KB |
Output is correct |
3 |
Correct |
211 ms |
149860 KB |
Output is correct |
4 |
Correct |
181 ms |
149472 KB |
Output is correct |
5 |
Correct |
87 ms |
139216 KB |
Output is correct |
6 |
Correct |
197 ms |
149588 KB |
Output is correct |
7 |
Correct |
120 ms |
140548 KB |
Output is correct |
8 |
Correct |
205 ms |
151188 KB |
Output is correct |
9 |
Correct |
197 ms |
149812 KB |
Output is correct |
10 |
Correct |
219 ms |
149544 KB |
Output is correct |
11 |
Correct |
84 ms |
139096 KB |
Output is correct |
12 |
Correct |
183 ms |
149648 KB |
Output is correct |
13 |
Correct |
211 ms |
149836 KB |
Output is correct |
14 |
Correct |
173 ms |
149928 KB |
Output is correct |
15 |
Correct |
199 ms |
150208 KB |
Output is correct |
16 |
Correct |
187 ms |
148864 KB |
Output is correct |
17 |
Correct |
167 ms |
148476 KB |
Output is correct |
18 |
Correct |
174 ms |
149436 KB |
Output is correct |
19 |
Correct |
118 ms |
140552 KB |
Output is correct |
20 |
Correct |
190 ms |
151276 KB |
Output is correct |
21 |
Correct |
214 ms |
149816 KB |
Output is correct |
22 |
Correct |
203 ms |
149584 KB |
Output is correct |
23 |
Correct |
87 ms |
139140 KB |
Output is correct |
24 |
Correct |
184 ms |
149648 KB |
Output is correct |
25 |
Correct |
197 ms |
149896 KB |
Output is correct |
26 |
Correct |
205 ms |
149996 KB |
Output is correct |
27 |
Correct |
188 ms |
150168 KB |
Output is correct |
28 |
Correct |
216 ms |
148944 KB |
Output is correct |
29 |
Correct |
178 ms |
148424 KB |
Output is correct |
30 |
Correct |
170 ms |
149516 KB |
Output is correct |
31 |
Correct |
2857 ms |
199180 KB |
Output is correct |
32 |
Correct |
2849 ms |
203976 KB |
Output is correct |
33 |
Correct |
2919 ms |
199520 KB |
Output is correct |
34 |
Correct |
2684 ms |
203276 KB |
Output is correct |
35 |
Correct |
2759 ms |
189872 KB |
Output is correct |
36 |
Correct |
2557 ms |
192616 KB |
Output is correct |
37 |
Correct |
3049 ms |
201132 KB |
Output is correct |
38 |
Correct |
116 ms |
140048 KB |
Output is correct |
39 |
Correct |
241 ms |
150276 KB |
Output is correct |
40 |
Correct |
211 ms |
148844 KB |
Output is correct |
41 |
Correct |
199 ms |
148540 KB |
Output is correct |
42 |
Correct |
101 ms |
139212 KB |
Output is correct |
43 |
Correct |
223 ms |
148624 KB |
Output is correct |
44 |
Correct |
189 ms |
148800 KB |
Output is correct |
45 |
Correct |
191 ms |
148916 KB |
Output is correct |
46 |
Correct |
200 ms |
149144 KB |
Output is correct |
47 |
Correct |
200 ms |
148008 KB |
Output is correct |
48 |
Correct |
192 ms |
147428 KB |
Output is correct |
49 |
Correct |
192 ms |
148440 KB |
Output is correct |
50 |
Correct |
3033 ms |
196500 KB |
Output is correct |
51 |
Correct |
2799 ms |
202892 KB |
Output is correct |
52 |
Correct |
2657 ms |
198336 KB |
Output is correct |
53 |
Correct |
2437 ms |
203092 KB |
Output is correct |
54 |
Correct |
2814 ms |
189424 KB |
Output is correct |
55 |
Correct |
2765 ms |
192460 KB |
Output is correct |
56 |
Correct |
2999 ms |
201152 KB |
Output is correct |
57 |
Correct |
3289 ms |
233656 KB |
Output is correct |
58 |
Correct |
3085 ms |
266056 KB |
Output is correct |
59 |
Correct |
3016 ms |
233872 KB |
Output is correct |
60 |
Correct |
2338 ms |
199096 KB |
Output is correct |
61 |
Correct |
2983 ms |
231924 KB |
Output is correct |
62 |
Correct |
3135 ms |
212708 KB |
Output is correct |
63 |
Correct |
81 ms |
138884 KB |
Output is correct |
64 |
Correct |
90 ms |
138788 KB |
Output is correct |
65 |
Correct |
101 ms |
138956 KB |
Output is correct |
66 |
Correct |
124 ms |
139884 KB |
Output is correct |
67 |
Correct |
193 ms |
150144 KB |
Output is correct |
68 |
Correct |
192 ms |
148620 KB |
Output is correct |
69 |
Correct |
230 ms |
148372 KB |
Output is correct |
70 |
Correct |
91 ms |
139208 KB |
Output is correct |
71 |
Correct |
179 ms |
148496 KB |
Output is correct |
72 |
Correct |
217 ms |
148740 KB |
Output is correct |
73 |
Correct |
239 ms |
148844 KB |
Output is correct |
74 |
Correct |
186 ms |
149044 KB |
Output is correct |
75 |
Correct |
216 ms |
147776 KB |
Output is correct |
76 |
Correct |
221 ms |
147224 KB |
Output is correct |
77 |
Correct |
184 ms |
148388 KB |
Output is correct |
78 |
Correct |
3075 ms |
193548 KB |
Output is correct |
79 |
Correct |
2904 ms |
188436 KB |
Output is correct |
80 |
Correct |
3091 ms |
190656 KB |
Output is correct |
81 |
Correct |
2640 ms |
196112 KB |
Output is correct |
82 |
Correct |
2949 ms |
194988 KB |
Output is correct |
83 |
Correct |
2612 ms |
190692 KB |
Output is correct |
84 |
Correct |
2967 ms |
192836 KB |
Output is correct |
85 |
Correct |
2652 ms |
193540 KB |
Output is correct |
86 |
Correct |
2823 ms |
199384 KB |
Output is correct |
87 |
Correct |
2824 ms |
200012 KB |
Output is correct |
88 |
Correct |
2936 ms |
201808 KB |
Output is correct |
89 |
Correct |
3070 ms |
194512 KB |
Output is correct |
90 |
Correct |
3078 ms |
196864 KB |
Output is correct |
91 |
Correct |
94 ms |
138788 KB |
Output is correct |
92 |
Correct |
97 ms |
138888 KB |
Output is correct |
93 |
Correct |
97 ms |
138852 KB |
Output is correct |
94 |
Correct |
124 ms |
139964 KB |
Output is correct |
95 |
Correct |
196 ms |
150448 KB |
Output is correct |
96 |
Correct |
199 ms |
148664 KB |
Output is correct |
97 |
Correct |
214 ms |
148444 KB |
Output is correct |
98 |
Correct |
95 ms |
138996 KB |
Output is correct |
99 |
Correct |
195 ms |
149532 KB |
Output is correct |
100 |
Correct |
195 ms |
148872 KB |
Output is correct |
101 |
Correct |
200 ms |
148940 KB |
Output is correct |
102 |
Correct |
199 ms |
150012 KB |
Output is correct |
103 |
Correct |
191 ms |
147808 KB |
Output is correct |
104 |
Correct |
181 ms |
148044 KB |
Output is correct |
105 |
Correct |
194 ms |
148340 KB |
Output is correct |
106 |
Correct |
2876 ms |
196708 KB |
Output is correct |
107 |
Correct |
2777 ms |
202744 KB |
Output is correct |
108 |
Correct |
2628 ms |
199844 KB |
Output is correct |
109 |
Correct |
2539 ms |
204952 KB |
Output is correct |
110 |
Correct |
2644 ms |
196084 KB |
Output is correct |
111 |
Correct |
2874 ms |
197848 KB |
Output is correct |
112 |
Correct |
3289 ms |
201956 KB |
Output is correct |
113 |
Correct |
3242 ms |
194128 KB |
Output is correct |
114 |
Correct |
3323 ms |
188308 KB |
Output is correct |
115 |
Correct |
3297 ms |
195672 KB |
Output is correct |
116 |
Correct |
2734 ms |
197952 KB |
Output is correct |
117 |
Correct |
3191 ms |
197180 KB |
Output is correct |
118 |
Correct |
2703 ms |
198552 KB |
Output is correct |
119 |
Correct |
2954 ms |
193640 KB |
Output is correct |
120 |
Correct |
2925 ms |
196940 KB |
Output is correct |
121 |
Correct |
3016 ms |
200460 KB |
Output is correct |
122 |
Correct |
3208 ms |
204060 KB |
Output is correct |
123 |
Correct |
3190 ms |
198356 KB |
Output is correct |
124 |
Correct |
3185 ms |
194520 KB |
Output is correct |
125 |
Correct |
3046 ms |
195272 KB |
Output is correct |
126 |
Correct |
3331 ms |
195540 KB |
Output is correct |
127 |
Correct |
2861 ms |
198068 KB |
Output is correct |
128 |
Correct |
2866 ms |
197628 KB |
Output is correct |
129 |
Execution timed out |
6069 ms |
196500 KB |
Time limit exceeded |
130 |
Halted |
0 ms |
0 KB |
- |