# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
55556 | red1108 | 줄서기 (KOI17_line) | C++17 | 244 ms | 105856 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>
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)
# | 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... |