Submission #230190

# Submission time Handle Problem Language Result Execution time Memory
230190 2020-05-09T03:28:21 Z mohamedsobhi777 Bubble Sort 2 (JOI18_bubblesort2) C++14
17 / 100
9000 ms 768 KB
#include<bits/stdc++.h>
#include "bubblesort2.h"
 
 
using namespace std ; 
 
vector<int> countScans(vector<int> A,vector<int> X,vector<int> V){
	int Q=A.size();
    int B = X.size() ; 
	vector<int> ret ; 
    vector<int> aux; 
    for(int i = 0 ;i <  B ;i++){
        A[X[i]] = V[i] ; 
        aux.clear() ; 
        for(int j = 0;j < Q ;j ++){
            aux.push_back(A[j]) ; 
        }   
        int ans = 0 ; 
        for(int j = 0 ;j < Q ;j ++){
            int kk =  -1 ; 
            for(int k = 0 ; k < Q ; k ++ ){
                if( k <= j){
                    kk+=(aux[k] <= aux[j]) ; 
                }   
                else{
                    kk+=(aux[k] < aux[j]) ; 
                }
            }
            ans = max(ans ,  j - kk ) ; 
        }
        ret.push_back(ans) ; 
    }
 
	return ret;
}
# Verdict Execution time Memory Grader output
1 Correct 162 ms 376 KB Output is correct
2 Correct 542 ms 384 KB Output is correct
3 Correct 7592 ms 432 KB Output is correct
4 Correct 7599 ms 432 KB Output is correct
5 Correct 7563 ms 428 KB Output is correct
6 Correct 7578 ms 504 KB Output is correct
7 Correct 7563 ms 376 KB Output is correct
8 Correct 7545 ms 436 KB Output is correct
9 Correct 7599 ms 552 KB Output is correct
10 Correct 7635 ms 456 KB Output is correct
11 Correct 7595 ms 512 KB Output is correct
12 Correct 7580 ms 428 KB Output is correct
13 Correct 7594 ms 432 KB Output is correct
14 Correct 7656 ms 420 KB Output is correct
15 Correct 7607 ms 440 KB Output is correct
16 Correct 7652 ms 556 KB Output is correct
17 Correct 7609 ms 504 KB Output is correct
18 Correct 7609 ms 432 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 162 ms 376 KB Output is correct
2 Correct 542 ms 384 KB Output is correct
3 Correct 7592 ms 432 KB Output is correct
4 Correct 7599 ms 432 KB Output is correct
5 Correct 7563 ms 428 KB Output is correct
6 Correct 7578 ms 504 KB Output is correct
7 Correct 7563 ms 376 KB Output is correct
8 Correct 7545 ms 436 KB Output is correct
9 Correct 7599 ms 552 KB Output is correct
10 Correct 7635 ms 456 KB Output is correct
11 Correct 7595 ms 512 KB Output is correct
12 Correct 7580 ms 428 KB Output is correct
13 Correct 7594 ms 432 KB Output is correct
14 Correct 7656 ms 420 KB Output is correct
15 Correct 7607 ms 440 KB Output is correct
16 Correct 7652 ms 556 KB Output is correct
17 Correct 7609 ms 504 KB Output is correct
18 Correct 7609 ms 432 KB Output is correct
19 Execution timed out 9083 ms 512 KB Time limit exceeded
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 9079 ms 768 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 162 ms 376 KB Output is correct
2 Correct 542 ms 384 KB Output is correct
3 Correct 7592 ms 432 KB Output is correct
4 Correct 7599 ms 432 KB Output is correct
5 Correct 7563 ms 428 KB Output is correct
6 Correct 7578 ms 504 KB Output is correct
7 Correct 7563 ms 376 KB Output is correct
8 Correct 7545 ms 436 KB Output is correct
9 Correct 7599 ms 552 KB Output is correct
10 Correct 7635 ms 456 KB Output is correct
11 Correct 7595 ms 512 KB Output is correct
12 Correct 7580 ms 428 KB Output is correct
13 Correct 7594 ms 432 KB Output is correct
14 Correct 7656 ms 420 KB Output is correct
15 Correct 7607 ms 440 KB Output is correct
16 Correct 7652 ms 556 KB Output is correct
17 Correct 7609 ms 504 KB Output is correct
18 Correct 7609 ms 432 KB Output is correct
19 Execution timed out 9083 ms 512 KB Time limit exceeded
20 Halted 0 ms 0 KB -