// Ignut
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 5555;
int n, m;
vector<int> a, r;
vector<int> g[N];
bool ans = false;
bool used[N];
void dfs(int v) {
used[v] = true;
ans |= r[v];
for (int to : g[v])
if (!used[to])
dfs(to);
}
vector<int> who_wins(vector<int> A, vector<int> R, vector<int> u, vector<int> v) {
n = A.size(), m = u.size();
a = A, r = R;
for (int i = 0; i < m; i ++) {
g[u[i]].push_back(v[i]);
}
vector<int> res;
for (int s = 0; s < n; s ++) {
ans = false;
for (int i = 0; i < n; i ++) used[i] = false;
dfs(s);
res.push_back(ans);
}
return res;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
107 ms |
1112 KB |
3rd lines differ - on the 1st token, expected: '0', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
3rd lines differ - on the 1st token, expected: '0', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
100 ms |
1620 KB |
3rd lines differ - on the 1st token, expected: '0', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
504 ms |
1364 KB |
3rd lines differ - on the 696th token, expected: '0', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
618 ms |
1784 KB |
3rd lines differ - on the 2nd token, expected: '0', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
107 ms |
1112 KB |
3rd lines differ - on the 1st token, expected: '0', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |