Submission #426413

# Submission time Handle Problem Language Result Execution time Memory
426413 2021-06-14T01:48:53 Z duality From Hacks to Snitches (BOI21_watchmen) C++11
80 / 100
6000 ms 264600 KB
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
typedef long long int LLI;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vpii;
#pragma GCC optimize("Ofast")

vi adjList[250000],adjList2[250000];
pair<int,pii> p[250000];
bool comp(int a,int b) {
    return p[a] < p[b];
}
int pos[250000];
vector<LLI> dist[250000];
priority_queue<pair<LLI,int> > H;
int relax(int u,LLI d) {
    if ((dist[u][d % p[u].first] == -1) || (d < dist[u][d % p[u].first])) {
        dist[u][d % p[u].first] = d;
        H.push(mp(-d,u));
    }
    return 0;
}
int done[250000],done2[250000];
set<pii> done3[250000];
int gcd(int a,int b) {
    int t;
    while (a > 0) t = b % a,b = a,a = t;
    return b;
}
int poss[3000][3000];
int ggcd[3000][3000];
int inv[3000][3000];
vi ll;
int main() {
    int i,j;
    int N,M,K;
    int u,v,l;
    scanf("%d %d",&N,&M);
    for (i = 0; i < M; i++) {
        scanf("%d %d",&u,&v);
        u--,v--;
        adjList[u].pb(v);
        adjList[v].pb(u);
    }
    scanf("%d",&K);
    for (i = 0; i < K; i++) {
        scanf("%d",&l),ll.pb(l);
        for (j = 0; j < l; j++) scanf("%d",&v),p[v-1] = mp(l,mp(j,i));
    }

    int k;
    for (i = 0; i < N; i++) {
        if (p[i].first == 0) p[i].first = 1;
        dist[i].resize(p[i].first);
        fill(dist[i].begin(),dist[i].end(),-1);
    }
    for (i = 0; i < N; i++) {
        sort(adjList[i].begin(),adjList[i].end(),comp);
        while ((pos[i] < adjList[i].size()) && (p[adjList[i][pos[i]]].first == 1)) pos[i]++;
        for (j = 0; j < adjList[i].size(); j++) {
            int v = adjList[i][j];
            if ((p[i].first > 1) && (p[v].first > 1) && (p[i].second.second != p[v].second.second)) adjList2[i].pb(v);
        }
    }
    for (i = 0; i < ll.size(); i++) {
        for (j = 0; j < ll.size(); j++) {
            int g = gcd(ll[i],ll[j]);
            poss[ll[i]/g][(ll[j] % ll[i])/g] = 1;
        }
    }
    for (i = 1; i < 3000; i++) {
        for (j = 0; j <= i; j++) {
            ggcd[i][j] = gcd(i,j);
            if (ggcd[i][j] == 1) {
                if (poss[i][j]) {
                    for (k = 1; k < i; k++) {
                        if (((j*k) % i) == 1) break;
                    }
                    inv[i][j] = k;
                }
            }
        }
    }
    dist[0][0] = 0,H.push(mp(0,0));
    while (!H.empty()) {
        int u = H.top().second;
        LLI d = -H.top().first;
        H.pop();

        if (d > dist[u][d % p[u].first]) continue;
        else if (u == N-1) {
            printf("%lld\n",d);
            return 0;
        }
        if ((p[u].first == 1) || (((d+1) % p[u].first) != p[u].second.first)) relax(u,d+1);
        if (done[u] && (dist[u][(d+p[u].first-1) % p[u].first] == d-1)) {
            for (i = 0; i < adjList2[u].size(); i++) {
                int v = adjList2[u][i];
                if (done3[v].count(mp(d % p[v].first,p[u].first))) continue;
                int a = p[u].first,b = p[v].second.first-d,c = p[v].first;
                b = ((b % c)+c) % c,a %= c;
                int g = ggcd[c][a];
                if ((b % g) == 0) {
                    j = (inv[c/g][a/g]*(b/g)) % (c/g);
                    LLI d2 = d+(LLI) j*p[u].first+1;
                    if ((d2 % p[v].first) != p[v].second.first) relax(v,d2);
                }
                done3[v].insert(mp(d % p[v].first,p[u].first));
            }
            continue;
        }
        for (i = done[u] ? pos[u]:0; i < adjList[u].size(); i++) {
            int v = adjList[u][i];
            if (p[v].first == 1) relax(v,d+1);
            else if (p[u].first == 1) {
                if (done2[v]) continue;
                else {
                    for (j = 0; j < p[v].first; j++) {
                        LLI d2 = d+j+1;
                        if ((d2 % p[v].first) != p[v].second.first) relax(v,d2);
                    }
                    done2[v] = 1;
                }
            }
            else if (p[u].second.second == p[v].second.second) {
                if (((d+1) % p[v].first) == p[v].second.first) continue;
                if (((d % p[v].first) == p[v].second.first) && (((d+1) % p[u].first) == p[u].second.first)) continue;
                relax(v,d+1);
            }
            else {
                if (done3[v].count(mp(d % p[v].first,p[u].first))) continue;
                for (j = 0; j < p[v].first; j++) {
                    LLI d2 = d+(LLI) j*p[u].first+1;
                    if ((d2 % p[v].first) != p[v].second.first) relax(v,d2);
                }
                done3[v].insert(mp(d % p[v].first,p[u].first));
            }
        }
        done[u] = 1;
    }
    printf("impossible\n");

    return 0;
}

Compilation message

watchmen.cpp: In function 'int main()':
watchmen.cpp:62:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   62 |         while ((pos[i] < adjList[i].size()) && (p[adjList[i][pos[i]]].first == 1)) pos[i]++;
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~
watchmen.cpp:63:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   63 |         for (j = 0; j < adjList[i].size(); j++) {
      |                     ~~^~~~~~~~~~~~~~~~~~~
watchmen.cpp:68:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   68 |     for (i = 0; i < ll.size(); i++) {
      |                 ~~^~~~~~~~~~~
watchmen.cpp:69:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   69 |         for (j = 0; j < ll.size(); j++) {
      |                     ~~^~~~~~~~~~~
watchmen.cpp:100:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  100 |             for (i = 0; i < adjList2[u].size(); i++) {
      |                         ~~^~~~~~~~~~~~~~~~~~~~
watchmen.cpp:115:40: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  115 |         for (i = done[u] ? pos[u]:0; i < adjList[u].size(); i++) {
      |                                      ~~^~~~~~~~~~~~~~~~~~~
watchmen.cpp:41:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   41 |     scanf("%d %d",&N,&M);
      |     ~~~~~^~~~~~~~~~~~~~~
watchmen.cpp:43:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   43 |         scanf("%d %d",&u,&v);
      |         ~~~~~^~~~~~~~~~~~~~~
watchmen.cpp:48:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   48 |     scanf("%d",&K);
      |     ~~~~~^~~~~~~~~
watchmen.cpp:50:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   50 |         scanf("%d",&l),ll.pb(l);
      |         ~~~~~^~~~~~~~~
watchmen.cpp:51:38: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   51 |         for (j = 0; j < l; j++) scanf("%d",&v),p[v-1] = mp(l,mp(j,i));
      |                                 ~~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 288 ms 59196 KB Output is correct
2 Correct 425 ms 66784 KB Output is correct
3 Correct 379 ms 66516 KB Output is correct
4 Correct 392 ms 66880 KB Output is correct
5 Correct 250 ms 57388 KB Output is correct
6 Correct 360 ms 66604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 287 ms 59348 KB Output is correct
2 Correct 367 ms 66828 KB Output is correct
3 Correct 370 ms 66628 KB Output is correct
4 Correct 403 ms 67044 KB Output is correct
5 Correct 251 ms 57324 KB Output is correct
6 Correct 382 ms 66504 KB Output is correct
7 Correct 353 ms 66108 KB Output is correct
8 Correct 377 ms 66400 KB Output is correct
9 Correct 364 ms 66108 KB Output is correct
10 Correct 372 ms 66612 KB Output is correct
11 Correct 383 ms 66536 KB Output is correct
12 Correct 372 ms 66356 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 287 ms 59348 KB Output is correct
2 Correct 367 ms 66828 KB Output is correct
3 Correct 370 ms 66628 KB Output is correct
4 Correct 403 ms 67044 KB Output is correct
5 Correct 251 ms 57324 KB Output is correct
6 Correct 382 ms 66504 KB Output is correct
7 Correct 353 ms 66108 KB Output is correct
8 Correct 377 ms 66400 KB Output is correct
9 Correct 364 ms 66108 KB Output is correct
10 Correct 372 ms 66612 KB Output is correct
11 Correct 383 ms 66536 KB Output is correct
12 Correct 372 ms 66356 KB Output is correct
13 Correct 287 ms 59256 KB Output is correct
14 Correct 380 ms 66900 KB Output is correct
15 Correct 354 ms 66632 KB Output is correct
16 Correct 371 ms 66928 KB Output is correct
17 Correct 262 ms 57448 KB Output is correct
18 Correct 355 ms 66616 KB Output is correct
19 Correct 363 ms 66244 KB Output is correct
20 Correct 367 ms 66428 KB Output is correct
21 Correct 396 ms 66180 KB Output is correct
22 Correct 357 ms 66524 KB Output is correct
23 Correct 374 ms 66408 KB Output is correct
24 Correct 344 ms 66356 KB Output is correct
25 Correct 3165 ms 115976 KB Output is correct
26 Correct 3209 ms 120416 KB Output is correct
27 Correct 2916 ms 116680 KB Output is correct
28 Correct 2266 ms 119496 KB Output is correct
29 Correct 2889 ms 113088 KB Output is correct
30 Correct 3123 ms 113720 KB Output is correct
31 Correct 3562 ms 118640 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 287 ms 59348 KB Output is correct
2 Correct 367 ms 66828 KB Output is correct
3 Correct 370 ms 66628 KB Output is correct
4 Correct 403 ms 67044 KB Output is correct
5 Correct 251 ms 57324 KB Output is correct
6 Correct 382 ms 66504 KB Output is correct
7 Correct 353 ms 66108 KB Output is correct
8 Correct 377 ms 66400 KB Output is correct
9 Correct 364 ms 66108 KB Output is correct
10 Correct 372 ms 66612 KB Output is correct
11 Correct 383 ms 66536 KB Output is correct
12 Correct 372 ms 66356 KB Output is correct
13 Correct 287 ms 59256 KB Output is correct
14 Correct 380 ms 66900 KB Output is correct
15 Correct 354 ms 66632 KB Output is correct
16 Correct 371 ms 66928 KB Output is correct
17 Correct 262 ms 57448 KB Output is correct
18 Correct 355 ms 66616 KB Output is correct
19 Correct 363 ms 66244 KB Output is correct
20 Correct 367 ms 66428 KB Output is correct
21 Correct 396 ms 66180 KB Output is correct
22 Correct 357 ms 66524 KB Output is correct
23 Correct 374 ms 66408 KB Output is correct
24 Correct 344 ms 66356 KB Output is correct
25 Correct 3165 ms 115976 KB Output is correct
26 Correct 3209 ms 120416 KB Output is correct
27 Correct 2916 ms 116680 KB Output is correct
28 Correct 2266 ms 119496 KB Output is correct
29 Correct 2889 ms 113088 KB Output is correct
30 Correct 3123 ms 113720 KB Output is correct
31 Correct 3562 ms 118640 KB Output is correct
32 Correct 277 ms 59352 KB Output is correct
33 Correct 407 ms 66868 KB Output is correct
34 Correct 353 ms 66632 KB Output is correct
35 Correct 367 ms 66956 KB Output is correct
36 Correct 267 ms 57388 KB Output is correct
37 Correct 356 ms 66548 KB Output is correct
38 Correct 364 ms 66168 KB Output is correct
39 Correct 362 ms 66496 KB Output is correct
40 Correct 357 ms 66136 KB Output is correct
41 Correct 352 ms 66604 KB Output is correct
42 Correct 422 ms 66412 KB Output is correct
43 Correct 366 ms 66388 KB Output is correct
44 Correct 3258 ms 113860 KB Output is correct
45 Correct 3119 ms 118120 KB Output is correct
46 Correct 3055 ms 115012 KB Output is correct
47 Correct 2279 ms 117824 KB Output is correct
48 Correct 2958 ms 111300 KB Output is correct
49 Correct 2985 ms 114064 KB Output is correct
50 Correct 3525 ms 118808 KB Output is correct
51 Correct 3817 ms 131228 KB Output is correct
52 Correct 4009 ms 148028 KB Output is correct
53 Correct 3603 ms 149744 KB Output is correct
54 Correct 2186 ms 110712 KB Output is correct
55 Correct 3995 ms 196120 KB Output is correct
56 Correct 3945 ms 150492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 288 ms 59196 KB Output is correct
2 Correct 425 ms 66784 KB Output is correct
3 Correct 379 ms 66516 KB Output is correct
4 Correct 392 ms 66880 KB Output is correct
5 Correct 250 ms 57388 KB Output is correct
6 Correct 360 ms 66604 KB Output is correct
7 Correct 287 ms 59348 KB Output is correct
8 Correct 367 ms 66828 KB Output is correct
9 Correct 370 ms 66628 KB Output is correct
10 Correct 403 ms 67044 KB Output is correct
11 Correct 251 ms 57324 KB Output is correct
12 Correct 382 ms 66504 KB Output is correct
13 Correct 353 ms 66108 KB Output is correct
14 Correct 377 ms 66400 KB Output is correct
15 Correct 364 ms 66108 KB Output is correct
16 Correct 372 ms 66612 KB Output is correct
17 Correct 383 ms 66536 KB Output is correct
18 Correct 372 ms 66356 KB Output is correct
19 Correct 254 ms 57284 KB Output is correct
20 Correct 252 ms 57280 KB Output is correct
21 Correct 254 ms 57212 KB Output is correct
22 Correct 286 ms 59200 KB Output is correct
23 Correct 367 ms 66728 KB Output is correct
24 Correct 372 ms 66624 KB Output is correct
25 Correct 382 ms 66888 KB Output is correct
26 Correct 263 ms 57372 KB Output is correct
27 Correct 380 ms 66832 KB Output is correct
28 Correct 373 ms 66140 KB Output is correct
29 Correct 356 ms 66376 KB Output is correct
30 Correct 368 ms 66160 KB Output is correct
31 Correct 365 ms 66640 KB Output is correct
32 Correct 355 ms 66444 KB Output is correct
33 Correct 371 ms 66348 KB Output is correct
34 Correct 3333 ms 116916 KB Output is correct
35 Correct 3421 ms 113400 KB Output is correct
36 Correct 3340 ms 113580 KB Output is correct
37 Correct 3284 ms 117928 KB Output is correct
38 Correct 3331 ms 113260 KB Output is correct
39 Correct 2958 ms 110812 KB Output is correct
40 Correct 3102 ms 111384 KB Output is correct
41 Correct 3064 ms 110420 KB Output is correct
42 Correct 3292 ms 113096 KB Output is correct
43 Correct 3353 ms 117216 KB Output is correct
44 Correct 3429 ms 117584 KB Output is correct
45 Correct 3439 ms 113064 KB Output is correct
46 Correct 3328 ms 112992 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 288 ms 59196 KB Output is correct
2 Correct 425 ms 66784 KB Output is correct
3 Correct 379 ms 66516 KB Output is correct
4 Correct 392 ms 66880 KB Output is correct
5 Correct 250 ms 57388 KB Output is correct
6 Correct 360 ms 66604 KB Output is correct
7 Correct 287 ms 59348 KB Output is correct
8 Correct 367 ms 66828 KB Output is correct
9 Correct 370 ms 66628 KB Output is correct
10 Correct 403 ms 67044 KB Output is correct
11 Correct 251 ms 57324 KB Output is correct
12 Correct 382 ms 66504 KB Output is correct
13 Correct 353 ms 66108 KB Output is correct
14 Correct 377 ms 66400 KB Output is correct
15 Correct 364 ms 66108 KB Output is correct
16 Correct 372 ms 66612 KB Output is correct
17 Correct 383 ms 66536 KB Output is correct
18 Correct 372 ms 66356 KB Output is correct
19 Correct 287 ms 59256 KB Output is correct
20 Correct 380 ms 66900 KB Output is correct
21 Correct 354 ms 66632 KB Output is correct
22 Correct 371 ms 66928 KB Output is correct
23 Correct 262 ms 57448 KB Output is correct
24 Correct 355 ms 66616 KB Output is correct
25 Correct 363 ms 66244 KB Output is correct
26 Correct 367 ms 66428 KB Output is correct
27 Correct 396 ms 66180 KB Output is correct
28 Correct 357 ms 66524 KB Output is correct
29 Correct 374 ms 66408 KB Output is correct
30 Correct 344 ms 66356 KB Output is correct
31 Correct 3165 ms 115976 KB Output is correct
32 Correct 3209 ms 120416 KB Output is correct
33 Correct 2916 ms 116680 KB Output is correct
34 Correct 2266 ms 119496 KB Output is correct
35 Correct 2889 ms 113088 KB Output is correct
36 Correct 3123 ms 113720 KB Output is correct
37 Correct 3562 ms 118640 KB Output is correct
38 Correct 254 ms 57284 KB Output is correct
39 Correct 252 ms 57280 KB Output is correct
40 Correct 254 ms 57212 KB Output is correct
41 Correct 286 ms 59200 KB Output is correct
42 Correct 367 ms 66728 KB Output is correct
43 Correct 372 ms 66624 KB Output is correct
44 Correct 382 ms 66888 KB Output is correct
45 Correct 263 ms 57372 KB Output is correct
46 Correct 380 ms 66832 KB Output is correct
47 Correct 373 ms 66140 KB Output is correct
48 Correct 356 ms 66376 KB Output is correct
49 Correct 368 ms 66160 KB Output is correct
50 Correct 365 ms 66640 KB Output is correct
51 Correct 355 ms 66444 KB Output is correct
52 Correct 371 ms 66348 KB Output is correct
53 Correct 3333 ms 116916 KB Output is correct
54 Correct 3421 ms 113400 KB Output is correct
55 Correct 3340 ms 113580 KB Output is correct
56 Correct 3284 ms 117928 KB Output is correct
57 Correct 3331 ms 113260 KB Output is correct
58 Correct 2958 ms 110812 KB Output is correct
59 Correct 3102 ms 111384 KB Output is correct
60 Correct 3064 ms 110420 KB Output is correct
61 Correct 3292 ms 113096 KB Output is correct
62 Correct 3353 ms 117216 KB Output is correct
63 Correct 3429 ms 117584 KB Output is correct
64 Correct 3439 ms 113064 KB Output is correct
65 Correct 3328 ms 112992 KB Output is correct
66 Correct 256 ms 57216 KB Output is correct
67 Correct 263 ms 57276 KB Output is correct
68 Correct 258 ms 57276 KB Output is correct
69 Correct 283 ms 59208 KB Output is correct
70 Correct 377 ms 66884 KB Output is correct
71 Correct 371 ms 66620 KB Output is correct
72 Correct 367 ms 66936 KB Output is correct
73 Correct 255 ms 57508 KB Output is correct
74 Correct 379 ms 66676 KB Output is correct
75 Correct 358 ms 66116 KB Output is correct
76 Correct 360 ms 66528 KB Output is correct
77 Correct 361 ms 66156 KB Output is correct
78 Correct 390 ms 66628 KB Output is correct
79 Correct 352 ms 66452 KB Output is correct
80 Correct 366 ms 66372 KB Output is correct
81 Correct 3118 ms 113236 KB Output is correct
82 Correct 3080 ms 117692 KB Output is correct
83 Correct 2871 ms 114272 KB Output is correct
84 Correct 2340 ms 117196 KB Output is correct
85 Correct 3009 ms 110408 KB Output is correct
86 Correct 3041 ms 113132 KB Output is correct
87 Correct 3332 ms 118096 KB Output is correct
88 Correct 2986 ms 114220 KB Output is correct
89 Correct 3256 ms 110796 KB Output is correct
90 Correct 3384 ms 108320 KB Output is correct
91 Correct 2978 ms 112868 KB Output is correct
92 Correct 3115 ms 112924 KB Output is correct
93 Correct 3163 ms 113032 KB Output is correct
94 Correct 3151 ms 112220 KB Output is correct
95 Correct 3124 ms 111404 KB Output is correct
96 Correct 3368 ms 113748 KB Output is correct
97 Correct 3331 ms 117052 KB Output is correct
98 Correct 3404 ms 117060 KB Output is correct
99 Correct 3431 ms 112748 KB Output is correct
100 Correct 3484 ms 112724 KB Output is correct
101 Correct 3172 ms 114088 KB Output is correct
102 Correct 3165 ms 115228 KB Output is correct
103 Correct 3237 ms 112992 KB Output is correct
104 Correct 3157 ms 116376 KB Output is correct
105 Correct 3578 ms 113116 KB Output is correct
106 Correct 3356 ms 111676 KB Output is correct
107 Correct 3305 ms 111696 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 288 ms 59196 KB Output is correct
2 Correct 425 ms 66784 KB Output is correct
3 Correct 379 ms 66516 KB Output is correct
4 Correct 392 ms 66880 KB Output is correct
5 Correct 250 ms 57388 KB Output is correct
6 Correct 360 ms 66604 KB Output is correct
7 Correct 287 ms 59348 KB Output is correct
8 Correct 367 ms 66828 KB Output is correct
9 Correct 370 ms 66628 KB Output is correct
10 Correct 403 ms 67044 KB Output is correct
11 Correct 251 ms 57324 KB Output is correct
12 Correct 382 ms 66504 KB Output is correct
13 Correct 353 ms 66108 KB Output is correct
14 Correct 377 ms 66400 KB Output is correct
15 Correct 364 ms 66108 KB Output is correct
16 Correct 372 ms 66612 KB Output is correct
17 Correct 383 ms 66536 KB Output is correct
18 Correct 372 ms 66356 KB Output is correct
19 Correct 287 ms 59256 KB Output is correct
20 Correct 380 ms 66900 KB Output is correct
21 Correct 354 ms 66632 KB Output is correct
22 Correct 371 ms 66928 KB Output is correct
23 Correct 262 ms 57448 KB Output is correct
24 Correct 355 ms 66616 KB Output is correct
25 Correct 363 ms 66244 KB Output is correct
26 Correct 367 ms 66428 KB Output is correct
27 Correct 396 ms 66180 KB Output is correct
28 Correct 357 ms 66524 KB Output is correct
29 Correct 374 ms 66408 KB Output is correct
30 Correct 344 ms 66356 KB Output is correct
31 Correct 3165 ms 115976 KB Output is correct
32 Correct 3209 ms 120416 KB Output is correct
33 Correct 2916 ms 116680 KB Output is correct
34 Correct 2266 ms 119496 KB Output is correct
35 Correct 2889 ms 113088 KB Output is correct
36 Correct 3123 ms 113720 KB Output is correct
37 Correct 3562 ms 118640 KB Output is correct
38 Correct 277 ms 59352 KB Output is correct
39 Correct 407 ms 66868 KB Output is correct
40 Correct 353 ms 66632 KB Output is correct
41 Correct 367 ms 66956 KB Output is correct
42 Correct 267 ms 57388 KB Output is correct
43 Correct 356 ms 66548 KB Output is correct
44 Correct 364 ms 66168 KB Output is correct
45 Correct 362 ms 66496 KB Output is correct
46 Correct 357 ms 66136 KB Output is correct
47 Correct 352 ms 66604 KB Output is correct
48 Correct 422 ms 66412 KB Output is correct
49 Correct 366 ms 66388 KB Output is correct
50 Correct 3258 ms 113860 KB Output is correct
51 Correct 3119 ms 118120 KB Output is correct
52 Correct 3055 ms 115012 KB Output is correct
53 Correct 2279 ms 117824 KB Output is correct
54 Correct 2958 ms 111300 KB Output is correct
55 Correct 2985 ms 114064 KB Output is correct
56 Correct 3525 ms 118808 KB Output is correct
57 Correct 3817 ms 131228 KB Output is correct
58 Correct 4009 ms 148028 KB Output is correct
59 Correct 3603 ms 149744 KB Output is correct
60 Correct 2186 ms 110712 KB Output is correct
61 Correct 3995 ms 196120 KB Output is correct
62 Correct 3945 ms 150492 KB Output is correct
63 Correct 254 ms 57284 KB Output is correct
64 Correct 252 ms 57280 KB Output is correct
65 Correct 254 ms 57212 KB Output is correct
66 Correct 286 ms 59200 KB Output is correct
67 Correct 367 ms 66728 KB Output is correct
68 Correct 372 ms 66624 KB Output is correct
69 Correct 382 ms 66888 KB Output is correct
70 Correct 263 ms 57372 KB Output is correct
71 Correct 380 ms 66832 KB Output is correct
72 Correct 373 ms 66140 KB Output is correct
73 Correct 356 ms 66376 KB Output is correct
74 Correct 368 ms 66160 KB Output is correct
75 Correct 365 ms 66640 KB Output is correct
76 Correct 355 ms 66444 KB Output is correct
77 Correct 371 ms 66348 KB Output is correct
78 Correct 3333 ms 116916 KB Output is correct
79 Correct 3421 ms 113400 KB Output is correct
80 Correct 3340 ms 113580 KB Output is correct
81 Correct 3284 ms 117928 KB Output is correct
82 Correct 3331 ms 113260 KB Output is correct
83 Correct 2958 ms 110812 KB Output is correct
84 Correct 3102 ms 111384 KB Output is correct
85 Correct 3064 ms 110420 KB Output is correct
86 Correct 3292 ms 113096 KB Output is correct
87 Correct 3353 ms 117216 KB Output is correct
88 Correct 3429 ms 117584 KB Output is correct
89 Correct 3439 ms 113064 KB Output is correct
90 Correct 3328 ms 112992 KB Output is correct
91 Correct 256 ms 57216 KB Output is correct
92 Correct 263 ms 57276 KB Output is correct
93 Correct 258 ms 57276 KB Output is correct
94 Correct 283 ms 59208 KB Output is correct
95 Correct 377 ms 66884 KB Output is correct
96 Correct 371 ms 66620 KB Output is correct
97 Correct 367 ms 66936 KB Output is correct
98 Correct 255 ms 57508 KB Output is correct
99 Correct 379 ms 66676 KB Output is correct
100 Correct 358 ms 66116 KB Output is correct
101 Correct 360 ms 66528 KB Output is correct
102 Correct 361 ms 66156 KB Output is correct
103 Correct 390 ms 66628 KB Output is correct
104 Correct 352 ms 66452 KB Output is correct
105 Correct 366 ms 66372 KB Output is correct
106 Correct 3118 ms 113236 KB Output is correct
107 Correct 3080 ms 117692 KB Output is correct
108 Correct 2871 ms 114272 KB Output is correct
109 Correct 2340 ms 117196 KB Output is correct
110 Correct 3009 ms 110408 KB Output is correct
111 Correct 3041 ms 113132 KB Output is correct
112 Correct 3332 ms 118096 KB Output is correct
113 Correct 2986 ms 114220 KB Output is correct
114 Correct 3256 ms 110796 KB Output is correct
115 Correct 3384 ms 108320 KB Output is correct
116 Correct 2978 ms 112868 KB Output is correct
117 Correct 3115 ms 112924 KB Output is correct
118 Correct 3163 ms 113032 KB Output is correct
119 Correct 3151 ms 112220 KB Output is correct
120 Correct 3124 ms 111404 KB Output is correct
121 Correct 3368 ms 113748 KB Output is correct
122 Correct 3331 ms 117052 KB Output is correct
123 Correct 3404 ms 117060 KB Output is correct
124 Correct 3431 ms 112748 KB Output is correct
125 Correct 3484 ms 112724 KB Output is correct
126 Correct 3172 ms 114088 KB Output is correct
127 Correct 3165 ms 115228 KB Output is correct
128 Correct 3237 ms 112992 KB Output is correct
129 Correct 3157 ms 116376 KB Output is correct
130 Correct 3578 ms 113116 KB Output is correct
131 Correct 3356 ms 111676 KB Output is correct
132 Correct 3305 ms 111696 KB Output is correct
133 Correct 256 ms 57308 KB Output is correct
134 Correct 255 ms 57284 KB Output is correct
135 Correct 258 ms 57316 KB Output is correct
136 Correct 308 ms 59204 KB Output is correct
137 Correct 382 ms 66704 KB Output is correct
138 Correct 361 ms 66608 KB Output is correct
139 Correct 377 ms 67040 KB Output is correct
140 Correct 261 ms 57448 KB Output is correct
141 Correct 372 ms 66628 KB Output is correct
142 Correct 382 ms 66116 KB Output is correct
143 Correct 359 ms 66372 KB Output is correct
144 Correct 356 ms 66128 KB Output is correct
145 Correct 359 ms 66792 KB Output is correct
146 Correct 378 ms 66560 KB Output is correct
147 Correct 355 ms 66440 KB Output is correct
148 Correct 3153 ms 113152 KB Output is correct
149 Correct 2890 ms 117300 KB Output is correct
150 Correct 2724 ms 113876 KB Output is correct
151 Correct 2257 ms 116960 KB Output is correct
152 Correct 3008 ms 110420 KB Output is correct
153 Correct 2916 ms 113096 KB Output is correct
154 Correct 3326 ms 118040 KB Output is correct
155 Correct 3668 ms 130116 KB Output is correct
156 Correct 3763 ms 146620 KB Output is correct
157 Correct 3721 ms 148232 KB Output is correct
158 Correct 2270 ms 109412 KB Output is correct
159 Correct 3923 ms 194808 KB Output is correct
160 Correct 3708 ms 152460 KB Output is correct
161 Correct 3282 ms 114232 KB Output is correct
162 Correct 3411 ms 110548 KB Output is correct
163 Correct 3582 ms 110448 KB Output is correct
164 Correct 3041 ms 115044 KB Output is correct
165 Correct 3219 ms 112672 KB Output is correct
166 Correct 3054 ms 110472 KB Output is correct
167 Correct 3033 ms 110980 KB Output is correct
168 Correct 3053 ms 109960 KB Output is correct
169 Correct 3205 ms 112648 KB Output is correct
170 Correct 3367 ms 116520 KB Output is correct
171 Correct 3351 ms 116984 KB Output is correct
172 Correct 3518 ms 112484 KB Output is correct
173 Correct 3209 ms 112532 KB Output is correct
174 Correct 3311 ms 113944 KB Output is correct
175 Correct 2845 ms 114912 KB Output is correct
176 Correct 3015 ms 112720 KB Output is correct
177 Correct 3089 ms 116032 KB Output is correct
178 Correct 3283 ms 113772 KB Output is correct
179 Correct 3364 ms 112436 KB Output is correct
180 Correct 3200 ms 112620 KB Output is correct
181 Correct 3171 ms 114596 KB Output is correct
182 Correct 2976 ms 117256 KB Output is correct
183 Correct 3713 ms 131636 KB Output is correct
184 Execution timed out 6064 ms 264600 KB Time limit exceeded
185 Halted 0 ms 0 KB -