# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
16844 | 2015-10-18T02:21:00 Z | gs14004 | 탐사 (KOI13_probe) | C++14 | 5 ms | 376 KB |
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <limits.h> #include <stack> #include <queue> #include <map> #include <set> #include <algorithm> #include <string> #include <functional> #include <vector> #include <numeric> #include <deque> #include <utility> #include <bitset> #include <iostream> using namespace std; typedef long long lint; typedef long double llf; typedef pair<int, int> pi; int adj[45][45]; int n, k; map<pi, int> mp; int main(){ scanf("%d %d",&n,&k); memset(adj,0x3f,sizeof(adj)); for(int i=0; i<=n; i++){ adj[i][i+1] = 1; adj[i+1][i] = 0; adj[i][i] = 0; } for(int i=0; i<k; i++){ int s, e, x; scanf("%d %d %d",&s,&e,&x); if(mp.find(pi(s, e)) != mp.end()){ if(mp[pi(s, e)] != x){ puts("NONE"); return 0; } else continue; } mp[pi(s, e)] = x; adj[s-1][e] = x; adj[e][s-1] = -x; } for(int i=0; i<=n; i++){ for(int j=0; j<=n; j++){ for(int k=0; k<=n; k++){ adj[j][k] = min(adj[j][k], adj[j][i] + adj[i][k]); } } } for(int i=0; i<=n; i++){ if(adj[i][i] < 0){ puts("NONE"); return 0; } } for(int i=1; i<=n; i++){ putchar(adj[0][i] - adj[0][i-1] ? '#' : '-'); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 348 KB | Output is correct |
3 | Correct | 2 ms | 348 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | 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 | 256 KB | Output is correct |
3 | 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 | 2 ms | 348 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 1 ms | 256 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 4 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 252 KB | Output is correct |
4 | Correct | 5 ms | 352 KB | Output is correct |