Submission #1100616

#TimeUsernameProblemLanguageResultExecution timeMemory
1100616vjudge1Swap (BOI16_swap)C++98
0 / 100
1 ms336 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n); for(auto &x : a) { cin >> x; } for(int k = 2; k < n; k++) { for(int i = k; i > 1 && a[i] < a[i / 2]; i /= 2) { swap(a[i], a[i / 2]); } } for(int i = 0; i < n; i++) { cout << a[i] << " "; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...