# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19835 | hjk0553 | 탐사 (KOI13_probe) | C++98 | 2092 ms | 424 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
int k,n,arr[44];
struct d{
int s;
int e;
int cnt;
} data[1111];
void f(int pos){
int i,j,flag=1;
if(pos>k){
for(i=1;i<=n;i++){
int sum=0;
for(j=data[i].s;j<=data[i].e;j++) sum+=arr[j];
if(sum!=data[i].cnt) flag=0;
}
if(flag){
for(i=1;i<=k;i++) printf("%c",arr[i]?'#':'-');
exit(0);
}
}
else{
for(i=0;i<=1;i++){
if(arr[pos]==-1){
arr[pos]=i;
f(pos+1);
arr[pos]=-1;
}
}
}
}
int main(){
memset(arr,-1,sizeof(arr));
int i;
scanf("%d %d",&k,&n);
for(i=1;i<=n;i++) scanf("%d %d %d",&data[i].s,&data[i].e,&data[i].cnt);
f(1);
printf("NONE");
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |