Submission #408874

# Submission time Handle Problem Language Result Execution time Memory
408874 2021-05-19T18:28:56 Z doowey Bubble Sort 2 (JOI18_bubblesort2) C++14
38 / 100
9000 ms 2196 KB
#include <bits/stdc++.h>
#include "bubblesort2.h"

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

#define fi first
#define se second
#define mp make_pair

vector<int> countScans(vector<int> A, vector<int> X, vector<int> V){
	vector<int> outp;
    int n = A.size();
    int q = X.size();
    int sol;
    for(int iq = 0; iq < q; iq ++ ){
        A[X[iq]] = V[iq];
        vector<pii> cha;
        sol = 0;
        for(int i = 0 ; i < n; i ++ ){
            cha.push_back(mp(A[i], i));
        }
        sort(cha.begin(), cha.end());
        for(int i = 0 ; i < n; i ++ ){
            sol = max(sol, cha[i].se - i);
        }
        outp.push_back(sol);
    }
	return outp;
}
# Verdict Execution time Memory Grader output
1 Correct 18 ms 332 KB Output is correct
2 Correct 45 ms 332 KB Output is correct
3 Correct 276 ms 404 KB Output is correct
4 Correct 279 ms 452 KB Output is correct
5 Correct 267 ms 540 KB Output is correct
6 Correct 186 ms 400 KB Output is correct
7 Correct 233 ms 404 KB Output is correct
8 Correct 248 ms 452 KB Output is correct
9 Correct 283 ms 400 KB Output is correct
10 Correct 177 ms 384 KB Output is correct
11 Correct 175 ms 412 KB Output is correct
12 Correct 179 ms 412 KB Output is correct
13 Correct 179 ms 452 KB Output is correct
14 Correct 176 ms 332 KB Output is correct
15 Correct 174 ms 400 KB Output is correct
16 Correct 167 ms 408 KB Output is correct
17 Correct 187 ms 412 KB Output is correct
18 Correct 164 ms 396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 332 KB Output is correct
2 Correct 45 ms 332 KB Output is correct
3 Correct 276 ms 404 KB Output is correct
4 Correct 279 ms 452 KB Output is correct
5 Correct 267 ms 540 KB Output is correct
6 Correct 186 ms 400 KB Output is correct
7 Correct 233 ms 404 KB Output is correct
8 Correct 248 ms 452 KB Output is correct
9 Correct 283 ms 400 KB Output is correct
10 Correct 177 ms 384 KB Output is correct
11 Correct 175 ms 412 KB Output is correct
12 Correct 179 ms 412 KB Output is correct
13 Correct 179 ms 452 KB Output is correct
14 Correct 176 ms 332 KB Output is correct
15 Correct 174 ms 400 KB Output is correct
16 Correct 167 ms 408 KB Output is correct
17 Correct 187 ms 412 KB Output is correct
18 Correct 164 ms 396 KB Output is correct
19 Correct 3903 ms 760 KB Output is correct
20 Correct 5088 ms 808 KB Output is correct
21 Correct 4428 ms 920 KB Output is correct
22 Correct 4938 ms 812 KB Output is correct
23 Correct 3196 ms 836 KB Output is correct
24 Correct 3213 ms 840 KB Output is correct
25 Correct 3189 ms 772 KB Output is correct
26 Correct 3237 ms 776 KB Output is correct
27 Correct 3191 ms 876 KB Output is correct
28 Correct 3230 ms 748 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6590 ms 1288 KB Output is correct
2 Execution timed out 9018 ms 2196 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 18 ms 332 KB Output is correct
2 Correct 45 ms 332 KB Output is correct
3 Correct 276 ms 404 KB Output is correct
4 Correct 279 ms 452 KB Output is correct
5 Correct 267 ms 540 KB Output is correct
6 Correct 186 ms 400 KB Output is correct
7 Correct 233 ms 404 KB Output is correct
8 Correct 248 ms 452 KB Output is correct
9 Correct 283 ms 400 KB Output is correct
10 Correct 177 ms 384 KB Output is correct
11 Correct 175 ms 412 KB Output is correct
12 Correct 179 ms 412 KB Output is correct
13 Correct 179 ms 452 KB Output is correct
14 Correct 176 ms 332 KB Output is correct
15 Correct 174 ms 400 KB Output is correct
16 Correct 167 ms 408 KB Output is correct
17 Correct 187 ms 412 KB Output is correct
18 Correct 164 ms 396 KB Output is correct
19 Correct 3903 ms 760 KB Output is correct
20 Correct 5088 ms 808 KB Output is correct
21 Correct 4428 ms 920 KB Output is correct
22 Correct 4938 ms 812 KB Output is correct
23 Correct 3196 ms 836 KB Output is correct
24 Correct 3213 ms 840 KB Output is correct
25 Correct 3189 ms 772 KB Output is correct
26 Correct 3237 ms 776 KB Output is correct
27 Correct 3191 ms 876 KB Output is correct
28 Correct 3230 ms 748 KB Output is correct
29 Correct 6590 ms 1288 KB Output is correct
30 Execution timed out 9018 ms 2196 KB Time limit exceeded
31 Halted 0 ms 0 KB -