답안 #443444

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
443444 2021-07-10T13:52:20 Z leinad2 분수 공원 (IOI21_parks) C++17
70 / 100
505 ms 76500 KB
#include "parks.h"
#include<bits/stdc++.h>
using namespace std;
int par[400010], chk[400010], chk2[400010], A[400010][2], vis[400010];
int Find(int v){return v==par[v]?v:par[v]=Find(par[v]);}
vector<pair<int, int> >v;
int cnt;
map<pair<int, int>, int>mp;
vector<pair<int, int> >adj[400010];
vector<int>_u, _v, _a, _b;
void dfs(int v)
{
    for(int i=0;i<adj[v].size();i++)
    {
        int p=adj[v][i].first;
        if(!vis[p])vis[p]=1,dfs(p),_a[adj[v][i].second]=p;
    }
}
int construct_roads(vector<int>x, vector<int>y)
{
    int n, i, j, k, a, b;
    n=x.size();
    vector<pair<pair<int, int>, int> >V;
    for(i=0;i<n;i++)
    {
        V.push_back({{x[i], y[i]}, i});
    }
    sort(V.begin(), V.end());
    for(i=1;i<V.size();i++)
    {
        if(V[i].first.first==V[i-1].first.first&&V[i].first.second==V[i-1].first.second+2)
        {
            v.push_back({V[i].second, V[i-1].second});
        }
    }
    for(i=0;i<n;i++)
    {
        swap(V[i].first.first, V[i].first.second);
    }
    sort(V.begin(), V.end());
    for(i=1;i<V.size();i++)
    {
        if(V[i].first.first==V[i-1].first.first&&V[i].first.second==V[i-1].first.second+2)
        {
            v.push_back({V[i].second, V[i-1].second});
        }
    }
    for(i=0;i<n;i++)par[i]=i;
    for(i=0;i<v.size();i++)
    {
        if(Find(v[i].first)!=Find(v[i].second))
        {
            _u.push_back(v[i].first);
            _v.push_back(v[i].second);
            par[Find(v[i].first)]=Find(v[i].second);
        }
    }
    if(_u.size()!=n-1)return 0;
    vector<pair<int, int> >edge;
    _a.resize(n-1);_b.resize(n-1);
    for(i=0;i<_u.size();i++)
    {
        int a=_u[i], b=_v[i], q, w, e, r;
        if(x[a]==x[b])
        {
            q=x[a]-1;e=x[a]+1;
            w=r=(y[a]+y[b])/2;
        }
        else
        {
            w=y[a]-1;r=y[a]+1;
            q=e=(x[a]+x[b])/2;
        }
        if(mp.find({q, w})==mp.end())mp[{q, w}]=++cnt,A[cnt][0]=q,A[cnt][1]=w;
        if(mp.find({e, r})==mp.end())mp[{e, r}]=++cnt,A[cnt][0]=e,A[cnt][1]=r;
        int x=mp[{q, w}];int y=mp[{e, r}];
        edge.push_back({x, y});
    }
    for(i=0;i++<cnt;)par[i]=i;
    for(i=0;i<edge.size();i++)par[Find(edge[i].first)]=Find(edge[i].second);
    for(i=0;i++<cnt;)chk[Find(i)]++;
    for(i=0;i<edge.size();i++)chk2[Find(edge[i].first)]++;
    for(i=0;i<edge.size();i++)
    {
        adj[edge[i].first].push_back({edge[i].second, i});
        adj[edge[i].second].push_back({edge[i].first, i});
    }
    for(i=0;i++<cnt;)
    {
        if(chk[i])
        {
            if(chk[i]<chk2[i])return 0;
            else vis[i]=1,dfs(i);
        }
    }
    for(i=0;i<_a.size();i++)
    {
        if(_a[i]==0)_a[i]=Find(edge[i].first);
        int a=_a[i];
        _a[i]=A[a][0];_b[i]=A[a][1];
    }
    build(_u, _v, _a, _b);
    return 1;
}

Compilation message

parks.cpp: In function 'void dfs(int)':
parks.cpp:13:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     for(int i=0;i<adj[v].size();i++)
      |                 ~^~~~~~~~~~~~~~
parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:29:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<std::pair<int, int>, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |     for(i=1;i<V.size();i++)
      |             ~^~~~~~~~~
parks.cpp:41:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<std::pair<int, int>, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   41 |     for(i=1;i<V.size();i++)
      |             ~^~~~~~~~~
parks.cpp:49:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   49 |     for(i=0;i<v.size();i++)
      |             ~^~~~~~~~~
parks.cpp:58:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   58 |     if(_u.size()!=n-1)return 0;
      |        ~~~~~~~~~^~~~~
parks.cpp:61:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   61 |     for(i=0;i<_u.size();i++)
      |             ~^~~~~~~~~~
parks.cpp:80:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   80 |     for(i=0;i<edge.size();i++)par[Find(edge[i].first)]=Find(edge[i].second);
      |             ~^~~~~~~~~~~~
parks.cpp:82:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   82 |     for(i=0;i<edge.size();i++)chk2[Find(edge[i].first)]++;
      |             ~^~~~~~~~~~~~
parks.cpp:83:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   83 |     for(i=0;i<edge.size();i++)
      |             ~^~~~~~~~~~~~
parks.cpp:96:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   96 |     for(i=0;i<_a.size();i++)
      |             ~^~~~~~~~~~
parks.cpp:21:15: warning: unused variable 'j' [-Wunused-variable]
   21 |     int n, i, j, k, a, b;
      |               ^
parks.cpp:21:18: warning: unused variable 'k' [-Wunused-variable]
   21 |     int n, i, j, k, a, b;
      |                  ^
parks.cpp:21:21: warning: unused variable 'a' [-Wunused-variable]
   21 |     int n, i, j, k, a, b;
      |                     ^
