# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1185 | 2013-06-29T12:00:58 Z | gs13068 | 탐사 (KOI13_probe) | C++ | 2000 ms | 380 KB |
#include<cstdio> #include<cstdlib> bool ans[41]; int max[41]; int min[41]; int a[1000]; int b[1000]; int c[1000]; int n,m; inline bool check() { int i; for(i=0;i<m;i++) { if(max[b[i]]-max[a[i]-1]<c[i])return false; if(min[b[i]]-min[a[i]-1]>c[i])return false; } return true; } inline void backtracking(int x) { int i; if(x>n) { for(i=1;i<=n;i++)printf(ans[i]?"#":"-"); exit(0); } ans[x]=true; for(i=x;i<=n;i++)min[i]++; if(check())backtracking(x+1); ans[x]=false; for(i=x;i<=n;i++){min[i]--;max[i]--;} if(check())backtracking(x+1); for(i=x;i<=n;i++)max[i]++; } int main() { int i; scanf("%d%d",&n,&m); for(i=1;i<=n;i++)max[i]=i; for(i=0;i<m;i++)scanf("%d%d%d",&a[i],&b[i],&c[i]); backtracking(1); puts("NONE"); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
4 | Correct | 2 ms | 312 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
6 | Correct | 2 ms | 128 KB | Output is correct |
7 | Correct | 2 ms | 252 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | 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 |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | 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 |
# | 결과 | 실행 시간 | 메모리 | 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 |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 1 ms | 376 KB | Output is correct |
6 | Correct | 11 ms | 348 KB | Output is correct |
7 | Correct | 87 ms | 376 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | 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 |
4 | Correct | 738 ms | 380 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 561 ms | 356 KB | Output is correct |
2 | Correct | 1757 ms | 352 KB | Output is correct |
3 | Execution timed out | 2067 ms | 256 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |