답안 #1089997

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1089997 2024-09-17T14:02:22 Z VMaksimoski008 Bubble Sort 2 (JOI18_bubblesort2) C++17
38 / 100
650 ms 868 KB
#include "bubblesort2.h"
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
 
const int maxn = 5e5 + 5;
 
vector<int> countScans(vector<int> A, vector<int> X, vector<int> V) {
	int n = A.size(), q = X.size();
 
	vector<int> ans(q);
	
    //goody ahh ideja, sto bi kazal bratot Nikola
    vector<int> p(n);
    for(int i=0; i<n; i++)
        for(int j=0; j<n; j++) p[i] += (A[j] < A[i]);
    
    for(int it=0; it<q; it++) {
        for(int i=0; i<n; i++) p[i] -= (A[X[it]] < A[i]);
        A[X[it]] = V[it];
        p[X[it]] = 0;
        for(int i=0; i<n; i++) p[X[it]] += (A[i] < A[X[it]]);
        for(int i=0; i<n; i++) p[i] += (A[X[it]] < A[i]);
        for(int i=0; i<n; i++) ans[it] = max(ans[it], i - p[i]);
    }
 
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 3 ms 504 KB Output is correct
3 Correct 14 ms 540 KB Output is correct
4 Correct 14 ms 544 KB Output is correct
5 Correct 14 ms 348 KB Output is correct
6 Correct 14 ms 544 KB Output is correct
7 Correct 14 ms 344 KB Output is correct
8 Correct 14 ms 540 KB Output is correct
9 Correct 14 ms 544 KB Output is correct
10 Correct 14 ms 344 KB Output is correct
11 Correct 14 ms 536 KB Output is correct
12 Correct 14 ms 348 KB Output is correct
13 Correct 14 ms 348 KB Output is correct
14 Correct 14 ms 348 KB Output is correct
15 Correct 14 ms 344 KB Output is correct
16 Correct 14 ms 500 KB Output is correct
17 Correct 18 ms 348 KB Output is correct
18 Correct 14 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 3 ms 504 KB Output is correct
3 Correct 14 ms 540 KB Output is correct
4 Correct 14 ms 544 KB Output is correct
5 Correct 14 ms 348 KB Output is correct
6 Correct 14 ms 544 KB Output is correct
7 Correct 14 ms 344 KB Output is correct
8 Correct 14 ms 540 KB Output is correct
9 Correct 14 ms 544 KB Output is correct
10 Correct 14 ms 344 KB Output is correct
11 Correct 14 ms 536 KB Output is correct
12 Correct 14 ms 348 KB Output is correct
13 Correct 14 ms 348 KB Output is correct
14 Correct 14 ms 348 KB Output is correct
15 Correct 14 ms 344 KB Output is correct
16 Correct 14 ms 500 KB Output is correct
17 Correct 18 ms 348 KB Output is correct
18 Correct 14 ms 344 KB Output is correct
19 Correct 170 ms 796 KB Output is correct
20 Correct 215 ms 864 KB Output is correct
21 Correct 212 ms 864 KB Output is correct
22 Correct 214 ms 860 KB Output is correct
23 Correct 212 ms 852 KB Output is correct
24 Correct 219 ms 824 KB Output is correct
25 Correct 218 ms 840 KB Output is correct
26 Correct 213 ms 832 KB Output is correct
27 Correct 212 ms 824 KB Output is correct
28 Correct 212 ms 852 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 650 ms 868 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 3 ms 504 KB Output is correct
3 Correct 14 ms 540 KB Output is correct
4 Correct 14 ms 544 KB Output is correct
5 Correct 14 ms 348 KB Output is correct
6 Correct 14 ms 544 KB Output is correct
7 Correct 14 ms 344 KB Output is correct
8 Correct 14 ms 540 KB Output is correct
9 Correct 14 ms 544 KB Output is correct
10 Correct 14 ms 344 KB Output is correct
11 Correct 14 ms 536 KB Output is correct
12 Correct 14 ms 348 KB Output is correct
13 Correct 14 ms 348 KB Output is correct
14 Correct 14 ms 348 KB Output is correct
15 Correct 14 ms 344 KB Output is correct
16 Correct 14 ms 500 KB Output is correct
17 Correct 18 ms 348 KB Output is correct
18 Correct 14 ms 344 KB Output is correct
19 Correct 170 ms 796 KB Output is correct
20 Correct 215 ms 864 KB Output is correct
21 Correct 212 ms 864 KB Output is correct
22 Correct 214 ms 860 KB Output is correct
23 Correct 212 ms 852 KB Output is correct
24 Correct 219 ms 824 KB Output is correct
25 Correct 218 ms 840 KB Output is correct
26 Correct 213 ms 832 KB Output is correct
27 Correct 212 ms 824 KB Output is correct
28 Correct 212 ms 852 KB Output is correct
29 Incorrect 650 ms 868 KB Output isn't correct
30 Halted 0 ms 0 KB -