# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
862374 |
2023-10-18T06:39:44 Z |
TAhmed33 |
Kutije (COCI21_kutije) |
C++ |
|
830 ms |
3076 KB |
#include <bits/stdc++.h>
#pragma GCC optimize ("Ofast")
using namespace std;
bool adj[1001][1001];
int main () {
ios::sync_with_stdio(0);
cin.tie(0);
int n, m, q;
cin >> n >> m >> q;
for (int i = 1; i <= m; i++) {
for (int j = 1; j <= n; j++) {
int x; cin >> x;
adj[j][x] = 1;
}
}
for (int i = 1; i <= n; i++) adj[i][i] = 1;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
for (int k = 1; k <= n; k++) {
adj[j][k] |= (adj[j][i] & adj[i][k]);
}
}
}
while (q--) {
int a, b;
cin >> a >> b;
cout << (adj[a][b] ? "DA\n" : "NE\n");
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
763 ms |
2692 KB |
Output is correct |
2 |
Correct |
623 ms |
2632 KB |
Output is correct |
3 |
Correct |
574 ms |
2388 KB |
Output is correct |
4 |
Correct |
764 ms |
2900 KB |
Output is correct |
5 |
Correct |
761 ms |
2900 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
2 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
7 |
Correct |
2 ms |
348 KB |
Output is correct |
8 |
Correct |
2 ms |
348 KB |
Output is correct |
9 |
Correct |
2 ms |
348 KB |
Output is correct |
10 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
2 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
7 |
Correct |
2 ms |
348 KB |
Output is correct |
8 |
Correct |
2 ms |
348 KB |
Output is correct |
9 |
Correct |
2 ms |
348 KB |
Output is correct |
10 |
Correct |
2 ms |
348 KB |
Output is correct |
11 |
Correct |
2 ms |
344 KB |
Output is correct |
12 |
Correct |
2 ms |
344 KB |
Output is correct |
13 |
Correct |
2 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
348 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
344 KB |
Output is correct |
17 |
Correct |
2 ms |
344 KB |
Output is correct |
18 |
Correct |
2 ms |
348 KB |
Output is correct |
19 |
Correct |
2 ms |
568 KB |
Output is correct |
20 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
763 ms |
2692 KB |
Output is correct |
2 |
Correct |
623 ms |
2632 KB |
Output is correct |
3 |
Correct |
574 ms |
2388 KB |
Output is correct |
4 |
Correct |
764 ms |
2900 KB |
Output is correct |
5 |
Correct |
761 ms |
2900 KB |
Output is correct |
6 |
Correct |
2 ms |
344 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
2 ms |
348 KB |
Output is correct |
11 |
Correct |
2 ms |
348 KB |
Output is correct |
12 |
Correct |
2 ms |
348 KB |
Output is correct |
13 |
Correct |
2 ms |
348 KB |
Output is correct |
14 |
Correct |
2 ms |
348 KB |
Output is correct |
15 |
Correct |
2 ms |
348 KB |
Output is correct |
16 |
Correct |
2 ms |
344 KB |
Output is correct |
17 |
Correct |
2 ms |
344 KB |
Output is correct |
18 |
Correct |
2 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
344 KB |
Output is correct |
22 |
Correct |
2 ms |
344 KB |
Output is correct |
23 |
Correct |
2 ms |
348 KB |
Output is correct |
24 |
Correct |
2 ms |
568 KB |
Output is correct |
25 |
Correct |
2 ms |
348 KB |
Output is correct |
26 |
Correct |
815 ms |
2896 KB |
Output is correct |
27 |
Correct |
807 ms |
2896 KB |
Output is correct |
28 |
Correct |
621 ms |
2872 KB |
Output is correct |
29 |
Correct |
777 ms |
3076 KB |
Output is correct |
30 |
Correct |
608 ms |
2356 KB |
Output is correct |
31 |
Correct |
603 ms |
2392 KB |
Output is correct |
32 |
Correct |
803 ms |
2700 KB |
Output is correct |
33 |
Correct |
830 ms |
2828 KB |
Output is correct |
34 |
Correct |
811 ms |
2712 KB |
Output is correct |
35 |
Correct |
807 ms |
2692 KB |
Output is correct |