Submission #55556

#TimeUsernameProblemLanguageResultExecution timeMemory
55556red1108줄서기 (KOI17_line)C++17
100 / 100
244 ms105856 KiB
#include <stdio.h> int check[100010],help[100010]; int main() { int n, m; int i, a, b; scanf("%d %d", &n, &m); for(i=1;i<=n;i++) { check[i]=i; } for(i=1;i<=m;i++) { scanf("%d %d", &a, &b); check[a]++; check[b]--; } for(i=1;i<=n;i++) { if(check[i]<1||check[i]>n||help[check[i]]) { printf("-1"); return 0; } help[check[i]]=1; } for(i=1;i<=n;i++) { printf("%d ", check[i]); } }

Compilation message (stderr)

line.cpp: In function 'int main()':
line.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &n, &m);
     ~~~~~^~~~~~~~~~~~~~~~~
line.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d", &a, &b);
         ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...