# |
제출 시각 |
아이디 |
문제 |
언어 |
결과 |
실행 시간 |
메모리 |
1026739 |
2024-07-18T10:07:27 Z |
dozer |
게임 (IOI14_game) |
C++14 |
|
1000 ms |
7652 KB |
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
#define sp " "
#define endl "\n"
#define fileio() freopen("input.txt", "r", stdin), freopen("output.txt","w", stdout)
#define fastio() cin.tie(0), ios_base::sync_with_stdio(0)
#define pb push_back
#define pii pair<int, int>
#define st first
#define nd second
#define LL node * 2
#define RR node * 2
#define mid (l + r) / 2
#define ll long long
#define MAXN 1505
const int modulo = 1e9 + 7;
const ll INF = 2e18 +7;
int adj[MAXN][MAXN], N;
void initialize(int n) {
N = n;
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++) adj[i][j] = 1;
}
}
int hasEdge(int u, int v) {
vector<int> vis(N, 0);
vis[u] = 1;
adj[u][v] = 0;
adj[v][u] = 0;
queue<int> q;
q.push(u);
while(!q.empty()){
int top = q.front();
q.pop();
for (int i = 0; i < N; i++){
if (vis[i] || adj[top][i] == 0) continue;
if (i == v){
return 0;
}
vis[i] = 1;
q.push(i);
}
}
adj[u][v] = 1;
adj[v][u] = 1;
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2396 KB |
Output is correct |
2 |
Correct |
0 ms |
2396 KB |
Output is correct |
3 |
Correct |
0 ms |
2396 KB |
Output is correct |
4 |
Correct |
1 ms |
2488 KB |
Output is correct |
5 |
Correct |
0 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
0 ms |
2396 KB |
Output is correct |
8 |
Correct |
1 ms |
2396 KB |
Output is correct |
9 |
Correct |
0 ms |
2396 KB |
Output is correct |
10 |
Correct |
1 ms |
2396 KB |
Output is correct |
11 |
Correct |
1 ms |
2392 KB |
Output is correct |
12 |
Correct |
1 ms |
2396 KB |
Output is correct |
13 |
Correct |
0 ms |
2396 KB |
Output is correct |
14 |
Correct |
0 ms |
2396 KB |
Output is correct |
15 |
Correct |
1 ms |
2396 KB |
Output is correct |
16 |
Correct |
0 ms |
2396 KB |
Output is correct |
17 |
Correct |
1 ms |
2396 KB |
Output is correct |
18 |
Correct |
0 ms |
2396 KB |
Output is correct |
19 |
Correct |
0 ms |
2396 KB |
Output is correct |
20 |
Correct |
0 ms |
2396 KB |
Output is correct |
21 |
Correct |
0 ms |
2396 KB |
Output is correct |
22 |
Correct |
1 ms |
2396 KB |
Output is correct |
23 |
Correct |
0 ms |
2396 KB |
Output is correct |
24 |
Correct |
0 ms |
2396 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Correct |
0 ms |
2396 KB |
Output is correct |
3 |
Correct |
0 ms |
2396 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
0 ms |
2396 KB |
Output is correct |
6 |
Correct |
0 ms |
2396 KB |
Output is correct |
7 |
Correct |
0 ms |
2396 KB |
Output is correct |
8 |
Correct |
0 ms |
2396 KB |
Output is correct |
9 |
Correct |
0 ms |
2396 KB |
Output is correct |
10 |
Correct |
0 ms |
2396 KB |
Output is correct |
11 |
Correct |
1 ms |
2396 KB |
Output is correct |
12 |
Correct |
0 ms |
2396 KB |
Output is correct |
13 |
Correct |
0 ms |
2396 KB |
Output is correct |
14 |
Correct |
1 ms |
2396 KB |
Output is correct |
15 |
Correct |
0 ms |
2396 KB |
Output is correct |
16 |
Correct |
0 ms |
2396 KB |
Output is correct |
17 |
Correct |
0 ms |
2392 KB |
Output is correct |
18 |
Correct |
0 ms |
2396 KB |
Output is correct |
19 |
Correct |
1 ms |
2396 KB |
Output is correct |
20 |
Correct |
0 ms |
2396 KB |
Output is correct |
21 |
Correct |
1 ms |
2396 KB |
Output is correct |
22 |
Correct |
1 ms |
2396 KB |
Output is correct |
23 |
Correct |
1 ms |
2396 KB |
Output is correct |
24 |
Correct |
0 ms |
2504 KB |
Output is correct |
25 |
Correct |
1 ms |
4444 KB |
Output is correct |
26 |
Correct |
1 ms |
4444 KB |
Output is correct |
27 |
Correct |
1 ms |
4444 KB |
Output is correct |
28 |
Correct |
1 ms |
4444 KB |
Output is correct |
29 |
Correct |
1 ms |
4444 KB |
Output is correct |
30 |
Correct |
1 ms |
4444 KB |
Output is correct |
31 |
Correct |
1 ms |
4444 KB |
Output is correct |
32 |
Correct |
1 ms |
4444 KB |
Output is correct |
33 |
Correct |
1 ms |
4444 KB |
Output is correct |
34 |
Correct |
5 ms |
4692 KB |
Output is correct |
35 |
Correct |
5 ms |
4444 KB |
Output is correct |
36 |
Correct |
5 ms |
4696 KB |
Output is correct |
37 |
Correct |
5 ms |
4700 KB |
Output is correct |
38 |
Correct |
5 ms |
4700 KB |
Output is correct |
39 |
Correct |
5 ms |
4444 KB |
Output is correct |
40 |
Correct |
6 ms |
4700 KB |
Output is correct |
41 |
Correct |
5 ms |
4444 KB |
Output is correct |
42 |
Correct |
5 ms |
4688 KB |
Output is correct |
43 |
Correct |
4 ms |
4696 KB |
Output is correct |
44 |
Correct |
2 ms |
4704 KB |
Output is correct |
45 |
Correct |
3 ms |
4452 KB |
Output is correct |
46 |
Correct |
3 ms |
4700 KB |
Output is correct |
47 |
Correct |
3 ms |
4704 KB |
Output is correct |
48 |
Correct |
3 ms |
4708 KB |
Output is correct |
49 |
Correct |
3 ms |
4708 KB |
Output is correct |
50 |
Correct |
7 ms |
4696 KB |
Output is correct |
51 |
Correct |
7 ms |
4700 KB |
Output is correct |
52 |
Correct |
7 ms |
4700 KB |
Output is correct |
53 |
Correct |
7 ms |
4448 KB |
Output is correct |
54 |
Correct |
11 ms |
4696 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Correct |
0 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2408 KB |
Output is correct |
4 |
Correct |
1 ms |
2404 KB |
Output is correct |
5 |
Correct |
0 ms |
2408 KB |
Output is correct |
6 |
Correct |
1 ms |
2400 KB |
Output is correct |
7 |
Correct |
1 ms |
2392 KB |
Output is correct |
8 |
Correct |
1 ms |
2400 KB |
Output is correct |
9 |
Correct |
0 ms |
2408 KB |
Output is correct |
10 |
Correct |
1 ms |
2408 KB |
Output is correct |
11 |
Correct |
0 ms |
2408 KB |
Output is correct |
12 |
Correct |
0 ms |
2408 KB |
Output is correct |
13 |
Correct |
0 ms |
2396 KB |
Output is correct |
14 |
Correct |
1 ms |
2396 KB |
Output is correct |
15 |
Correct |
1 ms |
2396 KB |
Output is correct |
16 |
Correct |
0 ms |
2396 KB |
Output is correct |
17 |
Correct |
1 ms |
2392 KB |
Output is correct |
18 |
Correct |
0 ms |
2396 KB |
Output is correct |
19 |
Correct |
0 ms |
2396 KB |
Output is correct |
20 |
Correct |
0 ms |
2396 KB |
Output is correct |
21 |
Correct |
1 ms |
2396 KB |
Output is correct |
22 |
Correct |
1 ms |
2396 KB |
Output is correct |
23 |
Correct |
0 ms |
2396 KB |
Output is correct |
24 |
Correct |
0 ms |
2396 KB |
Output is correct |
25 |
Correct |
1 ms |
4444 KB |
Output is correct |
26 |
Correct |
1 ms |
4952 KB |
Output is correct |
27 |
Correct |
1 ms |
4444 KB |
Output is correct |
28 |
Correct |
1 ms |
4444 KB |
Output is correct |
29 |
Correct |
1 ms |
4676 KB |
Output is correct |
30 |
Correct |
1 ms |
4444 KB |
Output is correct |
31 |
Correct |
1 ms |
4444 KB |
Output is correct |
32 |
Correct |
1 ms |
4444 KB |
Output is correct |
33 |
Correct |
1 ms |
4440 KB |
Output is correct |
34 |
Correct |
5 ms |
4696 KB |
Output is correct |
35 |
Correct |
5 ms |
4700 KB |
Output is correct |
36 |
Correct |
5 ms |
4444 KB |
Output is correct |
37 |
Correct |
5 ms |
4444 KB |
Output is correct |
38 |
Correct |
5 ms |
4688 KB |
Output is correct |
39 |
Correct |
5 ms |
4688 KB |
Output is correct |
40 |
Correct |
5 ms |
4688 KB |
Output is correct |
41 |
Correct |
5 ms |
4696 KB |
Output is correct |
42 |
Correct |
5 ms |
4444 KB |
Output is correct |
43 |
Correct |
4 ms |
4692 KB |
Output is correct |
44 |
Correct |
2 ms |
4444 KB |
Output is correct |
45 |
Correct |
4 ms |
4684 KB |
Output is correct |
46 |
Correct |
3 ms |
4700 KB |
Output is correct |
47 |
Correct |
3 ms |
4700 KB |
Output is correct |
48 |
Correct |
3 ms |
4700 KB |
Output is correct |
49 |
Correct |
4 ms |
4700 KB |
Output is correct |
50 |
Correct |
9 ms |
4700 KB |
Output is correct |
51 |
Correct |
7 ms |
4444 KB |
Output is correct |
52 |
Correct |
8 ms |
4696 KB |
Output is correct |
53 |
Correct |
7 ms |
4700 KB |
Output is correct |
54 |
Correct |
7 ms |
4692 KB |
Output is correct |
55 |
Execution timed out |
1073 ms |
7652 KB |
Time limit exceeded |
56 |
Halted |
0 ms |
0 KB |
- |