# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
12796 | woqja125 | 전선 연결하기 (GA9_wire) | C++98 | 0 ms | 5776 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 d[600001];
int l[300001];
int ans[300001];
int main()
{
int n, i;
int a, b, t;
a = b = 10000000;
scanf("%d", &n);
for(i=1; i<=2*n; i++)
{
scanf("%d", d+i);
l[d[i]] = i;
}
for(i=1; i<=2*n; i++)
{
t = l[d[i]];
if(t == i) continue;
if(a <= i) a = 10000000;
if(b <= i) b = 10000000;
if(t > a && t > b)
{
while(1);
printf("IMPOSSIBLE");
return 0;
}
if(t <= a && (a <= b || b < t) )
{
a = t;
# | 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... |