#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];
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);
// 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:85:97: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
85 | if(t1 == thrt[v] || (thrt[u] == (thrt[v]+1)%szrt[idrt[u]] && t1 == thrt[u]) && idrt[u] == idrt[v]) continue;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
119 ms |
139852 KB |
Output is correct |
2 |
Correct |
185 ms |
150080 KB |
Output is correct |
3 |
Correct |
167 ms |
148684 KB |
Output is correct |
4 |
Correct |
169 ms |
148436 KB |
Output is correct |
5 |
Correct |
78 ms |
139016 KB |
Output is correct |
6 |
Correct |
195 ms |
148432 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
109 ms |
139856 KB |
Output is correct |
2 |
Correct |
176 ms |
150096 KB |
Output is correct |
3 |
Correct |
184 ms |
148608 KB |
Output is correct |
4 |
Correct |
171 ms |
148312 KB |
Output is correct |
5 |
Correct |
79 ms |
139176 KB |
Output is correct |
6 |
Correct |
200 ms |
148488 KB |
Output is correct |
7 |
Correct |
172 ms |
148704 KB |
Output is correct |
8 |
Correct |
167 ms |
148736 KB |
Output is correct |
9 |
Correct |
171 ms |
148960 KB |
Output is correct |
10 |
Correct |
165 ms |
147768 KB |
Output is correct |
11 |
Correct |
164 ms |
147332 KB |
Output is correct |
12 |
Correct |
172 ms |
148260 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
109 ms |
139856 KB |
Output is correct |
2 |
Correct |
176 ms |
150096 KB |
Output is correct |
3 |
Correct |
184 ms |
148608 KB |
Output is correct |
4 |
Correct |
171 ms |
148312 KB |
Output is correct |
5 |
Correct |
79 ms |
139176 KB |
Output is correct |
6 |
Correct |
200 ms |
148488 KB |
Output is correct |
7 |
Correct |
172 ms |
148704 KB |
Output is correct |
8 |
Correct |
167 ms |
148736 KB |
Output is correct |
9 |
Correct |
171 ms |
148960 KB |
Output is correct |
10 |
Correct |
165 ms |
147768 KB |
Output is correct |
11 |
Correct |
164 ms |
147332 KB |
Output is correct |
12 |
Correct |
172 ms |
148260 KB |
Output is correct |
13 |
Correct |
111 ms |
139852 KB |
Output is correct |
14 |
Correct |
189 ms |
150056 KB |
Output is correct |
15 |
Correct |
175 ms |
148684 KB |
Output is correct |
16 |
Correct |
172 ms |
148388 KB |
Output is correct |
17 |
Correct |
84 ms |
138996 KB |
Output is correct |
18 |
Correct |
174 ms |
148444 KB |
Output is correct |
19 |
Correct |
180 ms |
148668 KB |
Output is correct |
20 |
Correct |
170 ms |
148796 KB |
Output is correct |
21 |
Correct |
184 ms |
149116 KB |
Output is correct |
22 |
Correct |
168 ms |
147708 KB |
Output is correct |
23 |
Correct |
162 ms |
147292 KB |
Output is correct |
24 |
Correct |
180 ms |
148424 KB |
Output is correct |
25 |
Correct |
2574 ms |
196540 KB |
Output is correct |
26 |
Correct |
2478 ms |
202672 KB |
Output is correct |
27 |
Correct |
2339 ms |
198200 KB |
Output is correct |
28 |
Correct |
2086 ms |
202632 KB |
Output is correct |
29 |
Correct |
2389 ms |
189512 KB |
Output is correct |
30 |
Correct |
2414 ms |
192684 KB |
Output is correct |
31 |
Correct |
2649 ms |
200880 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
109 ms |
139856 KB |
Output is correct |
2 |
Correct |
176 ms |
150096 KB |
Output is correct |
3 |
Correct |
184 ms |
148608 KB |
Output is correct |
4 |
Correct |
171 ms |
148312 KB |
Output is correct |
5 |
Correct |
79 ms |
139176 KB |
Output is correct |
6 |
Correct |
200 ms |
148488 KB |
Output is correct |
7 |
Correct |
172 ms |
148704 KB |
Output is correct |
8 |
Correct |
167 ms |
148736 KB |
Output is correct |
9 |
Correct |
171 ms |
148960 KB |
Output is correct |
10 |
Correct |
165 ms |
147768 KB |
Output is correct |
11 |
Correct |
164 ms |
147332 KB |
Output is correct |
12 |
Correct |
172 ms |
148260 KB |
Output is correct |
13 |
Correct |
111 ms |
139852 KB |
Output is correct |
14 |
Correct |
189 ms |
150056 KB |
Output is correct |
15 |
Correct |
175 ms |
148684 KB |
Output is correct |
16 |
Correct |
172 ms |
148388 KB |
Output is correct |
17 |
Correct |
84 ms |
138996 KB |
Output is correct |
18 |
Correct |
174 ms |
148444 KB |
Output is correct |
19 |
Correct |
180 ms |
148668 KB |
Output is correct |
20 |
Correct |
170 ms |
148796 KB |
Output is correct |
21 |
Correct |
184 ms |
149116 KB |
Output is correct |
22 |
Correct |
168 ms |
147708 KB |
Output is correct |
23 |
Correct |
162 ms |
147292 KB |
Output is correct |
24 |
Correct |
180 ms |
148424 KB |
Output is correct |
25 |
Correct |
2574 ms |
196540 KB |
Output is correct |
26 |
Correct |
2478 ms |
202672 KB |
Output is correct |
27 |
Correct |
2339 ms |
198200 KB |
Output is correct |
28 |
Correct |
2086 ms |
202632 KB |
Output is correct |
29 |
Correct |
2389 ms |
189512 KB |
Output is correct |
30 |
Correct |
2414 ms |
192684 KB |
Output is correct |
31 |
Correct |
2649 ms |
200880 KB |
Output is correct |
32 |
Correct |
117 ms |
139928 KB |
Output is correct |
33 |
Correct |
185 ms |
150072 KB |
Output is correct |
34 |
Correct |
173 ms |
148668 KB |
Output is correct |
35 |
Correct |
171 ms |
148344 KB |
Output is correct |
36 |
Correct |
82 ms |
139096 KB |
Output is correct |
37 |
Correct |
174 ms |
148440 KB |
Output is correct |
38 |
Correct |
176 ms |
148620 KB |
Output is correct |
39 |
Correct |
171 ms |
148804 KB |
Output is correct |
40 |
Correct |
171 ms |
148972 KB |
Output is correct |
41 |
Correct |
172 ms |
147812 KB |
Output is correct |
42 |
Correct |
162 ms |
147284 KB |
Output is correct |
43 |
Correct |
167 ms |
148344 KB |
Output is correct |
44 |
Correct |
2658 ms |
196340 KB |
Output is correct |
45 |
Correct |
2525 ms |
202512 KB |
Output is correct |
46 |
Correct |
2374 ms |
198224 KB |
Output is correct |
47 |
Correct |
2084 ms |
202636 KB |
Output is correct |
48 |
Correct |
2416 ms |
189600 KB |
Output is correct |
49 |
Correct |
2386 ms |
192480 KB |
Output is correct |
50 |
Correct |
2619 ms |
200688 KB |
Output is correct |
51 |
Correct |
2728 ms |
233624 KB |
Output is correct |
52 |
Correct |
2697 ms |
266128 KB |
Output is correct |
53 |
Correct |
2556 ms |
233860 KB |
Output is correct |
54 |
Correct |
2045 ms |
199168 KB |
Output is correct |
55 |
Correct |
2642 ms |
232012 KB |
Output is correct |
56 |
Correct |
2506 ms |
212312 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
119 ms |
139852 KB |
Output is correct |
2 |
Correct |
185 ms |
150080 KB |
Output is correct |
3 |
Correct |
167 ms |
148684 KB |
Output is correct |
4 |
Correct |
169 ms |
148436 KB |
Output is correct |
5 |
Correct |
78 ms |
139016 KB |
Output is correct |
6 |
Correct |
195 ms |
148432 KB |
Output is correct |
7 |
Correct |
109 ms |
139856 KB |
Output is correct |
8 |
Correct |
176 ms |
150096 KB |
Output is correct |
9 |
Correct |
184 ms |
148608 KB |
Output is correct |
10 |
Correct |
171 ms |
148312 KB |
Output is correct |
11 |
Correct |
79 ms |
139176 KB |
Output is correct |
12 |
Correct |
200 ms |
148488 KB |
Output is correct |
13 |
Correct |
172 ms |
148704 KB |
Output is correct |
14 |
Correct |
167 ms |
148736 KB |
Output is correct |
15 |
Correct |
171 ms |
148960 KB |
Output is correct |
16 |
Correct |
165 ms |
147768 KB |
Output is correct |
17 |
Correct |
164 ms |
147332 KB |
Output is correct |
18 |
Correct |
172 ms |
148260 KB |
Output is correct |
19 |
Correct |
75 ms |
138804 KB |
Output is correct |
20 |
Correct |
76 ms |
138832 KB |
Output is correct |
21 |
Correct |
76 ms |
138824 KB |
Output is correct |
22 |
Correct |
108 ms |
139956 KB |
Output is correct |
23 |
Correct |
176 ms |
150192 KB |
Output is correct |
24 |
Correct |
164 ms |
148636 KB |
Output is correct |
25 |
Correct |
193 ms |
148444 KB |
Output is correct |
26 |
Correct |
76 ms |
139084 KB |
Output is correct |
27 |
Correct |
168 ms |
148460 KB |
Output is correct |
28 |
Correct |
167 ms |
148720 KB |
Output is correct |
29 |
Correct |
164 ms |
148728 KB |
Output is correct |
30 |
Correct |
169 ms |
148940 KB |
Output is correct |
31 |
Correct |
166 ms |
147732 KB |
Output is correct |
32 |
Correct |
164 ms |
147292 KB |
Output is correct |
33 |
Correct |
162 ms |
148276 KB |
Output is correct |
34 |
Correct |
2550 ms |
193400 KB |
Output is correct |
35 |
Correct |
2608 ms |
188484 KB |
Output is correct |
36 |
Correct |
2635 ms |
190620 KB |
Output is correct |
37 |
Correct |
2364 ms |
196188 KB |
Output is correct |
38 |
Correct |
2636 ms |
201452 KB |
Output is correct |
39 |
Correct |
2492 ms |
195780 KB |
Output is correct |
40 |
Correct |
3880 ms |
198620 KB |
Output is correct |
41 |
Correct |
2781 ms |
195852 KB |
Output is correct |
42 |
Correct |
2659 ms |
201820 KB |
Output is correct |
43 |
Correct |
2665 ms |
202340 KB |
Output is correct |
44 |
Correct |
2653 ms |
204472 KB |
Output is correct |
45 |
Correct |
2777 ms |
200008 KB |
Output is correct |
46 |
Correct |
2652 ms |
203680 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
119 ms |
139852 KB |
Output is correct |
2 |
Correct |
185 ms |
150080 KB |
Output is correct |
3 |
Correct |
167 ms |
148684 KB |
Output is correct |
4 |
Correct |
169 ms |
148436 KB |
Output is correct |
5 |
Correct |
78 ms |
139016 KB |
Output is correct |
6 |
Correct |
195 ms |
148432 KB |
Output is correct |
7 |
Correct |
109 ms |
139856 KB |
Output is correct |
8 |
Correct |
176 ms |
150096 KB |
Output is correct |
9 |
Correct |
184 ms |
148608 KB |
Output is correct |
10 |
Correct |
171 ms |
148312 KB |
Output is correct |
11 |
Correct |
79 ms |
139176 KB |
Output is correct |
12 |
Correct |
200 ms |
148488 KB |
Output is correct |
13 |
Correct |
172 ms |
148704 KB |
Output is correct |
14 |
Correct |
167 ms |
148736 KB |
Output is correct |
15 |
Correct |
171 ms |
148960 KB |
Output is correct |
16 |
Correct |
165 ms |
147768 KB |
Output is correct |
17 |
Correct |
164 ms |
147332 KB |
Output is correct |
18 |
Correct |
172 ms |
148260 KB |
Output is correct |
19 |
Correct |
111 ms |
139852 KB |
Output is correct |
20 |
Correct |
189 ms |
150056 KB |
Output is correct |
21 |
Correct |
175 ms |
148684 KB |
Output is correct |
22 |
Correct |
172 ms |
148388 KB |
Output is correct |
23 |
Correct |
84 ms |
138996 KB |
Output is correct |
24 |
Correct |
174 ms |
148444 KB |
Output is correct |
25 |
Correct |
180 ms |
148668 KB |
Output is correct |
26 |
Correct |
170 ms |
148796 KB |
Output is correct |
27 |
Correct |
184 ms |
149116 KB |
Output is correct |
28 |
Correct |
168 ms |
147708 KB |
Output is correct |
29 |
Correct |
162 ms |
147292 KB |
Output is correct |
30 |
Correct |
180 ms |
148424 KB |
Output is correct |
31 |
Correct |
2574 ms |
196540 KB |
Output is correct |
32 |
Correct |
2478 ms |
202672 KB |
Output is correct |
33 |
Correct |
2339 ms |
198200 KB |
Output is correct |
34 |
Correct |
2086 ms |
202632 KB |
Output is correct |
35 |
Correct |
2389 ms |
189512 KB |
Output is correct |
36 |
Correct |
2414 ms |
192684 KB |
Output is correct |
37 |
Correct |
2649 ms |
200880 KB |
Output is correct |
38 |
Correct |
75 ms |
138804 KB |
Output is correct |
39 |
Correct |
76 ms |
138832 KB |
Output is correct |
40 |
Correct |
76 ms |
138824 KB |
Output is correct |
41 |
Correct |
108 ms |
139956 KB |
Output is correct |
42 |
Correct |
176 ms |
150192 KB |
Output is correct |
43 |
Correct |
164 ms |
148636 KB |
Output is correct |
44 |
Correct |
193 ms |
148444 KB |
Output is correct |
45 |
Correct |
76 ms |
139084 KB |
Output is correct |
46 |
Correct |
168 ms |
148460 KB |
Output is correct |
47 |
Correct |
167 ms |
148720 KB |
Output is correct |
48 |
Correct |
164 ms |
148728 KB |
Output is correct |
49 |
Correct |
169 ms |
148940 KB |
Output is correct |
50 |
Correct |
166 ms |
147732 KB |
Output is correct |
51 |
Correct |
164 ms |
147292 KB |
Output is correct |
52 |
Correct |
162 ms |
148276 KB |
Output is correct |
53 |
Correct |
2550 ms |
193400 KB |
Output is correct |
54 |
Correct |
2608 ms |
188484 KB |
Output is correct |
55 |
Correct |
2635 ms |
190620 KB |
Output is correct |
56 |
Correct |
2364 ms |
196188 KB |
Output is correct |
57 |
Correct |
2636 ms |
201452 KB |
Output is correct |
58 |
Correct |
2492 ms |
195780 KB |
Output is correct |
59 |
Correct |
3880 ms |
198620 KB |
Output is correct |
60 |
Correct |
2781 ms |
195852 KB |
Output is correct |
61 |
Correct |
2659 ms |
201820 KB |
Output is correct |
62 |
Correct |
2665 ms |
202340 KB |
Output is correct |
63 |
Correct |
2653 ms |
204472 KB |
Output is correct |
64 |
Correct |
2777 ms |
200008 KB |
Output is correct |
65 |
Correct |
2652 ms |
203680 KB |
Output is correct |
66 |
Correct |
78 ms |
138820 KB |
Output is correct |
67 |
Correct |
85 ms |
138828 KB |
Output is correct |
68 |
Correct |
76 ms |
138828 KB |
Output is correct |
69 |
Correct |
113 ms |
140540 KB |
Output is correct |
70 |
Correct |
185 ms |
151300 KB |
Output is correct |
71 |
Correct |
179 ms |
149844 KB |
Output is correct |
72 |
Correct |
183 ms |
149532 KB |
Output is correct |
73 |
Correct |
84 ms |
139084 KB |
Output is correct |
74 |
Correct |
177 ms |
149628 KB |
Output is correct |
75 |
Correct |
190 ms |
149860 KB |
Output is correct |
76 |
Correct |
176 ms |
149904 KB |
Output is correct |
77 |
Correct |
169 ms |
150100 KB |
Output is correct |
78 |
Correct |
166 ms |
148940 KB |
Output is correct |
79 |
Correct |
164 ms |
148496 KB |
Output is correct |
80 |
Correct |
176 ms |
149452 KB |
Output is correct |
81 |
Correct |
2661 ms |
216272 KB |
Output is correct |
82 |
Correct |
2507 ms |
222352 KB |
Output is correct |
83 |
Correct |
2434 ms |
218852 KB |
Output is correct |
84 |
Correct |
2153 ms |
237296 KB |
Output is correct |
85 |
Correct |
2401 ms |
211684 KB |
Output is correct |
86 |
Correct |
2336 ms |
217328 KB |
Output is correct |
87 |
Correct |
2623 ms |
237128 KB |
Output is correct |
88 |
Correct |
2537 ms |
230484 KB |
Output is correct |
89 |
Correct |
2741 ms |
224744 KB |
Output is correct |
90 |
Correct |
2608 ms |
214508 KB |
Output is correct |
91 |
Correct |
2482 ms |
234608 KB |
Output is correct |
92 |
Correct |
2713 ms |
230000 KB |
Output is correct |
93 |
Correct |
2461 ms |
212312 KB |
Output is correct |
94 |
Correct |
3838 ms |
224892 KB |
Output is correct |
95 |
Correct |
2761 ms |
211220 KB |
Output is correct |
96 |
Correct |
2639 ms |
230452 KB |
Output is correct |
97 |
Correct |
2705 ms |
225144 KB |
Output is correct |
98 |
Correct |
2737 ms |
217800 KB |
Output is correct |
99 |
Correct |
2788 ms |
211764 KB |
Output is correct |
100 |
Correct |
2828 ms |
213484 KB |
Output is correct |
101 |
Correct |
2679 ms |
215500 KB |
Output is correct |
102 |
Correct |
2540 ms |
216388 KB |
Output is correct |
103 |
Correct |
2662 ms |
215484 KB |
Output is correct |
104 |
Execution timed out |
6081 ms |
210588 KB |
Time limit exceeded |
105 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
119 ms |
139852 KB |
Output is correct |
2 |
Correct |
185 ms |
150080 KB |
Output is correct |
3 |
Correct |
167 ms |
148684 KB |
Output is correct |
4 |
Correct |
169 ms |
148436 KB |
Output is correct |
5 |
Correct |
78 ms |
139016 KB |
Output is correct |
6 |
Correct |
195 ms |
148432 KB |
Output is correct |
7 |
Correct |
109 ms |
139856 KB |
Output is correct |
8 |
Correct |
176 ms |
150096 KB |
Output is correct |
9 |
Correct |
184 ms |
148608 KB |
Output is correct |
10 |
Correct |
171 ms |
148312 KB |
Output is correct |
11 |
Correct |
79 ms |
139176 KB |
Output is correct |
12 |
Correct |
200 ms |
148488 KB |
Output is correct |
13 |
Correct |
172 ms |
148704 KB |
Output is correct |
14 |
Correct |
167 ms |
148736 KB |
Output is correct |
15 |
Correct |
171 ms |
148960 KB |
Output is correct |
16 |
Correct |
165 ms |
147768 KB |
Output is correct |
17 |
Correct |
164 ms |
147332 KB |
Output is correct |
18 |
Correct |
172 ms |
148260 KB |
Output is correct |
19 |
Correct |
111 ms |
139852 KB |
Output is correct |
20 |
Correct |
189 ms |
150056 KB |
Output is correct |
21 |
Correct |
175 ms |
148684 KB |
Output is correct |
22 |
Correct |
172 ms |
148388 KB |
Output is correct |
23 |
Correct |
84 ms |
138996 KB |
Output is correct |
24 |
Correct |
174 ms |
148444 KB |
Output is correct |
25 |
Correct |
180 ms |
148668 KB |
Output is correct |
26 |
Correct |
170 ms |
148796 KB |
Output is correct |
27 |
Correct |
184 ms |
149116 KB |
Output is correct |
28 |
Correct |
168 ms |
147708 KB |
Output is correct |
29 |
Correct |
162 ms |
147292 KB |
Output is correct |
30 |
Correct |
180 ms |
148424 KB |
Output is correct |
31 |
Correct |
2574 ms |
196540 KB |
Output is correct |
32 |
Correct |
2478 ms |
202672 KB |
Output is correct |
33 |
Correct |
2339 ms |
198200 KB |
Output is correct |
34 |
Correct |
2086 ms |
202632 KB |
Output is correct |
35 |
Correct |
2389 ms |
189512 KB |
Output is correct |
36 |
Correct |
2414 ms |
192684 KB |
Output is correct |
37 |
Correct |
2649 ms |
200880 KB |
Output is correct |
38 |
Correct |
117 ms |
139928 KB |
Output is correct |
39 |
Correct |
185 ms |
150072 KB |
Output is correct |
40 |
Correct |
173 ms |
148668 KB |
Output is correct |
41 |
Correct |
171 ms |
148344 KB |
Output is correct |
42 |
Correct |
82 ms |
139096 KB |
Output is correct |
43 |
Correct |
174 ms |
148440 KB |
Output is correct |
44 |
Correct |
176 ms |
148620 KB |
Output is correct |
45 |
Correct |
171 ms |
148804 KB |
Output is correct |
46 |
Correct |
171 ms |
148972 KB |
Output is correct |
47 |
Correct |
172 ms |
147812 KB |
Output is correct |
48 |
Correct |
162 ms |
147284 KB |
Output is correct |
49 |
Correct |
167 ms |
148344 KB |
Output is correct |
50 |
Correct |
2658 ms |
196340 KB |
Output is correct |
51 |
Correct |
2525 ms |
202512 KB |
Output is correct |
52 |
Correct |
2374 ms |
198224 KB |
Output is correct |
53 |
Correct |
2084 ms |
202636 KB |
Output is correct |
54 |
Correct |
2416 ms |
189600 KB |
Output is correct |
55 |
Correct |
2386 ms |
192480 KB |
Output is correct |
56 |
Correct |
2619 ms |
200688 KB |
Output is correct |
57 |
Correct |
2728 ms |
233624 KB |
Output is correct |
58 |
Correct |
2697 ms |
266128 KB |
Output is correct |
59 |
Correct |
2556 ms |
233860 KB |
Output is correct |
60 |
Correct |
2045 ms |
199168 KB |
Output is correct |
61 |
Correct |
2642 ms |
232012 KB |
Output is correct |
62 |
Correct |
2506 ms |
212312 KB |
Output is correct |
63 |
Correct |
75 ms |
138804 KB |
Output is correct |
64 |
Correct |
76 ms |
138832 KB |
Output is correct |
65 |
Correct |
76 ms |
138824 KB |
Output is correct |
66 |
Correct |
108 ms |
139956 KB |
Output is correct |
67 |
Correct |
176 ms |
150192 KB |
Output is correct |
68 |
Correct |
164 ms |
148636 KB |
Output is correct |
69 |
Correct |
193 ms |
148444 KB |
Output is correct |
70 |
Correct |
76 ms |
139084 KB |
Output is correct |
71 |
Correct |
168 ms |
148460 KB |
Output is correct |
72 |
Correct |
167 ms |
148720 KB |
Output is correct |
73 |
Correct |
164 ms |
148728 KB |
Output is correct |
74 |
Correct |
169 ms |
148940 KB |
Output is correct |
75 |
Correct |
166 ms |
147732 KB |
Output is correct |
76 |
Correct |
164 ms |
147292 KB |
Output is correct |
77 |
Correct |
162 ms |
148276 KB |
Output is correct |
78 |
Correct |
2550 ms |
193400 KB |
Output is correct |
79 |
Correct |
2608 ms |
188484 KB |
Output is correct |
80 |
Correct |
2635 ms |
190620 KB |
Output is correct |
81 |
Correct |
2364 ms |
196188 KB |
Output is correct |
82 |
Correct |
2636 ms |
201452 KB |
Output is correct |
83 |
Correct |
2492 ms |
195780 KB |
Output is correct |
84 |
Correct |
3880 ms |
198620 KB |
Output is correct |
85 |
Correct |
2781 ms |
195852 KB |
Output is correct |
86 |
Correct |
2659 ms |
201820 KB |
Output is correct |
87 |
Correct |
2665 ms |
202340 KB |
Output is correct |
88 |
Correct |
2653 ms |
204472 KB |
Output is correct |
89 |
Correct |
2777 ms |
200008 KB |
Output is correct |
90 |
Correct |
2652 ms |
203680 KB |
Output is correct |
91 |
Correct |
78 ms |
138820 KB |
Output is correct |
92 |
Correct |
85 ms |
138828 KB |
Output is correct |
93 |
Correct |
76 ms |
138828 KB |
Output is correct |
94 |
Correct |
113 ms |
140540 KB |
Output is correct |
95 |
Correct |
185 ms |
151300 KB |
Output is correct |
96 |
Correct |
179 ms |
149844 KB |
Output is correct |
97 |
Correct |
183 ms |
149532 KB |
Output is correct |
98 |
Correct |
84 ms |
139084 KB |
Output is correct |
99 |
Correct |
177 ms |
149628 KB |
Output is correct |
100 |
Correct |
190 ms |
149860 KB |
Output is correct |
101 |
Correct |
176 ms |
149904 KB |
Output is correct |
102 |
Correct |
169 ms |
150100 KB |
Output is correct |
103 |
Correct |
166 ms |
148940 KB |
Output is correct |
104 |
Correct |
164 ms |
148496 KB |
Output is correct |
105 |
Correct |
176 ms |
149452 KB |
Output is correct |
106 |
Correct |
2661 ms |
216272 KB |
Output is correct |
107 |
Correct |
2507 ms |
222352 KB |
Output is correct |
108 |
Correct |
2434 ms |
218852 KB |
Output is correct |
109 |
Correct |
2153 ms |
237296 KB |
Output is correct |
110 |
Correct |
2401 ms |
211684 KB |
Output is correct |
111 |
Correct |
2336 ms |
217328 KB |
Output is correct |
112 |
Correct |
2623 ms |
237128 KB |
Output is correct |
113 |
Correct |
2537 ms |
230484 KB |
Output is correct |
114 |
Correct |
2741 ms |
224744 KB |
Output is correct |
115 |
Correct |
2608 ms |
214508 KB |
Output is correct |
116 |
Correct |
2482 ms |
234608 KB |
Output is correct |
117 |
Correct |
2713 ms |
230000 KB |
Output is correct |
118 |
Correct |
2461 ms |
212312 KB |
Output is correct |
119 |
Correct |
3838 ms |
224892 KB |
Output is correct |
120 |
Correct |
2761 ms |
211220 KB |
Output is correct |
121 |
Correct |
2639 ms |
230452 KB |
Output is correct |
122 |
Correct |
2705 ms |
225144 KB |
Output is correct |
123 |
Correct |
2737 ms |
217800 KB |
Output is correct |
124 |
Correct |
2788 ms |
211764 KB |
Output is correct |
125 |
Correct |
2828 ms |
213484 KB |
Output is correct |
126 |
Correct |
2679 ms |
215500 KB |
Output is correct |
127 |
Correct |
2540 ms |
216388 KB |
Output is correct |
128 |
Correct |
2662 ms |
215484 KB |
Output is correct |
129 |
Execution timed out |
6081 ms |
210588 KB |
Time limit exceeded |
130 |
Halted |
0 ms |
0 KB |
- |