# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1093 | lmj960417 | 탐사 (KOI13_probe) | C++98 | 2032 ms | 520 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 <stdio.h>
#include <algorithm>
int n,m;
int sw=0,asw=0;
int data[50][1010],cnt[50];
int lis[1010];
int val[50];
struct gujo
{
int st,ed,x;
};
gujo ba[1010];
void su(int x)
{
int i,k;
int plx=0,nonx=0;
if(x>n)
{
sw=1;
return;
}
for(i=1;i<=cnt[x];i++)
{
k=data[x][i];
if(lis[k]==ba[k].x) plx=1;
if(lis[k]+(ba[k].ed-x+1)==ba[k].x) nonx=1;
}
if(!plx)
{
for(i=1;i<=cnt[x];i++)
{
k=data[x][i];
lis[k]++;
}
val[x]=1;
su(x+1);
if(sw) return;
for(i=1;i<=cnt[x];i++)
{
k=data[x][i];
lis[k]--;
}
}
if(!nonx)
{
val[x]=0;
su(x+1);
if(sw) return;
}
}
int main()
{
int i,a;
scanf("%d %d",&n,&m);
for(i=1;i<=m;i++)
{
scanf("%d %d %d",&ba[i].st,&ba[i].ed,&ba[i].x);
for(a=ba[i].st;a<=ba[i].ed;a++)
{
data[a][++cnt[a]]=i;
}
if(ba[i].ed-ba[i].st+1<ba[i].x) asw=1;
}
if(asw) printf("NONE\n");
else
{
su(1);
if(sw)
{
for(i=1;i<=n;i++)
{
if(val[i]) printf("#");
else printf("-");
}
}
else printf("NONE\n");
}
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... |