Submission #852141

# Submission time Handle Problem Language Result Execution time Memory
852141 2023-09-21T10:03:17 Z LucaIlie Bubble Sort 2 (JOI18_bubblesort2) C++17
0 / 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++ ) {
            for ( int j = i; j >= 0; j-- ) {
                if ( v[j] > v[i] )
                    ans[l] = max( ans[l], i - j );
            }
        }
    }

    return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 132 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 132 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 9041 ms 604 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 132 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -