Submission #1093

#TimeUsernameProblemLanguageResultExecution timeMemory
1093lmj960417탐사 (KOI13_probe)C++98
14.63 / 19
2032 ms520 KiB
#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)

probe.cpp: In function 'int main()':
probe.cpp:55:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d",&n,&m);
  ~~~~~^~~~~~~~~~~~~~~
probe.cpp:59:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d %d",&ba[i].st,&ba[i].ed,&ba[i].x);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...