parks.cpp:21:24: warning: unused variable 'b' [-Wunused-variable]
   21 |     int n, i, j, k, a, b;
      |                        ^
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 9676 KB Output is correct
2 Correct 7 ms 9676 KB Output is correct
3 Correct 6 ms 9676 KB Output is correct
4 Correct 6 ms 9676 KB Output is correct
5 Correct 7 ms 9676 KB Output is correct
6 Correct 6 ms 9676 KB Output is correct
7 Correct 6 ms 9632 KB Output is correct
8 Correct 6 ms 9676 KB Output is correct
9 Correct 235 ms 42320 KB Output is correct
10 Correct 24 ms 12944 KB Output is correct
11 Correct 131 ms 27128 KB Output is correct
12 Correct 35 ms 14532 KB Output is correct
13 Correct 22 ms 12104 KB Output is correct
14 Correct 7 ms 9676 KB Output is correct
15 Correct 7 ms 9804 KB Output is correct
16 Correct 232 ms 42256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 9676 KB Output is correct
2 Correct 7 ms 9676 KB Output is correct
3 Correct 6 ms 9676 KB Output is correct
4 Correct 6 ms 9676 KB Output is correct
5 Correct 7 ms 9676 KB Output is correct
6 Correct 6 ms 9676 KB Output is correct
7 Correct 6 ms 9632 KB Output is correct
8 Correct 6 ms 9676 KB Output is correct
9 Correct 235 ms 42320 KB Output is correct
10 Correct 24 ms 12944 KB Output is correct
11 Correct 131 ms 27128 KB Output is correct
12 Correct 35 ms 14532 KB Output is correct
13 Correct 22 ms 12104 KB Output is correct
14 Correct 7 ms 9676 KB Output is correct
15 Correct 7 ms 9804 KB Output is correct
16 Correct 232 ms 42256 KB Output is correct
17 Correct 7 ms 9632 KB Output is correct
18 Correct 7 ms 9676 KB Output is correct
19 Correct 6 ms 9676 KB Output is correct
20 Correct 6 ms 9676 KB Output is correct
21 Correct 6 ms 9676 KB Output is correct
22 Correct 7 ms 9676 KB Output is correct
23 Correct 451 ms 62484 KB Output is correct
24 Correct 6 ms 9676 KB Output is correct
25 Correct 8 ms 10060 KB Output is correct
26 Correct 10 ms 9804 KB Output is correct
27 Correct 11 ms 9932 KB Output is correct
28 Correct 193 ms 30800 KB Output is correct
29 Correct 258 ms 41348 KB Output is correct
30 Correct 346 ms 51772 KB Output is correct
31 Correct 449 ms 62468 KB Output is correct
32 Correct 7 ms 9676 KB Output is correct
33 Correct 7 ms 9676 KB Output is correct
34 Correct 6 ms 9676 KB Output is correct
35 Correct 6 ms 9628 KB Output is correct
36 Correct 8 ms 9676 KB Output is correct
37 Correct 7 ms 9676 KB Output is correct
38 Correct 8 ms 9720 KB Output is correct
39 Correct 7 ms 9676 KB Output is correct
40 Correct 6 ms 9676 KB Output is correct
41 Correct 7 ms 9676 KB Output is correct
42 Correct 7 ms 9676 KB Output is correct
43 Correct 7 ms 9804 KB Output is correct
44 Correct 8 ms 9840 KB Output is correct
45 Correct 205 ms 34920 KB Output is correct
46 Correct 301 ms 46388 KB Output is correct
47 Correct 320 ms 46276 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 9676 KB Output is correct
2 Correct 7 ms 9676 KB Output is correct
3 Correct 6 ms 9676 KB Output is correct
4 Correct 6 ms 9676 KB Output is correct
5 Correct 7 ms 9676 KB Output is correct
6 Correct 6 ms 9676 KB Output is correct
7 Correct 6 ms 9632 KB Output is correct
8 Correct 6 ms 9676 KB Output is correct
9 Correct 235 ms 42320 KB Output is correct
10 Correct 24 ms 12944 KB Output is correct
11 Correct 131 ms 27128 KB Output is correct
12 Correct 35 ms 14532 KB Output is correct
13 Correct 22 ms 12104 KB Output is correct
14 Correct 7 ms 9676 KB Output is correct
15 Correct 7 ms 9804 KB Output is correct
16 Correct 232 ms 42256 KB Output is correct
17 Correct 7 ms 9632 KB Output is correct
18 Correct 7 ms 9676 KB Output is correct
19 Correct 6 ms 9676 KB Output is correct
20 Correct 6 ms 9676 KB Output is correct
21 Correct 6 ms 9676 KB Output is correct
22 Correct 7 ms 9676 KB Output is correct
23 Correct 451 ms 62484 KB Output is correct
24 Correct 6 ms 9676 KB Output is correct
25 Correct 8 ms 10060 KB Output is correct
26 Correct 10 ms 9804 KB Output is correct
27 Correct 11 ms 9932 KB Output is correct
28 Correct 193 ms 30800 KB Output is correct
29 Correct 258 ms 41348 KB Output is correct
30 Correct 346 ms 51772 KB Output is correct
31 Correct 449 ms 62468 KB Output is correct
32 Correct 7 ms 9676 KB Output is correct
33 Correct 7 ms 9676 KB Output is correct
34 Correct 6 ms 9676 KB Output is correct
35 Correct 6 ms 9628 KB Output is correct
36 Correct 8 ms 9676 KB Output is correct
37 Correct 7 ms 9676 KB Output is correct
38 Correct 8 ms 9720 KB Output is correct
39 Correct 7 ms 9676 KB Output is correct
40 Correct 6 ms 9676 KB Output is correct
41 Correct 7 ms 9676 KB Output is correct
42 Correct 7 ms 9676 KB Output is correct
43 Correct 7 ms 9804 KB Output is correct
44 Correct 8 ms 9840 KB Output is correct
45 Correct 205 ms 34920 KB Output is correct
46 Correct 301 ms 46388 KB Output is correct
47 Correct 320 ms 46276 KB Output is correct
48 Correct 6 ms 9676 KB Output is correct
49 Correct 6 ms 9676 KB Output is correct
50 Correct 7 ms 9652 KB Output is correct
51 Correct 6 ms 9676 KB Output is correct
52 Correct 8 ms 9680 KB Output is correct
53 Correct 8 ms 9676 KB Output is correct
54 Correct 7 ms 9676 KB Output is correct
55 Correct 412 ms 58844 KB Output is correct
56 Correct 6 ms 9676 KB Output is correct
57 Correct 11 ms 10188 KB Output is correct
58 Correct 18 ms 11340 KB Output is correct
59 Correct 11 ms 10256 KB Output is correct
60 Correct 194 ms 34344 KB Output is correct
61 Correct 279 ms 42808 KB Output is correct
62 Correct 334 ms 50312 KB Output is correct
63 Correct 402 ms 58864 KB Output is correct
64 Correct 6 ms 9676 KB Output is correct
65 Correct 6 ms 9728 KB Output is correct
66 Correct 7 ms 9676 KB Output is correct
67 Correct 505 ms 74608 KB Output is correct
68 Correct 490 ms 74552 KB Output is correct
69 Correct 483 ms 74292 KB Output is correct
70 Correct 8 ms 9872 KB Output is correct
71 Correct 9 ms 10016 KB Output is correct
72 Correct 197 ms 34412 KB Output is correct
73 Correct 307 ms 46648 KB Output is correct
74 Correct 423 ms 58972 KB Output is correct
75 Correct 431 ms 65580 KB Output is correct
76 Correct 490 ms 74600 KB Output is correct
77 Correct 10 ms 9932 KB Output is correct
78 Correct 10 ms 10128 KB Output is correct
79 Correct 231 ms 35600 KB Output is correct
80 Correct 312 ms 48576 KB Output is correct
81 Correct 415 ms 61512 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 9676 KB Output is correct
2 Correct 7 ms 9676 KB Output is correct
3 Correct 6 ms 9676 KB Output is correct
4 Correct 6 ms 9676 KB Output is correct
5 Correct 7 ms 9676 KB Output is correct
6 Correct 6 ms 9676 KB Output is correct
7 Correct 6 ms 9632 KB Output is correct
8 Correct 6 ms 9676 KB Output is correct
9 Correct 235 ms 42320 KB Output is correct
10 Correct 24 ms 12944 KB Output is correct
11 Correct 131 ms 27128 KB Output is correct
12 Correct 35 ms 14532 KB Output is correct
13 Correct 22 ms 12104 KB Output is correct
14 Correct 7 ms 9676 KB Output is correct
15 Correct 7 ms 9804 KB Output is correct
16 Correct 232 ms 42256 KB Output is correct
17 Correct 6 ms 9676 KB Output is correct
18 Correct 6 ms 9720 KB Output is correct
19 Correct 6 ms 9684 KB Output is correct
20 Correct 346 ms 58984 KB Output is correct
21 Correct 347 ms 54324 KB Output is correct
22 Correct 350 ms 54328 KB Output is correct
23 Correct 344 ms 64948 KB Output is correct
24 Correct 96 ms 16180 KB Output is correct
25 Correct 101 ms 20340 KB Output is correct
26 Correct 103 ms 20508 KB Output is correct
27 Correct 392 ms 74548 KB Output is correct
28 Correct 393 ms 74536 KB Output is correct
29 Correct 419 ms 74532 KB Output is correct
30 Correct 406 ms 74644 KB Output is correct
31 Correct 6 ms 9676 KB Output is correct
32 Correct 32 ms 13144 KB Output is correct
33 Correct 46 ms 14176 KB Output is correct
34 Correct 341 ms 61472 KB Output is correct
35 Correct 11 ms 10384 KB Output is correct
36 Correct 32 ms 12992 KB Output is correct
37 Correct 61 ms 16084 KB Output is correct
38 Correct 173 ms 29372 KB Output is correct
39 Correct 254 ms 36316 KB Output is correct
40 Correct 336 ms 43704 KB Output is correct
41 Correct 410 ms 51000 KB Output is correct
42 Correct 493 ms 58080 KB Output is correct
43 Correct 6 ms 9676 KB Output is correct
44 Correct 6 ms 9700 KB Output is correct
45 Correct 6 ms 9696 KB Output is correct
46 Correct 6 ms 9676 KB Output is correct
47 Correct 7 ms 9684 KB Output is correct
48 Correct 6 ms 9676 KB Output is correct
49 Correct 6 ms 9676 KB Output is correct
50 Correct 6 ms 9676 KB Output is correct
51 Correct 6 ms 9712 KB Output is correct
52 Correct 6 ms 9696 KB Output is correct
53 Correct 6 ms 9676 KB Output is correct
54 Correct 7 ms 9704 KB Output is correct
55 Correct 8 ms 9804 KB Output is correct
56 Correct 203 ms 35832 KB Output is correct
57 Correct 298 ms 47580 KB Output is correct
58 Correct 304 ms 47592 KB Output is correct
59 Correct 6 ms 9676 KB Output is correct
60 Correct 7 ms 9696 KB Output is correct
61 Correct 6 ms 9676 KB Output is correct
62 Correct 484 ms 76500 KB Output is correct
63 Correct 482 ms 76340 KB Output is correct
64 Correct 481 ms 76052 KB Output is correct
65 Correct 8 ms 9932 KB Output is correct
66 Correct 10 ms 10060 KB Output is correct
67 Correct 197 ms 35220 KB Output is correct
68 Correct 300 ms 47924 KB Output is correct
69 Correct 413 ms 60600 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 9676 KB Output is correct
2 Correct 7 ms 9676 KB Output is correct
3 Correct 6 ms 9676 KB Output is correct
4 Correct 6 ms 9676 KB Output is correct
5 Correct 7 ms 9676 KB Output is correct
6 Correct 6 ms 9676 KB Output is correct
7 Correct 6 ms 9632 KB Output is correct
8 Correct 6 ms 9676 KB Output is correct
9 Correct 235 ms 42320 KB Output is correct
10 Correct 24 ms 12944 KB Output is correct
11 Correct 131 ms 27128 KB Output is correct
12 Correct 35 ms 14532 KB Output is correct
13 Correct 22 ms 12104 KB Output is correct
14 Correct 7 ms 9676 KB Output is correct
15 Correct 7 ms 9804 KB Output is correct
16 Correct 232 ms 42256 KB Output is correct
17 Correct 446 ms 74600 KB Output is correct
18 Correct 436 ms 74576 KB Output is correct
19 Correct 358 ms 59188 KB Output is correct
20 Correct 371 ms 58580 KB Output is correct
21 Correct 369 ms 62260 KB Output is correct
22 Correct 6 ms 9676 KB Output is correct
23 Correct 65 ms 17612 KB Output is correct
24 Correct 17 ms 10980 KB Output is correct
25 Correct 46 ms 14472 KB Output is correct
26 Correct 70 ms 17532 KB Output is correct
27 Correct 229 ms 35416 KB Output is correct
28 Correct 291 ms 42656 KB Output is correct
29 Correct 338 ms 48216 KB Output is correct
30 Correct 406 ms 54200 KB Output is correct
31 Correct 473 ms 60888 KB Output is correct
32 Correct 436 ms 67156 KB Output is correct
33 Correct 488 ms 76376 KB Output is correct
34 Correct 8 ms 9932 KB Output is correct
35 Correct 11 ms 10268 KB Output is correct
36 Correct 200 ms 36312 KB Output is correct
37 Correct 313 ms 49888 KB Output is correct
38 Correct 414 ms 63160 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 9676 KB Output is correct
2 Correct 7 ms 9676 KB Output is correct
3 Correct 6 ms 9676 KB Output is correct
4 Correct 6 ms 9676 KB Output is correct
5 Correct 7 ms 9676 KB Output is correct
6 Correct 6 ms 9676 KB Output is correct
7 Correct 6 ms 9632 KB Output is correct
8 Correct 6 ms 9676 KB Output is correct
9 Correct 235 ms 42320 KB Output is correct
10 Correct 24 ms 12944 KB Output is correct
11 Correct 131 ms 27128 KB Output is correct
12 Correct 35 ms 14532 KB Output is correct
13 Correct 22 ms 12104 KB Output is correct
14 Correct 7 ms 9676 KB Output is correct
15 Correct 7 ms 9804 KB Output is correct
16 Correct 232 ms 42256 KB Output is correct
17 Correct 7 ms 9632 KB Output is correct
18 Correct 7 ms 9676 KB Output is correct
19 Correct 6 ms 9676 KB Output is correct
20 Correct 6 ms 9676 KB Output is correct
21 Correct 6 ms 9676 KB Output is correct
22 Correct 7 ms 9676 KB Output is correct
23 Correct 451 ms 62484 KB Output is correct
24 Correct 6 ms 9676 KB Output is correct
25 Correct 8 ms 10060 KB Output is correct
26 Correct 10 ms 9804 KB Output is correct
27 Correct 11 ms 9932 KB Output is correct
28 Correct 193 ms 30800 KB Output is correct
29 Correct 258 ms 41348 KB Output is correct
30 Correct 346 ms 51772 KB Output is correct
31 Correct 449 ms 62468 KB Output is correct
32 Correct 7 ms 9676 KB Output is correct
33 Correct 7 ms 9676 KB Output is correct
34 Correct 6 ms 9676 KB Output is correct
35 Correct 6 ms 9628 KB Output is correct
36 Correct 8 ms 9676 KB Output is correct
37 Correct 7 ms 9676 KB Output is correct
38 Correct 8 ms 9720 KB Output is correct
39 Correct 7 ms 9676 KB Output is correct
40 Correct 6 ms 9676 KB Output is correct
41 Correct 7 ms 9676 KB Output is correct
42 Correct 7 ms 9676 KB Output is correct
43 Correct 7 ms 9804 KB Output is correct
44 Correct 8 ms 9840 KB Output is correct
45 Correct 205 ms 34920 KB Output is correct
46 Correct 301 ms 46388 KB Output is correct
47 Correct 320 ms 46276 KB Output is correct
48 Correct 6 ms 9676 KB Output is correct
49 Correct 6 ms 9676 KB Output is correct
50 Correct 7 ms 9652 KB Output is correct
51 Correct 6 ms 9676 KB Output is correct
52 Correct 8 ms 9680 KB Output is correct
53 Correct 8 ms 9676 KB Output is correct
54 Correct 7 ms 9676 KB Output is correct
55 Correct 412 ms 58844 KB Output is correct
56 Correct 6 ms 9676 KB Output is correct
57 Correct 11 ms 10188 KB Output is correct
58 Correct 18 ms 11340 KB Output is correct
59 Correct 11 ms 10256 KB Output is correct
60 Correct 194 ms 34344 KB Output is correct
61 Correct 279 ms 42808 KB Output is correct
62 Correct 334 ms 50312 KB Output is correct
63 Correct 402 ms 58864 KB Output is correct
64 Correct 6 ms 9676 KB Output is correct
65 Correct 6 ms 9728 KB Output is correct
66 Correct 7 ms 9676 KB Output is correct
67 Correct 505 ms 74608 KB Output is correct
68 Correct 490 ms 74552 KB Output is correct
69 Correct 483 ms 74292 KB Output is correct
70 Correct 8 ms 9872 KB Output is correct
71 Correct 9 ms 10016 KB Output is correct
72 Correct 197 ms 34412 KB Output is correct
73 Correct 307 ms 46648 KB Output is correct
74 Correct 423 ms 58972 KB Output is correct
75 Correct 431 ms 65580 KB Output is correct
76 Correct 490 ms 74600 KB Output is correct
77 Correct 10 ms 9932 KB Output is correct
78 Correct 10 ms 10128 KB Output is correct
79 Correct 231 ms 35600 KB Output is correct
80 Correct 312 ms 48576 KB Output is correct
81 Correct 415 ms 61512 KB Output is correct
82 Correct 6 ms 9676 KB Output is correct
83 Correct 6 ms 9720 KB Output is correct
84 Correct 6 ms 9684 KB Output is correct
85 Correct 346 ms 58984 KB Output is correct
86 Correct 347 ms 54324 KB Output is correct
87 Correct 350 ms 54328 KB Output is correct
88 Correct 344 ms 64948 KB Output is correct
89 Correct 96 ms 16180 KB Output is correct
90 Correct 101 ms 20340 KB Output is correct
91 Correct 103 ms 20508 KB Output is correct
92 Correct 392 ms 74548 KB Output is correct
93 Correct 393 ms 74536 KB Output is correct
94 Correct 419 ms 74532 KB Output is correct
95 Correct 406 ms 74644 KB Output is correct
96 Correct 6 ms 9676 KB Output is correct
97 Correct 32 ms 13144 KB Output is correct
98 Correct 46 ms 14176 KB Output is correct
99 Correct 341 ms 61472 KB Output is correct
100 Correct 11 ms 10384 KB Output is correct
101 Correct 32 ms 12992 KB Output is correct
102 Correct 61 ms 16084 KB Output is correct
103 Correct 173 ms 29372 KB Output is correct
104 Correct 254 ms 36316 KB Output is correct
105 Correct 336 ms 43704 KB Output is correct
106 Correct 410 ms 51000 KB Output is correct
107 Correct 493 ms 58080 KB Output is correct
108 Correct 6 ms 9676 KB Output is correct
109 Correct 6 ms 9700 KB Output is correct
110 Correct 6 ms 9696 KB Output is correct
111 Correct 6 ms 9676 KB Output is correct
112 Correct 7 ms 9684 KB Output is correct
113 Correct 6 ms 9676 KB Output is correct
114 Correct 6 ms 9676 KB Output is correct
115 Correct 6 ms 9676 KB Output is correct
116 Correct 6 ms 9712 KB Output is correct
117 Correct 6 ms 9696 KB Output is correct
118 Correct 6 ms 9676 KB Output is correct
119 Correct 7 ms 9704 KB Output is correct
120 Correct 8 ms 9804 KB Output is correct
121 Correct 203 ms 35832 KB Output is correct
122 Correct 298 ms 47580 KB Output is correct
123 Correct 304 ms 47592 KB Output is correct
124 Correct 6 ms 9676 KB Output is correct
125 Correct 7 ms 9696 KB Output is correct
126 Correct 6 ms 9676 KB Output is correct
127 Correct 484 ms 76500 KB Output is correct
128 Correct 482 ms 76340 KB Output is correct
129 Correct 481 ms 76052 KB Output is correct
130 Correct 8 ms 9932 KB Output is correct
131 Correct 10 ms 10060 KB Output is correct
132 Correct 197 ms 35220 KB Output is correct
133 Correct 300 ms 47924 KB Output is correct
134 Correct 413 ms 60600 KB Output is correct
135 Correct 446 ms 74600 KB Output is correct
136 Correct 436 ms 74576 KB Output is correct
137 Correct 358 ms 59188 KB Output is correct
138 Correct 371 ms 58580 KB Output is correct
139 Correct 369 ms 62260 KB Output is correct
140 Correct 6 ms 9676 KB Output is correct
141 Correct 65 ms 17612 KB Output is correct
142 Correct 17 ms 10980 KB Output is correct
143 Correct 46 ms 14472 KB Output is correct
144 Correct 70 ms 17532 KB Output is correct
145 Correct 229 ms 35416 KB Output is correct
146 Correct 291 ms 42656 KB Output is correct
147 Correct 338 ms 48216 KB Output is correct
148 Correct 406 ms 54200 KB Output is correct
149 Correct 473 ms 60888 KB Output is correct
150 Correct 436 ms 67156 KB Output is correct
151 Correct 488 ms 76376 KB Output is correct
152 Correct 8 ms 9932 KB Output is correct
153 Correct 11 ms 10268 KB Output is correct
154 Correct 200 ms 36312 KB Output is correct
155 Correct 313 ms 49888 KB Output is correct
156 Correct 414 ms 63160 KB Output is correct
157 Correct 6 ms 9700 KB Output is correct
158 Correct 6 ms 9612 KB Output is correct
159 Correct 6 ms 9676 KB Output is correct
160 Correct 6 ms 9676 KB Output is correct
161 Correct 392 ms 53852 KB Output is correct
162 Correct 344 ms 61540 KB Output is correct
163 Correct 331 ms 63072 KB Output is correct
164 Correct 340 ms 63068 KB Output is correct
165 Correct 355 ms 57232 KB Output is correct
166 Correct 341 ms 54620 KB Output is correct
167 Incorrect 63 ms 19120 KB Solution announced impossible, but it is possible.
168 Halted 0 ms 0 KB -