# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
641994 | 2022-09-18T08:26:05 Z | Tsiannis | 중앙값 배열 (balkan11_medians) | C++14 | 43 ms | 3884 KB |
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define INF 10000009 int main () { ll n; cin>>n; ll B[n]; for (int i=0;i<n;i++){ cin>>B[i]; } ll A[2*n-1]; A[0]=B[0]; ll mn=1; ll mx=2*n-1; if (A[0]==1) mn=2; ll idx=1; for (int i=1;i<=2*n-2;i+=2){ if (B[idx]==B[idx-1]) { A[i]=mn; A[i+1]=mx; mn++; mx--; } else { A[i]=B[idx]; if (B[idx]==mn) mn++; A[i+1]=mx; mx--; } idx++; } for (int i=0;i<2*n-1;i++) cout<<A[i]<<' '; cout<<endl; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Not a permutation |
2 | Incorrect | 0 ms | 212 KB | Not a permutation |
3 | Incorrect | 0 ms | 212 KB | Not a permutation |
4 | Incorrect | 0 ms | 212 KB | Not a permutation |
5 | Incorrect | 0 ms | 212 KB | Not a permutation |
6 | Incorrect | 0 ms | 212 KB | Not a permutation |
7 | Incorrect | 0 ms | 212 KB | Not a permutation |
8 | Incorrect | 0 ms | 212 KB | Not a permutation |
9 | Incorrect | 0 ms | 212 KB | Not a permutation |
10 | Incorrect | 0 ms | 212 KB | Not a permutation |
11 | Incorrect | 1 ms | 212 KB | Not a permutation |
12 | Incorrect | 1 ms | 212 KB | Not a permutation |
13 | Incorrect | 1 ms | 212 KB | Not a permutation |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 340 KB | Not a permutation |
2 | Incorrect | 2 ms | 340 KB | Not a permutation |
3 | Incorrect | 3 ms | 468 KB | Not a permutation |
4 | Incorrect | 7 ms | 852 KB | Not a permutation |
5 | Incorrect | 13 ms | 1312 KB | Not a permutation |
6 | Incorrect | 28 ms | 2580 KB | Not a permutation |
7 | Incorrect | 43 ms | 3884 KB | Not a permutation |