# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
16230 | 2015-08-18T10:23:48 Z | eaststar | 탐사 (KOI13_probe) | C++14 | 3 ms | 376 KB |
#include <stdio.h> #include <algorithm> using namespace std; struct data{ int s,e,w; }a[1010]; int ans[41]; int main(){ int i,j,k,n; scanf("%d%d",&k,&n); for(i=1;i<=n;++i){ scanf("%d%d%d",&a[i].s,&a[i].e,&a[i].w); --a[i].s; } for(i=1;i<=k;++i)ans[i]=i; for(i=1;i<=k;++i){ for(j=0;j<k;++j){ ans[j+1]=min(ans[j+1],ans[j]+1); ans[j]=min(ans[j],ans[j+1]); } for(j=1;j<=n;++j){ ans[a[j].e]=min(ans[a[j].e],ans[a[j].s]+a[j].w); ans[a[j].s]=min(ans[a[j].s],ans[a[j].e]-a[j].w); } } for(i=1;i<=k;++i)if(ans[i]<0||ans[i]-ans[i-1]>1)break; if(i>k)for(i=1;i<=k;++i)printf("%c",ans[i]-ans[i-1]?'#':'-'); else puts("NONE"); return 0; }
Compilation message
# | 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 | 252 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
6 | Correct | 2 ms | 228 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 | 2 ms | 348 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 3 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 | 3 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 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 | 256 KB | Output is correct |
7 | Correct | 2 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 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 | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 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 |