Submission #595947

# Submission time Handle Problem Language Result Execution time Memory
595947 2022-07-14T08:17:33 Z Cross_Ratio IOI Fever (JOI21_fever) C++14
37 / 100
5000 ms 36408 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;
typedef pair<int,int> P;
const int INF = 1e18;
int X[100005];
int Y[100005];
int dis[100005][4];
bool vis[100005];
map<int,set<P>> M1, M2;
int simulate(int dir2, int N) {
    //cout << "Direction : "<< dir2 << '\n';
    int i, j;
    for(i=0;i<N;i++) {
        for(j=0;j<4;j++) dis[i][j] = INF;
    }
    for(i=0;i<N;i++) vis[i] = false;
    dis[0][dir2] = 0;
    priority_queue<P,vector<P>,greater<P>> PQ;
    PQ.push(P(0,dir2));
    while(!PQ.empty()) {
        P k = PQ.top();
        PQ.pop();
        if(vis[k.second/4]) continue;
        vis[k.second/4] = true;
        int id = k.second / 4;
        int dir = k.second % 4;
        M1[X[id]+Y[id]].erase(P(X[id],id));
        M2[X[id]-Y[id]].erase(P(X[id],id));
        //cout << id << ' ' << dir << '\n';
        for(auto it = M1[X[id]+Y[id]].begin();it!=M1[X[id]+Y[id]].end();it++) {
            if(X[id]- (*it).first<dis[id][dir]) break;
            i = (*it).second;
            if(i==id) continue;
            if(vis[i]) continue;
            if(abs(X[i]-X[id])!=abs(Y[i]-Y[id])) continue;
            int d = abs(X[i] - X[id]);
            int val = 2* (X[i] < X[id]) + (Y[i] < Y[id]);
            if(val==2) {
                if(dir==1||dir==2) {
                    if(dis[i][(5-dir)%4]>d&&dis[id][dir]<=d) {
                        dis[i][(5-dir)%4] = d;
                        PQ.push(P(dis[i][(5-dir)%4],4*i+(5-dir)%4));
                    }
                }
            }
            if(val==1) {
                if(dir==0||dir==3) {
                    if(dis[i][(5-dir)%4]>d&&dis[id][dir]<=d) {
                        dis[i][(5-dir)%4] = d;
                        PQ.push(P(dis[i][(5-dir)%4],4*i+(5-dir)%4));
                    }
                }
            }
        }
        for(auto it = M1[X[id]+Y[id]].rbegin();it!=M1[X[id]+Y[id]].rend();it++) {
            if((*it).first-X[id]<dis[id][dir]) break;
            i = (*it).second;
            if(i==id) continue;
            if(vis[i]) continue;
            if(abs(X[i]-X[id])!=abs(Y[i]-Y[id])) continue;
            int d = abs(X[i] - X[id]);
            int val = 2* (X[i] < X[id]) + (Y[i] < Y[id]);
            if(val==2) {
                if(dir==1||dir==2) {
                    if(dis[i][(5-dir)%4]>d&&dis[id][dir]<=d) {
                        dis[i][(5-dir)%4] = d;
                        PQ.push(P(dis[i][(5-dir)%4],4*i+(5-dir)%4));
                    }
                }
            }
            if(val==1) {
                if(dir==0||dir==3) {
                    if(dis[i][(5-dir)%4]>d&&dis[id][dir]<=d) {
                        dis[i][(5-dir)%4] = d;
                        PQ.push(P(dis[i][(5-dir)%4],4*i+(5-dir)%4));
                    }
                }
            }
        }
        for(auto it = M2[X[id]-Y[id]].begin();it!=M2[X[id]-Y[id]].end();it++) {
            if(X[id]-(*it).first<dis[id][dir]) break;
            i = (*it).second;
            if(i==id) continue;
            if(vis[i]) continue;
            if(abs(X[i]-X[id])!=abs(Y[i]-Y[id])) continue;
            int d = abs(X[i] - X[id]);
            int val = 2* (X[i] < X[id]) + (Y[i] < Y[id]);
            if(val==3) {
                if(dir>=2) {
                    if(dis[i][3-dir]>d && dis[id][dir]<=d) {
                        dis[i][3-dir] = d;
                        PQ.push(P(dis[i][3-dir],4*i+3-dir));
                    }
                }
            }
            if(val==0) {
                if(dir<=1) {
                    if(dis[i][3-dir]>d&&dis[id][dir]<=d) {
                        dis[i][3-dir] = d;
                        PQ.push(P(dis[i][3-dir],4*i+3-dir));
                    }
                }
            }
        }
        for(auto it = M2[X[id]-Y[id]].rbegin();it!=M2[X[id]-Y[id]].rend();it++) {
            if((*it).first-X[id]<dis[id][dir]) break;
            i = (*it).second;
            if(i==id) continue;
            if(vis[i]) continue;
            if(abs(X[i]-X[id])!=abs(Y[i]-Y[id])) continue;
            int d = abs(X[i] - X[id]);
            int val = 2* (X[i] < X[id]) + (Y[i] < Y[id]);
            if(val==3) {
                if(dir>=2) {
                    if(dis[i][3-dir]>d && dis[id][dir]<=d) {
                        dis[i][3-dir] = d;
                        PQ.push(P(dis[i][3-dir],4*i+3-dir));
                    }
                }
            }
            if(val==0) {
                if(dir<=1) {
                    if(dis[i][3-dir]>d&&dis[id][dir]<=d) {
                        dis[i][3-dir] = d;
                        PQ.push(P(dis[i][3-dir],4*i+3-dir));
                    }
                }
            }
        }
        for(i=0;i<N;i++) {
            if(i==id) continue;
            if(vis[i]) continue;
            if(dir==0) {
                if(X[id]<X[i]&&Y[i]==Y[id]) {
                    int d = (abs(X[i]-X[id])+abs(Y[i]-Y[id]))/2;
                    if(dis[i][(dir+2)%4]>d&&dis[id][dir]<=d) {
                        dis[i][(dir+2)%4] = d;
                        PQ.push(P(dis[i][(dir+2)%4],4*i+(dir+2)%4));
                    }
                }
            }
            if(dir==2) {
                if(X[id]>X[i]&&Y[i]==Y[id]) {
                    int d = (abs(X[i]-X[id])+abs(Y[i]-Y[id]))/2;
                    if(dis[i][(dir+2)%4]>d&&dis[id][dir]<=d) {
                        dis[i][(dir+2)%4] = d;
                        PQ.push(P(dis[i][(dir+2)%4],4*i+(dir+2)%4));
                    }
                }
            }
            if(dir==1) {
                if(X[id]==X[i]&&Y[id]<Y[i]) {
                    int d = (abs(X[i]-X[id])+abs(Y[i]-Y[id]))/2;
                    if(dis[i][(dir+2)%4]>d&&dis[id][dir]<=d) {
                        dis[i][(dir+2)%4] = d;
                        PQ.push(P(dis[i][(dir+2)%4],4*i+(dir+2)%4));
                    }
                }
            }
            if(dir==3) {
                if(X[id]==X[i]&&Y[id]>Y[i]) {
                    int d = (abs(X[i]-X[id])+abs(Y[i]-Y[id]))/2;
                    if(dis[i][(dir+2)%4]>d&&dis[id][dir]<=d) {
                        dis[i][(dir+2)%4] = d;
                        PQ.push(P(dis[i][(dir+2)%4],4*i+(dir+2)%4));
                    }
                }
            }
        }
    }
    int ans = 0;
    for(i=0;i<N;i++) {
        int mi = INF;
        for(j=0;j<4;j++) mi = min(mi, dis[i][j]);
        if(mi != INF) ans++;
    }
    return ans;
}
signed main() {
    cin.sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int N;
    cin >> N;
    int i, j;
    clock_t st = clock();
    for(i=0;i<N;i++) cin >> X[i] >> Y[i];
    //for(i=0;i<N;i++) X[i] = Y[i] = i;
    for(i=0;i<N;i++) {
        X[i] *= 2;
        Y[i] *= 2;
    }
    int ma = 0;
    for(i=0;i<4;i++) {
        M1.clear();
        M2.clear();
        for(j=0;j<N;j++) M1[X[j]+Y[j]].insert(P(X[j],j));
        for(j=0;j<N;j++) M2[X[j]-Y[j]].insert(P(X[j],j));
        ma = max(ma, simulate(i, N));
    }
    cout <<ma;
    //cout << '\n' << clock() - st << "ms";
}

