# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
25879 | 2017-06-24T16:51:41 Z | nibnalin | Swap (BOI16_swap) | C++14 | 0 ms | 2800 KB |
#include <iostream> #include <cstdio> #include <vector> using namespace std; const int maxn = int(2e5)+5; int A[maxn]; int main(void) { int n; scanf("%d", &n); for(int i = 1;i <= n;i++) scanf("%d", &A[i]); for(int i = 1;i <= n;i++) { if(i*2+1 > n) break; if(A[i*2] < A[i] && A[i*2] < A[i*2+1]) { swap(A[i], A[i*2]); } else if(A[i*2+1] < A[i] && A[i*2+1] < A[i*2]) { swap(A[i], A[i*2+1]); } } for(int i = 1;i <= n;i++) printf("%d ", A[i]); printf("\n"); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 2800 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 2800 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 2800 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 2800 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 2800 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |