# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
136360 | khsoo01 | Queue (CEOI06_queue) | C++11 | 434 ms | 20196 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define X first
#define Y second
using namespace std;
typedef pair<int,int> pii;
const int N = 50005, inf = 1e9+7;
map<int, int> fr, bk, s[2];
int getfr (int I) {
if(fr.find(I) == fr.end()) return I-1;
return fr[I];
}
int getbk (int I) {
if(bk.find(I) == bk.end()) return I+1;
return bk[I];
}
int main()
{
int n, q, CT = 1;
scanf("%d",&n);
while(n--) {
int A, B;
scanf("%d%d",&A,&B);
int AF = getfr(A), AB = getbk(A), BF = getfr(B);
if(A == B || AB == B) continue;
fr[AB] = AF;
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |