Submission #18595

#TimeUsernameProblemLanguageResultExecution timeMemory
18595jjhstop버블 정렬 (OJUZ10_bubblesort)C++98
100 / 100
54 ms2372 KiB
#include <stdio.h> #include <queue> using namespace std; int data[100005]; priority_queue<int, vector<int>, greater<int> > q; int main() { int N, K; scanf("%d %d", &N, &K); for (int i = 0; i < N; i++) scanf("%d", &data[i]); for (int i = 0; i < K; i++) q.push(data[i]); for (int i = K; i < N; i++) { q.push(data[i]); printf("%d ", q.top()); q.pop(); } while (!q.empty()) { printf("%d ", q.top()); q.pop(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...