# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
4898 | 2014-01-07T06:44:24 Z | gs13068 | 중앙값 배열 (balkan11_medians) | C++ | 36 ms | 1408 KB |
#include<cstdio> bool exist[300000]; int main() { int l,r,bef; int i,t,n; scanf("%d",&n); l=1;r=2*n-1; scanf("%d",&t); printf("%d",t); exist[t]=true; bef=t; for(i=1;i<n;i++) { scanf("%d",&t); if(!exist[t]) { exist[t]=true; printf(" %d",t); if(t<bef) { while(exist[l])l++; exist[l]=true; printf(" %d",l); } else { while(exist[r])r--; exist[r]=true; printf(" %d",r); } } else { while(exist[l])l++; exist[l]=true; printf(" %d",l); while(exist[r])r--; exist[r]=true; printf(" %d",r); } } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 1408 KB | Output is correct |
2 | Incorrect | 0 ms | 1408 KB | Output isn't correct |
3 | Correct | 0 ms | 1408 KB | Output is correct |
4 | Incorrect | 0 ms | 1408 KB | Output isn't correct |
5 | Incorrect | 0 ms | 1408 KB | Output isn't correct |
6 | Correct | 0 ms | 1408 KB | Output is correct |
7 | Incorrect | 0 ms | 1408 KB | Output isn't correct |
8 | Incorrect | 0 ms | 1408 KB | Output isn't correct |
9 | Incorrect | 0 ms | 1408 KB | Output isn't correct |
10 | Incorrect | 0 ms | 1408 KB | Output isn't correct |
11 | Incorrect | 0 ms | 1408 KB | Output isn't correct |
12 | Incorrect | 0 ms | 1408 KB | Output isn't correct |
13 | Incorrect | 0 ms | 1408 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 1408 KB | Output isn't correct |
2 | Incorrect | 0 ms | 1408 KB | Output isn't correct |
3 | Incorrect | 0 ms | 1408 KB | Output isn't correct |
4 | Incorrect | 3 ms | 1408 KB | Output isn't correct |
5 | Incorrect | 9 ms | 1408 KB | Output isn't correct |
6 | Incorrect | 19 ms | 1408 KB | Output isn't correct |
7 | Incorrect | 36 ms | 1408 KB | Output isn't correct |