# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
733176 |
2023-04-30T07:55:24 Z |
yeyso |
Game (APIO22_game) |
C++17 |
|
0 ms |
208 KB |
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> adj;
int n;
int x;
void init(int n, int k) {
vector<vector<int>> matrix(n, vector<int>(n, INT_MAX / 3));
vector<vector<int>> dma(n, vector<int>(n, INT_MAX / 3));
adj = matrix;
for(int i = 0; i < k - 1; i ++){
adj[i][i+1] = -1;
//dma[i][i+1] = -1;
}
x = n;
}
int add_teleporter(int u, int v) {
n = x;
adj[u][v] = min(adj[u][v], 0);
for(int k = 0; k < n; k ++){
for(int i = 0; i < n; i ++){
for(int j = 0; j < n; j ++){
adj[i][j] = min(adj[i][j], adj[i][k]+adj[k][j]);
}
}
}
for(int i = 0; i < n; i ++){
if(adj[i][i] < 0){
return 1;
}
}
/*for(int i = 0; i < n; i ++){
for(int j = 0; j < n; j ++){
cout << adj[i][j] << " ";
} cout << "\n";
} cout << "\n";*/
return 0;
}
/*
g++ -std=gnu++17 -O2 -pipe -o game grader.cpp game.cpp
6 5 3
3 4
5 0
4 5
5 3
1 4
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Wrong Answer[1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Wrong Answer[1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Wrong Answer[1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Wrong Answer[1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Wrong Answer[1] |
2 |
Halted |
0 ms |
0 KB |
- |