Submission #710362

# Submission time Handle Problem Language Result Execution time Memory
710362 2023-03-15T07:42:11 Z Astrayt Game (APIO22_game) C++17
60 / 100
4000 ms 34336 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define maxn 300005
 
int N, K, low[maxn];
vector<int> adj[maxn], rev[maxn];
 
void init(int n, int k){
    N = n, K = k;
    for(int i = 0; i < k - 1; ++i) adj[i].pb(i + 1), rev[i + 1].pb(i);
    for(int i = 0; i < n; ++i) low[i] = i;
}
 
int add_teleporter(int u, int v){
    if(u == v){
        if(u < K) return 1;
        else return 0;
    }
    adj[u].pb(v);
    rev[v].pb(u);
    queue<int> bfs; bfs.push(v);
    while(bfs.size()){
        int a = bfs.front(); bfs.pop();
        for(auto b:rev[a]){
            if(b == low[a] && b < K) return 1;
            if(low[b] > low[a]) {
                low[b] = low[a];
                bfs.push(b);
            }
            if(low[b] < b && b < K) return 1;
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 8 ms 14288 KB Output is correct
2 Correct 8 ms 14288 KB Output is correct
3 Correct 8 ms 14404 KB Output is correct
4 Correct 10 ms 14288 KB Output is correct
5 Correct 9 ms 14288 KB Output is correct
6 Correct 8 ms 14300 KB Output is correct
7 Correct 8 ms 14288 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 14288 KB Output is correct
2 Correct 8 ms 14288 KB Output is correct
3 Correct 8 ms 14404 KB Output is correct
4 Correct 10 ms 14288 KB Output is correct
5 Correct 9 ms 14288 KB Output is correct
6 Correct 8 ms 14300 KB Output is correct
7 Correct 8 ms 14288 KB Output is correct
8 Correct 8 ms 14288 KB Output is correct
9 Correct 7 ms 14288 KB Output is correct
10 Correct 8 ms 14372 KB Output is correct
11 Correct 8 ms 14288 KB Output is correct
12 Correct 8 ms 14288 KB Output is correct
13 Correct 8 ms 14288 KB Output is correct
14 Correct 8 ms 14384 KB Output is correct
15 Correct 8 ms 14288 KB Output is correct
16 Correct 10 ms 14288 KB Output is correct
17 Correct 8 ms 14400 KB Output is correct
18 Correct 8 ms 14288 KB Output is correct
19 Correct 8 ms 14288 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 14288 KB Output is correct
2 Correct 8 ms 14288 KB Output is correct
3 Correct 8 ms 14404 KB Output is correct
4 Correct 10 ms 14288 KB Output is correct
5 Correct 9 ms 14288 KB Output is correct
6 Correct 8 ms 14300 KB Output is correct
7 Correct 8 ms 14288 KB Output is correct
8 Correct 8 ms 14288 KB Output is correct
9 Correct 7 ms 14288 KB Output is correct
10 Correct 8 ms 14372 KB Output is correct
11 Correct 8 ms 14288 KB Output is correct
12 Correct 8 ms 14288 KB Output is correct
13 Correct 8 ms 14288 KB Output is correct
14 Correct 8 ms 14384 KB Output is correct
15 Correct 8 ms 14288 KB Output is correct
16 Correct 10 ms 14288 KB Output is correct
17 Correct 8 ms 14400 KB Output is correct
18 Correct 8 ms 14288 KB Output is correct
19 Correct 8 ms 14288 KB Output is correct
20 Correct 8 ms 14416 KB Output is correct
21 Correct 7 ms 14416 KB Output is correct
22 Correct 8 ms 14412 KB Output is correct
23 Correct 9 ms 14416 KB Output is correct
24 Correct 12 ms 14416 KB Output is correct
25 Correct 11 ms 14380 KB Output is correct
26 Correct 12 ms 14544 KB Output is correct
27 Correct 10 ms 14416 KB Output is correct
28 Correct 9 ms 14416 KB Output is correct
29 Correct 14 ms 14416 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 14288 KB Output is correct
2 Correct 8 ms 14288 KB Output is correct
3 Correct 8 ms 14404 KB Output is correct
4 Correct 10 ms 14288 KB Output is correct
5 Correct 9 ms 14288 KB Output is correct
6 Correct 8 ms 14300 KB Output is correct
7 Correct 8 ms 14288 KB Output is correct
8 Correct 8 ms 14288 KB Output is correct
9 Correct 7 ms 14288 KB Output is correct
10 Correct 8 ms 14372 KB Output is correct
11 Correct 8 ms 14288 KB Output is correct
12 Correct 8 ms 14288 KB Output is correct
13 Correct 8 ms 14288 KB Output is correct
14 Correct 8 ms 14384 KB Output is correct
15 Correct 8 ms 14288 KB Output is correct
16 Correct 10 ms 14288 KB Output is correct
17 Correct 8 ms 14400 KB Output is correct
18 Correct 8 ms 14288 KB Output is correct
19 Correct 8 ms 14288 KB Output is correct
20 Correct 8 ms 14416 KB Output is correct
21 Correct 7 ms 14416 KB Output is correct
22 Correct 8 ms 14412 KB Output is correct
23 Correct 9 ms 14416 KB Output is correct
24 Correct 12 ms 14416 KB Output is correct
25 Correct 11 ms 14380 KB Output is correct
26 Correct 12 ms 14544 KB Output is correct
27 Correct 10 ms 14416 KB Output is correct
28 Correct 9 ms 14416 KB Output is correct
29 Correct 14 ms 14416 KB Output is correct
30 Correct 31 ms 15608 KB Output is correct
31 Correct 12 ms 14964 KB Output is correct
32 Correct 31 ms 16304 KB Output is correct
33 Correct 36 ms 16404 KB Output is correct
34 Correct 651 ms 16416 KB Output is correct
35 Correct 240 ms 16420 KB Output is correct
36 Correct 56 ms 16276 KB Output is correct
37 Correct 46 ms 16260 KB Output is correct
38 Correct 38 ms 16100 KB Output is correct
39 Correct 43 ms 16180 KB Output is correct
40 Correct 576 ms 16580 KB Output is correct
41 Correct 114 ms 16112 KB Output is correct
42 Correct 91 ms 16276 KB Output is correct
43 Correct 70 ms 16500 KB Output is correct
44 Correct 523 ms 16416 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 14288 KB Output is correct
2 Correct 8 ms 14288 KB Output is correct
3 Correct 8 ms 14404 KB Output is correct
4 Correct 10 ms 14288 KB Output is correct
5 Correct 9 ms 14288 KB Output is correct
6 Correct 8 ms 14300 KB Output is correct
7 Correct 8 ms 14288 KB Output is correct
8 Correct 8 ms 14288 KB Output is correct
9 Correct 7 ms 14288 KB Output is correct
10 Correct 8 ms 14372 KB Output is correct
11 Correct 8 ms 14288 KB Output is correct
12 Correct 8 ms 14288 KB Output is correct
13 Correct 8 ms 14288 KB Output is correct
14 Correct 8 ms 14384 KB Output is correct
15 Correct 8 ms 14288 KB Output is correct
16 Correct 10 ms 14288 KB Output is correct
17 Correct 8 ms 14400 KB Output is correct
18 Correct 8 ms 14288 KB Output is correct
19 Correct 8 ms 14288 KB Output is correct
20 Correct 8 ms 14416 KB Output is correct
21 Correct 7 ms 14416 KB Output is correct
22 Correct 8 ms 14412 KB Output is correct
23 Correct 9 ms 14416 KB Output is correct
24 Correct 12 ms 14416 KB Output is correct
25 Correct 11 ms 14380 KB Output is correct
26 Correct 12 ms 14544 KB Output is correct
27 Correct 10 ms 14416 KB Output is correct
28 Correct 9 ms 14416 KB Output is correct
29 Correct 14 ms 14416 KB Output is correct
30 Correct 31 ms 15608 KB Output is correct
31 Correct 12 ms 14964 KB Output is correct
32 Correct 31 ms 16304 KB Output is correct
33 Correct 36 ms 16404 KB Output is correct
34 Correct 651 ms 16416 KB Output is correct
35 Correct 240 ms 16420 KB Output is correct
36 Correct 56 ms 16276 KB Output is correct
37 Correct 46 ms 16260 KB Output is correct
38 Correct 38 ms 16100 KB Output is correct
39 Correct 43 ms 16180 KB Output is correct
40 Correct 576 ms 16580 KB Output is correct
41 Correct 114 ms 16112 KB Output is correct
42 Correct 91 ms 16276 KB Output is correct
43 Correct 70 ms 16500 KB Output is correct
44 Correct 523 ms 16416 KB Output is correct
45 Correct 308 ms 26872 KB Output is correct
46 Correct 16 ms 15952 KB Output is correct
47 Correct 14 ms 15952 KB Output is correct
48 Correct 550 ms 34180 KB Output is correct
49 Correct 448 ms 34316 KB Output is correct
50 Execution timed out 4017 ms 34336 KB Time limit exceeded
51 Halted 0 ms 0 KB -