# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
12352 | baneling100 | 전선 연결하기 (GA9_wire) | C++98 | 0 ms | 10460 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 N, A[600001], Check[300001], S[600001], Top;
int M, Down[600001], Ans[300001];
int main(void) {
int i, j;
scanf("%d",&N);
for(i=1 ; i<=2*N ; i++)
scanf("%d",&A[i]);
for(i=1 ; i<=2*N ; i++) {
if(Check[A[i]]>0) {
Ans[A[i]]=1;
for(j=Check[A[i]]+1 ; j<=Top ; j++) {
Check[S[j]]=-1;
Down[++M]=S[j];
}
Top=Check[A[i]]-1;
Check[A[i]]=0;
}
else if(Check[A[i]]==0) {
S[++Top]=A[i];
Check[A[i]]=Top;
}
else {
Check[A[i]]=0;
Down[++M]=A[i];
}
# | 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... |