Compilation message

fever.cpp: In function 'int main()':
fever.cpp:187:13: warning: unused variable 'st' [-Wunused-variable]
  187 |     clock_t st = clock();
      |             ^~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 0 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 0 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 1 ms 340 KB Output is correct
34 Correct 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 1 ms 340 KB Output is correct
39 Correct 0 ms 340 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 0 ms 340 KB Output is correct
45 Correct 1 ms 292 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 284 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 0 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 1 ms 340 KB Output is correct
34 Correct 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 1 ms 340 KB Output is correct
39 Correct 0 ms 340 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 0 ms 340 KB Output is correct
45 Correct 1 ms 292 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 284 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 1 ms 288 KB Output is correct
56 Correct 1 ms 340 KB Output is correct
57 Correct 1 ms 284 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 0 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 1 ms 340 KB Output is correct
34 Correct 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 1 ms 340 KB Output is correct
39 Correct 0 ms 340 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 0 ms 340 KB Output is correct
45 Correct 1 ms 292 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 284 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 1 ms 288 KB Output is correct
56 Correct 1 ms 340 KB Output is correct
57 Correct 1 ms 284 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 7 ms 1288 KB Output is correct
67 Correct 8 ms 1284 KB Output is correct
68 Correct 7 ms 1364 KB Output is correct
69 Correct 226 ms 1012 KB Output is correct
70 Correct 92 ms 1016 KB Output is correct
71 Correct 21 ms 1044 KB Output is correct
72 Correct 9 ms 1236 KB Output is correct
73 Correct 7 ms 1364 KB Output is correct
74 Correct 145 ms 1244 KB Output is correct
75 Correct 353 ms 1376 KB Output is correct
76 Correct 43 ms 1320 KB Output is correct
77 Correct 20 ms 1108 KB Output is correct
78 Correct 36 ms 1312 KB Output is correct
79 Correct 35 ms 1236 KB Output is correct
80 Correct 10 ms 1364 KB Output is correct
81 Correct 30 ms 1236 KB Output is correct
82 Correct 104 ms 1528 KB Output is correct
83 Correct 76 ms 1524 KB Output is correct
84 Correct 20 ms 1152 KB Output is correct
85 Correct 7 ms 932 KB Output is correct
86 Correct 19 ms 908 KB Output is correct
87 Correct 10 ms 1040 KB Output is correct
88 Correct 116 ms 1252 KB Output is correct
89 Correct 61 ms 1136 KB Output is correct
90 Correct 50 ms 1156 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 0 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 1 ms 340 KB Output is correct
34 Correct 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 1 ms 340 KB Output is correct
39 Correct 0 ms 340 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 0 ms 340 KB Output is correct
45 Correct 1 ms 292 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 284 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 1 ms 288 KB Output is correct
56 Correct 1 ms 340 KB Output is correct
57 Correct 1 ms 284 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 538 ms 25244 KB Output is correct
67 Correct 731 ms 31444 KB Output is correct
68 Correct 673 ms 36408 KB Output is correct
69 Execution timed out 5086 ms 29184 KB Time limit exceeded
70 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 340 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 0 ms 340 KB Output is correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 0 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 0 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 1 ms 340 KB Output is correct
34 Correct 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 1 ms 340 KB Output is correct
39 Correct 0 ms 340 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 1 ms 340 KB Output is correct
44 Correct 0 ms 340 KB Output is correct
45 Correct 1 ms 292 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 284 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 1 ms 288 KB Output is correct
56 Correct 1 ms 340 KB Output is correct
57 Correct 1 ms 284 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 7 ms 1288 KB Output is correct
67 Correct 8 ms 1284 KB Output is correct
68 Correct 7 ms 1364 KB Output is correct
69 Correct 226 ms 1012 KB Output is correct
70 Correct 92 ms 1016 KB Output is correct
71 Correct 21 ms 1044 KB Output is correct
72 Correct 9 ms 1236 KB Output is correct
73 Correct 7 ms 1364 KB Output is correct
74 Correct 145 ms 1244 KB Output is correct
75 Correct 353 ms 1376 KB Output is correct
76 Correct 43 ms 1320 KB Output is correct
77 Correct 20 ms 1108 KB Output is correct
78 Correct 36 ms 1312 KB Output is correct
79 Correct 35 ms 1236 KB Output is correct
80 Correct 10 ms 1364 KB Output is correct
81 Correct 30 ms 1236 KB Output is correct
82 Correct 104 ms 1528 KB Output is correct
83 Correct 76 ms 1524 KB Output is correct
84 Correct 20 ms 1152 KB Output is correct
85 Correct 7 ms 932 KB Output is correct
86 Correct 19 ms 908 KB Output is correct
87 Correct 10 ms 1040 KB Output is correct
88 Correct 116 ms 1252 KB Output is correct
89 Correct 61 ms 1136 KB Output is correct
90 Correct 50 ms 1156 KB Output is correct
91 Correct 538 ms 25244 KB Output is correct
92 Correct 731 ms 31444 KB Output is correct
93 Correct 673 ms 36408 KB Output is correct
94 Execution timed out 5086 ms 29184 KB Time limit exceeded
95 Halted 0 ms 0 KB -