# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
159750 | geon040702 | 줄서기 (KOI17_line) | C++14 | 213 ms | 12572 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>
using namespace std;
bool visit[100010];
int ans[100010];
int n, m;
int main(void)
{
int i, j;
scanf("%d%d", &n, &m);
for(i=1;i<=n;i++) {
ans[i] = i;
}
for(i=1;i<=m;i++) {
int a, b;
scanf("%d%d", &a, &b);
ans[a]++;
ans[b]--;
}
for(i=1;i<=n;i++) {
if(visit[ans[i]]) {
printf("-1\n");
exit(0);
}
visit[ans[i]] = 1;
}
for(i=1;i<=n;i++) {
printf("%d ", ans[i]);
}
printf("\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... |