# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
985296 |
2024-05-17T14:42:19 Z |
Aybak |
Game (APIO22_game) |
C++17 |
|
100 ms |
262144 KB |
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <string>
bool** arr;
int n;
int k;
/*
6 5 3
3 4
5 0
4 5
5 3
1 4
*/
#define print(var) std::cout << var
#define printl(var) std::cout << var << '\n'
#define For(i, n) for (int i = 0; i < n; ++i)
void Print() {
return;
For(y, n) {
For(x, n) {
print(arr[x][y] << " "); }
printl(""); }
printl("-------------"); }
void init(int nH, int kH) {
n = nH;
k = kH;
arr = new bool*[n];
For(x, n) {
For(y, n) {
arr[x] = new bool[n]{}; } }
For(x, k - 1) {
for (int y = x + 1; y < k; ++y) {
arr[x][y] = 1; } }
Print();
}
void add(int x1, int x2) {
bool change = 0;
For(i, n) {
if (arr[x2][i] == 1 && arr[x1][i] == 0) {
change = 1;
arr[x1][i] = arr[x1][i] || arr[x2][i]; } }
if (change == 0) {
return; }
For(i, n) {
if (arr[i][x1] == true) {
add(i, x1); } } }
bool check() {
For(x, k) {
For(y, x + 1) {
if (arr[x][y] == 1) {
return 1; } } }
return 0; }
int add_teleporter(int x, int y) {
arr[x][y] = 1;
add(x, y);
Print();
return check();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
2 ms |
1368 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
2 ms |
1368 KB |
Output is correct |
6 |
Correct |
2 ms |
1368 KB |
Output is correct |
7 |
Correct |
2 ms |
1368 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
2 ms |
1368 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
2 ms |
1368 KB |
Output is correct |
6 |
Correct |
2 ms |
1368 KB |
Output is correct |
7 |
Correct |
2 ms |
1368 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
1 ms |
1364 KB |
Output is correct |
12 |
Correct |
2 ms |
1368 KB |
Output is correct |
13 |
Correct |
3 ms |
1368 KB |
Output is correct |
14 |
Correct |
1 ms |
1368 KB |
Output is correct |
15 |
Correct |
3 ms |
1368 KB |
Output is correct |
16 |
Correct |
3 ms |
1368 KB |
Output is correct |
17 |
Correct |
7 ms |
1368 KB |
Output is correct |
18 |
Correct |
2 ms |
1368 KB |
Output is correct |
19 |
Correct |
3 ms |
1368 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
2 ms |
1368 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
2 ms |
1368 KB |
Output is correct |
6 |
Correct |
2 ms |
1368 KB |
Output is correct |
7 |
Correct |
2 ms |
1368 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
1 ms |
1364 KB |
Output is correct |
12 |
Correct |
2 ms |
1368 KB |
Output is correct |
13 |
Correct |
3 ms |
1368 KB |
Output is correct |
14 |
Correct |
1 ms |
1368 KB |
Output is correct |
15 |
Correct |
3 ms |
1368 KB |
Output is correct |
16 |
Correct |
3 ms |
1368 KB |
Output is correct |
17 |
Correct |
7 ms |
1368 KB |
Output is correct |
18 |
Correct |
2 ms |
1368 KB |
Output is correct |
19 |
Correct |
3 ms |
1368 KB |
Output is correct |
20 |
Runtime error |
100 ms |
262144 KB |
Execution killed with signal 9 |
21 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
2 ms |
1368 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
2 ms |
1368 KB |
Output is correct |
6 |
Correct |
2 ms |
1368 KB |
Output is correct |
7 |
Correct |
2 ms |
1368 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
1 ms |
1364 KB |
Output is correct |
12 |
Correct |
2 ms |
1368 KB |
Output is correct |
13 |
Correct |
3 ms |
1368 KB |
Output is correct |
14 |
Correct |
1 ms |
1368 KB |
Output is correct |
15 |
Correct |
3 ms |
1368 KB |
Output is correct |
16 |
Correct |
3 ms |
1368 KB |
Output is correct |
17 |
Correct |
7 ms |
1368 KB |
Output is correct |
18 |
Correct |
2 ms |
1368 KB |
Output is correct |
19 |
Correct |
3 ms |
1368 KB |
Output is correct |
20 |
Runtime error |
100 ms |
262144 KB |
Execution killed with signal 9 |
21 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
2 ms |
1368 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
2 ms |
1368 KB |
Output is correct |
6 |
Correct |
2 ms |
1368 KB |
Output is correct |
7 |
Correct |
2 ms |
1368 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
1 ms |
1364 KB |
Output is correct |
12 |
Correct |
2 ms |
1368 KB |
Output is correct |
13 |
Correct |
3 ms |
1368 KB |
Output is correct |
14 |
Correct |
1 ms |
1368 KB |
Output is correct |
15 |
Correct |
3 ms |
1368 KB |
Output is correct |
16 |
Correct |
3 ms |
1368 KB |
Output is correct |
17 |
Correct |
7 ms |
1368 KB |
Output is correct |
18 |
Correct |
2 ms |
1368 KB |
Output is correct |
19 |
Correct |
3 ms |
1368 KB |
Output is correct |
20 |
Runtime error |
100 ms |
262144 KB |
Execution killed with signal 9 |
21 |
Halted |
0 ms |
0 KB |
- |