Submission #852149

# Submission time Handle Problem Language Result Execution time Memory
852149 2023-09-21T10:17:56 Z LucaIlie Bubble Sort 2 (JOI18_bubblesort2) C++17
17 / 100
9000 ms 604 KB
#include "bubblesort2.h"
#include <bits/stdc++.h>

using namespace std;

vector<int> ans;

vector<int> countScans( vector<int> v, vector<int> pos, vector<int> val ){
    int n = v.size();
    int q = pos.size();
    ans.resize( q );

    for ( int l = 0; l < q; l++ ) {
        v[pos[l]] = val[l];
        ans[l] = 0;
        for ( int i = 0; i < n; i++ ) {
            int inv = 0;
            for ( int j = i; j >= 0; j-- ) {
                if ( v[j] > v[i] )
                    inv++;
            }
            ans[l] = max( ans[l], inv );
        }
    }

    return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 121 ms 344 KB Output is correct
2 Correct 465 ms 440 KB Output is correct
3 Correct 7916 ms 464 KB Output is correct
4 Correct 8102 ms 460 KB Output is correct
5 Correct 5534 ms 348 KB Output is correct
6 Correct 2298 ms 460 KB Output is correct
7 Correct 3096 ms 460 KB Output is correct
8 Correct 4030 ms 468 KB Output is correct
9 Correct 5683 ms 464 KB Output is correct
10 Correct 2981 ms 464 KB Output is correct
11 Correct 3049 ms 468 KB Output is correct
12 Correct 2983 ms 460 KB Output is correct
13 Correct 2971 ms 464 KB Output is correct
14 Correct 3048 ms 468 KB Output is correct
15 Correct 3032 ms 480 KB Output is correct
16 Correct 3071 ms 464 KB Output is correct
17 Correct 3008 ms 464 KB Output is correct
18 Correct 2967 ms 468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 121 ms 344 KB Output is correct
2 Correct 465 ms 440 KB Output is correct
3 Correct 7916 ms 464 KB Output is correct
4 Correct 8102 ms 460 KB Output is correct
5 Correct 5534 ms 348 KB Output is correct
6 Correct 2298 ms 460 KB Output is correct
7 Correct 3096 ms 460 KB Output is correct
8 Correct 4030 ms 468 KB Output is correct
9 Correct 5683 ms 464 KB Output is correct
10 Correct 2981 ms 464 KB Output is correct
11 Correct 3049 ms 468 KB Output is correct
12 Correct 2983 ms 460 KB Output is correct
13 Correct 2971 ms 464 KB Output is correct
14 Correct 3048 ms 468 KB Output is correct
15 Correct 3032 ms 480 KB Output is correct
16 Correct 3071 ms 464 KB Output is correct
17 Correct 3008 ms 464 KB Output is correct
18 Correct 2967 ms 468 KB Output is correct
19 Execution timed out 9053 ms 604 KB Time limit exceeded
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 9038 ms 604 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 121 ms 344 KB Output is correct
2 Correct 465 ms 440 KB Output is correct
3 Correct 7916 ms 464 KB Output is correct
4 Correct 8102 ms 460 KB Output is correct
5 Correct 5534 ms 348 KB Output is correct
6 Correct 2298 ms 460 KB Output is correct
7 Correct 3096 ms 460 KB Output is correct
8 Correct 4030 ms 468 KB Output is correct
9 Correct 5683 ms 464 KB Output is correct
10 Correct 2981 ms 464 KB Output is correct
11 Correct 3049 ms 468 KB Output is correct
12 Correct 2983 ms 460 KB Output is correct
13 Correct 2971 ms 464 KB Output is correct
14 Correct 3048 ms 468 KB Output is correct
15 Correct 3032 ms 480 KB Output is correct
16 Correct 3071 ms 464 KB Output is correct
17 Correct 3008 ms 464 KB Output is correct
18 Correct 2967 ms 468 KB Output is correct
19 Execution timed out 9053 ms 604 KB Time limit exceeded
20 Halted 0 ms 0 KB -