#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];
pair<int,int> fqt1[maxn];
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;
while(true) {
int t1 = d1%szrt[idrt[v]];
if(stt1.count(t1)) break;
stt1.insert(t1);
// if(fqt1[t1] == mp(u,t)) break;
// fqt1[t1] = mp(u,t);
// 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:86:97: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
86 | if(t1 == thrt[v] || (thrt[u] == (thrt[v]+1)%szrt[idrt[u]] && t1 == thrt[u]) && idrt[u] == idrt[v]) continue;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
109 ms |
140548 KB |
Output is correct |
2 |
Correct |
195 ms |
150872 KB |
Output is correct |
3 |
Correct |
170 ms |
149360 KB |
Output is correct |
4 |
Correct |
174 ms |
149148 KB |
Output is correct |
5 |
Correct |
77 ms |
139084 KB |
Output is correct |
6 |
Correct |
171 ms |
149204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
109 ms |
140456 KB |
Output is correct |
2 |
Correct |
180 ms |
151028 KB |
Output is correct |
3 |
Correct |
173 ms |
149708 KB |
Output is correct |
4 |
Correct |
170 ms |
149200 KB |
Output is correct |
5 |
Correct |
78 ms |
139044 KB |
Output is correct |
6 |
Correct |
169 ms |
149200 KB |
Output is correct |
7 |
Correct |
178 ms |
149516 KB |
Output is correct |
8 |
Correct |
166 ms |
149620 KB |
Output is correct |
9 |
Correct |
174 ms |
149872 KB |
Output is correct |
10 |
Correct |
167 ms |
148552 KB |
Output is correct |
11 |
Correct |
164 ms |
148152 KB |
Output is correct |
12 |
Correct |
175 ms |
149100 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
109 ms |
140456 KB |
Output is correct |
2 |
Correct |
180 ms |
151028 KB |
Output is correct |
3 |
Correct |
173 ms |
149708 KB |
Output is correct |
4 |
Correct |
170 ms |
149200 KB |
Output is correct |
5 |
Correct |
78 ms |
139044 KB |
Output is correct |
6 |
Correct |
169 ms |
149200 KB |
Output is correct |
7 |
Correct |
178 ms |
149516 KB |
Output is correct |
8 |
Correct |
166 ms |
149620 KB |
Output is correct |
9 |
Correct |
174 ms |
149872 KB |
Output is correct |
10 |
Correct |
167 ms |
148552 KB |
Output is correct |
11 |
Correct |
164 ms |
148152 KB |
Output is correct |
12 |
Correct |
175 ms |
149100 KB |
Output is correct |
13 |
Correct |
109 ms |
140520 KB |
Output is correct |
14 |
Correct |
181 ms |
150860 KB |
Output is correct |
15 |
Correct |
168 ms |
149452 KB |
Output is correct |
16 |
Correct |
169 ms |
149196 KB |
Output is correct |
17 |
Correct |
77 ms |
139088 KB |
Output is correct |
18 |
Correct |
168 ms |
149228 KB |
Output is correct |
19 |
Correct |
171 ms |
149452 KB |
Output is correct |
20 |
Correct |
170 ms |
149632 KB |
Output is correct |
21 |
Correct |
178 ms |
149764 KB |
Output is correct |
22 |
Correct |
167 ms |
148508 KB |
Output is correct |
23 |
Correct |
164 ms |
148044 KB |
Output is correct |
24 |
Correct |
170 ms |
149044 KB |
Output is correct |
25 |
Correct |
2641 ms |
198304 KB |
Output is correct |
26 |
Correct |
2536 ms |
204388 KB |
Output is correct |
27 |
Correct |
2393 ms |
200276 KB |
Output is correct |
28 |
Correct |
2180 ms |
204492 KB |
Output is correct |
29 |
Correct |
2418 ms |
191272 KB |
Output is correct |
30 |
Correct |
2426 ms |
194672 KB |
Output is correct |
31 |
Correct |
2691 ms |
202812 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
109 ms |
140456 KB |
Output is correct |
2 |
Correct |
180 ms |
151028 KB |
Output is correct |
3 |
Correct |
173 ms |
149708 KB |
Output is correct |
4 |
Correct |
170 ms |
149200 KB |
Output is correct |
5 |
Correct |
78 ms |
139044 KB |
Output is correct |
6 |
Correct |
169 ms |
149200 KB |
Output is correct |
7 |
Correct |
178 ms |
149516 KB |
Output is correct |
8 |
Correct |
166 ms |
149620 KB |
Output is correct |
9 |
Correct |
174 ms |
149872 KB |
Output is correct |
10 |
Correct |
167 ms |
148552 KB |
Output is correct |
11 |
Correct |
164 ms |
148152 KB |
Output is correct |
12 |
Correct |
175 ms |
149100 KB |
Output is correct |
13 |
Correct |
109 ms |
140520 KB |
Output is correct |
14 |
Correct |
181 ms |
150860 KB |
Output is correct |
15 |
Correct |
168 ms |
149452 KB |
Output is correct |
16 |
Correct |
169 ms |
149196 KB |
Output is correct |
17 |
Correct |
77 ms |
139088 KB |
Output is correct |
18 |
Correct |
168 ms |
149228 KB |
Output is correct |
19 |
Correct |
171 ms |
149452 KB |
Output is correct |
20 |
Correct |
170 ms |
149632 KB |
Output is correct |
21 |
Correct |
178 ms |
149764 KB |
Output is correct |
22 |
Correct |
167 ms |
148508 KB |
Output is correct |
23 |
Correct |
164 ms |
148044 KB |
Output is correct |
24 |
Correct |
170 ms |
149044 KB |
Output is correct |
25 |
Correct |
2641 ms |
198304 KB |
Output is correct |
26 |
Correct |
2536 ms |
204388 KB |
Output is correct |
27 |
Correct |
2393 ms |
200276 KB |
Output is correct |
28 |
Correct |
2180 ms |
204492 KB |
Output is correct |
29 |
Correct |
2418 ms |
191272 KB |
Output is correct |
30 |
Correct |
2426 ms |
194672 KB |
Output is correct |
31 |
Correct |
2691 ms |
202812 KB |
Output is correct |
32 |
Correct |
107 ms |
140344 KB |
Output is correct |
33 |
Correct |
191 ms |
150572 KB |
Output is correct |
34 |
Correct |
170 ms |
149100 KB |
Output is correct |
35 |
Correct |
170 ms |
148728 KB |
Output is correct |
36 |
Correct |
78 ms |
139100 KB |
Output is correct |
37 |
Correct |
172 ms |
148976 KB |
Output is correct |
38 |
Correct |
167 ms |
149104 KB |
Output is correct |
39 |
Correct |
168 ms |
149460 KB |
Output is correct |
40 |
Correct |
175 ms |
149432 KB |
Output is correct |
41 |
Correct |
166 ms |
148204 KB |
Output is correct |
42 |
Correct |
163 ms |
147592 KB |
Output is correct |
43 |
Correct |
182 ms |
148688 KB |
Output is correct |
44 |
Correct |
2578 ms |
197176 KB |
Output is correct |
45 |
Correct |
2539 ms |
203656 KB |
Output is correct |
46 |
Correct |
2443 ms |
198792 KB |
Output is correct |
47 |
Correct |
2227 ms |
204604 KB |
Output is correct |
48 |
Correct |
2423 ms |
189936 KB |
Output is correct |
49 |
Correct |
2411 ms |
193184 KB |
Output is correct |
50 |
Correct |
2654 ms |
201380 KB |
Output is correct |
51 |
Correct |
2832 ms |
233880 KB |
Output is correct |
52 |
Correct |
2989 ms |
266404 KB |
Output is correct |
53 |
Correct |
2833 ms |
234016 KB |
Output is correct |
54 |
Correct |
2201 ms |
200172 KB |
Output is correct |
55 |
Correct |
2762 ms |
232060 KB |
Output is correct |
56 |
Correct |
2694 ms |
212484 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
109 ms |
140548 KB |
Output is correct |
2 |
Correct |
195 ms |
150872 KB |
Output is correct |
3 |
Correct |
170 ms |
149360 KB |
Output is correct |
4 |
Correct |
174 ms |
149148 KB |
Output is correct |
5 |
Correct |
77 ms |
139084 KB |
Output is correct |
6 |
Correct |
171 ms |
149204 KB |
Output is correct |
7 |
Correct |
109 ms |
140456 KB |
Output is correct |
8 |
Correct |
180 ms |
151028 KB |
Output is correct |
9 |
Correct |
173 ms |
149708 KB |
Output is correct |
10 |
Correct |
170 ms |
149200 KB |
Output is correct |
11 |
Correct |
78 ms |
139044 KB |
Output is correct |
12 |
Correct |
169 ms |
149200 KB |
Output is correct |
13 |
Correct |
178 ms |
149516 KB |
Output is correct |
14 |
Correct |
166 ms |
149620 KB |
Output is correct |
15 |
Correct |
174 ms |
149872 KB |
Output is correct |
16 |
Correct |
167 ms |
148552 KB |
Output is correct |
17 |
Correct |
164 ms |
148152 KB |
Output is correct |
18 |
Correct |
175 ms |
149100 KB |
Output is correct |
19 |
Correct |
81 ms |
138872 KB |
Output is correct |
20 |
Correct |
79 ms |
138876 KB |
Output is correct |
21 |
Correct |
82 ms |
138788 KB |
Output is correct |
22 |
Correct |
134 ms |
139908 KB |
Output is correct |
23 |
Correct |
186 ms |
150160 KB |
Output is correct |
24 |
Correct |
169 ms |
148632 KB |
Output is correct |
25 |
Correct |
186 ms |
148428 KB |
Output is correct |
26 |
Correct |
82 ms |
139088 KB |
Output is correct |
27 |
Correct |
170 ms |
148400 KB |
Output is correct |
28 |
Correct |
173 ms |
148684 KB |
Output is correct |
29 |
Correct |
171 ms |
148812 KB |
Output is correct |
30 |
Correct |
174 ms |
148988 KB |
Output is correct |
31 |
Correct |
167 ms |
147764 KB |
Output is correct |
32 |
Correct |
168 ms |
147280 KB |
Output is correct |
33 |
Correct |
169 ms |
148372 KB |
Output is correct |
34 |
Correct |
2625 ms |
193560 KB |
Output is correct |
35 |
Correct |
2802 ms |
189452 KB |
Output is correct |
36 |
Correct |
2926 ms |
190704 KB |
Output is correct |
37 |
Correct |
2629 ms |
196256 KB |
Output is correct |
38 |
Correct |
2718 ms |
201532 KB |
Output is correct |
39 |
Correct |
2517 ms |
195880 KB |
Output is correct |
40 |
Correct |
3704 ms |
198664 KB |
Output is correct |
41 |
Correct |
2768 ms |
195840 KB |
Output is correct |
42 |
Correct |
2703 ms |
201920 KB |
Output is correct |
43 |
Correct |
2736 ms |
202280 KB |
Output is correct |
44 |
Correct |
2740 ms |
204392 KB |
Output is correct |
45 |
Correct |
2842 ms |
199984 KB |
Output is correct |
46 |
Correct |
2656 ms |
203524 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
109 ms |
140548 KB |
Output is correct |
2 |
Correct |
195 ms |
150872 KB |
Output is correct |
3 |
Correct |
170 ms |
149360 KB |
Output is correct |
4 |
Correct |
174 ms |
149148 KB |
Output is correct |
5 |
Correct |
77 ms |
139084 KB |
Output is correct |
6 |
Correct |
171 ms |
149204 KB |
Output is correct |
7 |
Correct |
109 ms |
140456 KB |
Output is correct |
8 |
Correct |
180 ms |
151028 KB |
Output is correct |
9 |
Correct |
173 ms |
149708 KB |
Output is correct |
10 |
Correct |
170 ms |
149200 KB |
Output is correct |
11 |
Correct |
78 ms |
139044 KB |
Output is correct |
12 |
Correct |
169 ms |
149200 KB |
Output is correct |
13 |
Correct |
178 ms |
149516 KB |
Output is correct |
14 |
Correct |
166 ms |
149620 KB |
Output is correct |
15 |
Correct |
174 ms |
149872 KB |
Output is correct |
16 |
Correct |
167 ms |
148552 KB |
Output is correct |
17 |
Correct |
164 ms |
148152 KB |
Output is correct |
18 |
Correct |
175 ms |
149100 KB |
Output is correct |
19 |
Correct |
109 ms |
140520 KB |
Output is correct |
20 |
Correct |
181 ms |
150860 KB |
Output is correct |
21 |
Correct |
168 ms |
149452 KB |
Output is correct |
22 |
Correct |
169 ms |
149196 KB |
Output is correct |
23 |
Correct |
77 ms |
139088 KB |
Output is correct |
24 |
Correct |
168 ms |
149228 KB |
Output is correct |
25 |
Correct |
171 ms |
149452 KB |
Output is correct |
26 |
Correct |
170 ms |
149632 KB |
Output is correct |
27 |
Correct |
178 ms |
149764 KB |
Output is correct |
28 |
Correct |
167 ms |
148508 KB |
Output is correct |
29 |
Correct |
164 ms |
148044 KB |
Output is correct |
30 |
Correct |
170 ms |
149044 KB |
Output is correct |
31 |
Correct |
2641 ms |
198304 KB |
Output is correct |
32 |
Correct |
2536 ms |
204388 KB |
Output is correct |
33 |
Correct |
2393 ms |
200276 KB |
Output is correct |
34 |
Correct |
2180 ms |
204492 KB |
Output is correct |
35 |
Correct |
2418 ms |
191272 KB |
Output is correct |
36 |
Correct |
2426 ms |
194672 KB |
Output is correct |
37 |
Correct |
2691 ms |
202812 KB |
Output is correct |
38 |
Correct |
81 ms |
138872 KB |
Output is correct |
39 |
Correct |
79 ms |
138876 KB |
Output is correct |
40 |
Correct |
82 ms |
138788 KB |
Output is correct |
41 |
Correct |
134 ms |
139908 KB |
Output is correct |
42 |
Correct |
186 ms |
150160 KB |
Output is correct |
43 |
Correct |
169 ms |
148632 KB |
Output is correct |
44 |
Correct |
186 ms |
148428 KB |
Output is correct |
45 |
Correct |
82 ms |
139088 KB |
Output is correct |
46 |
Correct |
170 ms |
148400 KB |
Output is correct |
47 |
Correct |
173 ms |
148684 KB |
Output is correct |
48 |
Correct |
171 ms |
148812 KB |
Output is correct |
49 |
Correct |
174 ms |
148988 KB |
Output is correct |
50 |
Correct |
167 ms |
147764 KB |
Output is correct |
51 |
Correct |
168 ms |
147280 KB |
Output is correct |
52 |
Correct |
169 ms |
148372 KB |
Output is correct |
53 |
Correct |
2625 ms |
193560 KB |
Output is correct |
54 |
Correct |
2802 ms |
189452 KB |
Output is correct |
55 |
Correct |
2926 ms |
190704 KB |
Output is correct |
56 |
Correct |
2629 ms |
196256 KB |
Output is correct |
57 |
Correct |
2718 ms |
201532 KB |
Output is correct |
58 |
Correct |
2517 ms |
195880 KB |
Output is correct |
59 |
Correct |
3704 ms |
198664 KB |
Output is correct |
60 |
Correct |
2768 ms |
195840 KB |
Output is correct |
61 |
Correct |
2703 ms |
201920 KB |
Output is correct |
62 |
Correct |
2736 ms |
202280 KB |
Output is correct |
63 |
Correct |
2740 ms |
204392 KB |
Output is correct |
64 |
Correct |
2842 ms |
199984 KB |
Output is correct |
65 |
Correct |
2656 ms |
203524 KB |
Output is correct |
66 |
Correct |
82 ms |
138776 KB |
Output is correct |
67 |
Correct |
85 ms |
138896 KB |
Output is correct |
68 |
Correct |
87 ms |
138828 KB |
Output is correct |
69 |
Correct |
117 ms |
140544 KB |
Output is correct |
70 |
Correct |
183 ms |
151276 KB |
Output is correct |
71 |
Correct |
176 ms |
149780 KB |
Output is correct |
72 |
Correct |
177 ms |
149564 KB |
Output is correct |
73 |
Correct |
85 ms |
139096 KB |
Output is correct |
74 |
Correct |
178 ms |
149668 KB |
Output is correct |
75 |
Correct |
183 ms |
150008 KB |
Output is correct |
76 |
Correct |
175 ms |
149964 KB |
Output is correct |
77 |
Correct |
178 ms |
150212 KB |
Output is correct |
78 |
Correct |
170 ms |
148940 KB |
Output is correct |
79 |
Correct |
169 ms |
148476 KB |
Output is correct |
80 |
Correct |
181 ms |
149504 KB |
Output is correct |
81 |
Correct |
2630 ms |
197768 KB |
Output is correct |
82 |
Correct |
2543 ms |
204008 KB |
Output is correct |
83 |
Correct |
2465 ms |
199664 KB |
Output is correct |
84 |
Correct |
2213 ms |
207952 KB |
Output is correct |
85 |
Correct |
2546 ms |
193884 KB |
Output is correct |
86 |
Correct |
2471 ms |
199240 KB |
Output is correct |
87 |
Correct |
2714 ms |
204484 KB |
Output is correct |
88 |
Correct |
2635 ms |
196804 KB |
Output is correct |
89 |
Correct |
2735 ms |
191836 KB |
Output is correct |
90 |
Correct |
2786 ms |
197524 KB |
Output is correct |
91 |
Correct |
2503 ms |
198964 KB |
Output is correct |
92 |
Correct |
2690 ms |
200016 KB |
Output is correct |
93 |
Correct |
2487 ms |
195864 KB |
Output is correct |
94 |
Correct |
3699 ms |
195156 KB |
Output is correct |
95 |
Correct |
2691 ms |
191036 KB |
Output is correct |
96 |
Correct |
2653 ms |
199932 KB |
Output is correct |
97 |
Correct |
2718 ms |
202060 KB |
Output is correct |
98 |
Correct |
2671 ms |
199496 KB |
Output is correct |
99 |
Correct |
2730 ms |
193764 KB |
Output is correct |
100 |
Correct |
2620 ms |
196520 KB |
Output is correct |
101 |
Correct |
2544 ms |
196696 KB |
Output is correct |
102 |
Correct |
2466 ms |
199436 KB |
Output is correct |
103 |
Correct |
2788 ms |
198724 KB |
Output is correct |
104 |
Execution timed out |
6040 ms |
193160 KB |
Time limit exceeded |
105 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
109 ms |
140548 KB |
Output is correct |
2 |
Correct |
195 ms |
150872 KB |
Output is correct |
3 |
Correct |
170 ms |
149360 KB |
Output is correct |
4 |
Correct |
174 ms |
149148 KB |
Output is correct |
5 |
Correct |
77 ms |
139084 KB |
Output is correct |
6 |
Correct |
171 ms |
149204 KB |
Output is correct |
7 |
Correct |
109 ms |
140456 KB |
Output is correct |
8 |
Correct |
180 ms |
151028 KB |
Output is correct |
9 |
Correct |
173 ms |
149708 KB |
Output is correct |
10 |
Correct |
170 ms |
149200 KB |
Output is correct |
11 |
Correct |
78 ms |
139044 KB |
Output is correct |
12 |
Correct |
169 ms |
149200 KB |
Output is correct |
13 |
Correct |
178 ms |
149516 KB |
Output is correct |
14 |
Correct |
166 ms |
149620 KB |
Output is correct |
15 |
Correct |
174 ms |
149872 KB |
Output is correct |
16 |
Correct |
167 ms |
148552 KB |
Output is correct |
17 |
Correct |
164 ms |
148152 KB |
Output is correct |
18 |
Correct |
175 ms |
149100 KB |
Output is correct |
19 |
Correct |
109 ms |
140520 KB |
Output is correct |
20 |
Correct |
181 ms |
150860 KB |
Output is correct |
21 |
Correct |
168 ms |
149452 KB |
Output is correct |
22 |
Correct |
169 ms |
149196 KB |
Output is correct |
23 |
Correct |
77 ms |
139088 KB |
Output is correct |
24 |
Correct |
168 ms |
149228 KB |
Output is correct |
25 |
Correct |
171 ms |
149452 KB |
Output is correct |
26 |
Correct |
170 ms |
149632 KB |
Output is correct |
27 |
Correct |
178 ms |
149764 KB |
Output is correct |
28 |
Correct |
167 ms |
148508 KB |
Output is correct |
29 |
Correct |
164 ms |
148044 KB |
Output is correct |
30 |
Correct |
170 ms |
149044 KB |
Output is correct |
31 |
Correct |
2641 ms |
198304 KB |
Output is correct |
32 |
Correct |
2536 ms |
204388 KB |
Output is correct |
33 |
Correct |
2393 ms |
200276 KB |
Output is correct |
34 |
Correct |
2180 ms |
204492 KB |
Output is correct |
35 |
Correct |
2418 ms |
191272 KB |
Output is correct |
36 |
Correct |
2426 ms |
194672 KB |
Output is correct |
37 |
Correct |
2691 ms |
202812 KB |
Output is correct |
38 |
Correct |
107 ms |
140344 KB |
Output is correct |
39 |
Correct |
191 ms |
150572 KB |
Output is correct |
40 |
Correct |
170 ms |
149100 KB |
Output is correct |
41 |
Correct |
170 ms |
148728 KB |
Output is correct |
42 |
Correct |
78 ms |
139100 KB |
Output is correct |
43 |
Correct |
172 ms |
148976 KB |
Output is correct |
44 |
Correct |
167 ms |
149104 KB |
Output is correct |
45 |
Correct |
168 ms |
149460 KB |
Output is correct |
46 |
Correct |
175 ms |
149432 KB |
Output is correct |
47 |
Correct |
166 ms |
148204 KB |
Output is correct |
48 |
Correct |
163 ms |
147592 KB |
Output is correct |
49 |
Correct |
182 ms |
148688 KB |
Output is correct |
50 |
Correct |
2578 ms |
197176 KB |
Output is correct |
51 |
Correct |
2539 ms |
203656 KB |
Output is correct |
52 |
Correct |
2443 ms |
198792 KB |
Output is correct |
53 |
Correct |
2227 ms |
204604 KB |
Output is correct |
54 |
Correct |
2423 ms |
189936 KB |
Output is correct |
55 |
Correct |
2411 ms |
193184 KB |
Output is correct |
56 |
Correct |
2654 ms |
201380 KB |
Output is correct |
57 |
Correct |
2832 ms |
233880 KB |
Output is correct |
58 |
Correct |
2989 ms |
266404 KB |
Output is correct |
59 |
Correct |
2833 ms |
234016 KB |
Output is correct |
60 |
Correct |
2201 ms |
200172 KB |
Output is correct |
61 |
Correct |
2762 ms |
232060 KB |
Output is correct |
62 |
Correct |
2694 ms |
212484 KB |
Output is correct |
63 |
Correct |
81 ms |
138872 KB |
Output is correct |
64 |
Correct |
79 ms |
138876 KB |
Output is correct |
65 |
Correct |
82 ms |
138788 KB |
Output is correct |
66 |
Correct |
134 ms |
139908 KB |
Output is correct |
67 |
Correct |
186 ms |
150160 KB |
Output is correct |
68 |
Correct |
169 ms |
148632 KB |
Output is correct |
69 |
Correct |
186 ms |
148428 KB |
Output is correct |
70 |
Correct |
82 ms |
139088 KB |
Output is correct |
71 |
Correct |
170 ms |
148400 KB |
Output is correct |
72 |
Correct |
173 ms |
148684 KB |
Output is correct |
73 |
Correct |
171 ms |
148812 KB |
Output is correct |
74 |
Correct |
174 ms |
148988 KB |
Output is correct |
75 |
Correct |
167 ms |
147764 KB |
Output is correct |
76 |
Correct |
168 ms |
147280 KB |
Output is correct |
77 |
Correct |
169 ms |
148372 KB |
Output is correct |
78 |
Correct |
2625 ms |
193560 KB |
Output is correct |
79 |
Correct |
2802 ms |
189452 KB |
Output is correct |
80 |
Correct |
2926 ms |
190704 KB |
Output is correct |
81 |
Correct |
2629 ms |
196256 KB |
Output is correct |
82 |
Correct |
2718 ms |
201532 KB |
Output is correct |
83 |
Correct |
2517 ms |
195880 KB |
Output is correct |
84 |
Correct |
3704 ms |
198664 KB |
Output is correct |
85 |
Correct |
2768 ms |
195840 KB |
Output is correct |
86 |
Correct |
2703 ms |
201920 KB |
Output is correct |
87 |
Correct |
2736 ms |
202280 KB |
Output is correct |
88 |
Correct |
2740 ms |
204392 KB |
Output is correct |
89 |
Correct |
2842 ms |
199984 KB |
Output is correct |
90 |
Correct |
2656 ms |
203524 KB |
Output is correct |
91 |
Correct |
82 ms |
138776 KB |
Output is correct |
92 |
Correct |
85 ms |
138896 KB |
Output is correct |
93 |
Correct |
87 ms |
138828 KB |
Output is correct |
94 |
Correct |
117 ms |
140544 KB |
Output is correct |
95 |
Correct |
183 ms |
151276 KB |
Output is correct |
96 |
Correct |
176 ms |
149780 KB |
Output is correct |
97 |
Correct |
177 ms |
149564 KB |
Output is correct |
98 |
Correct |
85 ms |
139096 KB |
Output is correct |
99 |
Correct |
178 ms |
149668 KB |
Output is correct |
100 |
Correct |
183 ms |
150008 KB |
Output is correct |
101 |
Correct |
175 ms |
149964 KB |
Output is correct |
102 |
Correct |
178 ms |
150212 KB |
Output is correct |
103 |
Correct |
170 ms |
148940 KB |
Output is correct |
104 |
Correct |
169 ms |
148476 KB |
Output is correct |
105 |
Correct |
181 ms |
149504 KB |
Output is correct |
106 |
Correct |
2630 ms |
197768 KB |
Output is correct |
107 |
Correct |
2543 ms |
204008 KB |
Output is correct |
108 |
Correct |
2465 ms |
199664 KB |
Output is correct |
109 |
Correct |
2213 ms |
207952 KB |
Output is correct |
110 |
Correct |
2546 ms |
193884 KB |
Output is correct |
111 |
Correct |
2471 ms |
199240 KB |
Output is correct |
112 |
Correct |
2714 ms |
204484 KB |
Output is correct |
113 |
Correct |
2635 ms |
196804 KB |
Output is correct |
114 |
Correct |
2735 ms |
191836 KB |
Output is correct |
115 |
Correct |
2786 ms |
197524 KB |
Output is correct |
116 |
Correct |
2503 ms |
198964 KB |
Output is correct |
117 |
Correct |
2690 ms |
200016 KB |
Output is correct |
118 |
Correct |
2487 ms |
195864 KB |
Output is correct |
119 |
Correct |
3699 ms |
195156 KB |
Output is correct |
120 |
Correct |
2691 ms |
191036 KB |
Output is correct |
121 |
Correct |
2653 ms |
199932 KB |
Output is correct |
122 |
Correct |
2718 ms |
202060 KB |
Output is correct |
123 |
Correct |
2671 ms |
199496 KB |
Output is correct |
124 |
Correct |
2730 ms |
193764 KB |
Output is correct |
125 |
Correct |
2620 ms |
196520 KB |
Output is correct |
126 |
Correct |
2544 ms |
196696 KB |
Output is correct |
127 |
Correct |
2466 ms |
199436 KB |
Output is correct |
128 |
Correct |
2788 ms |
198724 KB |
Output is correct |
129 |
Execution timed out |
6040 ms |
193160 KB |
Time limit exceeded |
130 |
Halted |
0 ms |
0 KB |
- |