# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
13124 | 2015-01-31T11:03:31 Z | gs14004 | 탐사 (KOI13_probe) | C++14 | 4 ms | 424 KB |
#include <cstdio> #include <algorithm> #include <cstring> using namespace std; int adj[50][50], k, n; int main(){ memset(adj,0x3f,sizeof(adj)); scanf("%d %d",&k,&n); for (int i=1; i<=k; i++) { adj[i][i+1] = 1; adj[i+1][i] = 0; adj[i][i] = 0; } for (int i=0; i<n; i++) { int x,y,z; scanf("%d %d %d",&x,&y,&z); adj[x][y+1] = min(adj[x][y+1],z); adj[y+1][x] = min(adj[y+1][x],-z); } for (int i=1; i<=k+1; i++) { for (int j=1; j<=k+1; j++) { for (int l=1; l<=k+1; l++) { adj[j][l] = min(adj[j][l],adj[j][i] + adj[i][l]); } } } for (int i=1; i<=k+1; i++) { if(adj[i][i] < 0){ puts("NONE"); return 0; } } for (int i=1; i<=k; i++) { if(adj[1][i+1] - adj[1][i]) putchar('#'); else putchar('-'); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
6 | Correct | 2 ms | 296 KB | Output is correct |
7 | Correct | 2 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 348 KB | Output is correct |
2 | Correct | 2 ms | 348 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 2 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 424 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
4 | Correct | 2 ms | 380 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
6 | Correct | 2 ms | 252 KB | Output is correct |
7 | Correct | 1 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 1 ms | 376 KB | Output is correct |
3 | Correct | 3 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |