# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
746482 | 2023-05-22T13:44:04 Z | nguyentunglam | Bubble Sort 2 (JOI18_bubblesort2) | C++17 | 9000 ms | 596 KB |
#include<bits/stdc++.h> #define fi first #define se second #define endl "\n" #define ii pair<int, int> using namespace std; vector<int> countScans(vector<int> a, vector<int> pos, vector<int> val) { vector<int> ans(pos.size()); int n = a.size(); for(int i = 0; i < pos.size(); i++) { a[pos[i]] = val[i]; for(int j = 0; j < n; j++) { int tmp = 0; for(int k = 0; k < j; k++) if (a[j] < a[k]) tmp++; ans[i] = max(ans[i], tmp); } } return ans; } #ifdef ngu int main() { freopen ("task.inp", "r", stdin); freopen ("task.out", "w", stdout); int n, q; cin >> n >> q; vector<int> a(n), x(q), v(q); for(int i = 0; i < n; i++) cin >> a[i]; for(int i = 0; i < q; i++) cin >> x[i] >> v[i]; vector<int> ret = countScans(a, x, v); for(int &j : ret) cout << j << endl; } #endif // ngu
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 157 ms | 312 KB | Output is correct |
2 | Correct | 587 ms | 324 KB | Output is correct |
3 | Execution timed out | 9059 ms | 340 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 157 ms | 312 KB | Output is correct |
2 | Correct | 587 ms | 324 KB | Output is correct |
3 | Execution timed out | 9059 ms | 340 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 9092 ms | 596 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 157 ms | 312 KB | Output is correct |
2 | Correct | 587 ms | 324 KB | Output is correct |
3 | Execution timed out | 9059 ms | 340 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |