Submission #143502

# Submission time Handle Problem Language Result Execution time Memory
143502 2019-08-14T11:38:11 Z shashwatchandra Bubble Sort 2 (JOI18_bubblesort2) C++17
17 / 100
9000 ms 832 KB
#include "bubblesort2.h"
#include <bits/stdc++.h>

using namespace std;

#define REP(i,n) for(int i = 0;i < n;i++)

vector<int> countScans(vector<int> a,vector<int> x,vector<int> v){
	vector<int> answer;
	REP(i,x.size()){
		a[x[i]] = v[i];
		int ans = 0;
		REP(i,a.size()){
			int cur = 0;
			REP(j,i){
				if(a[j] > a[i])cur++;
			}
			ans = max(ans,cur);
		}
		answer.push_back(ans);
	}
	return answer;
}

Compilation message

bubblesort2.cpp: In function 'std::vector<int> countScans(std::vector<int>, std::vector<int>, std::vector<int>)':
bubblesort2.cpp:6:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define REP(i,n) for(int i = 0;i < n;i++)
bubblesort2.cpp:10:6:
  REP(i,x.size()){
      ~~~~~~~~~~                   
bubblesort2.cpp:10:2: note: in expansion of macro 'REP'
  REP(i,x.size()){
  ^~~
bubblesort2.cpp:6:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define REP(i,n) for(int i = 0;i < n;i++)
bubblesort2.cpp:13:7:
   REP(i,a.size()){
       ~~~~~~~~~~                  
bubblesort2.cpp:13:3: note: in expansion of macro 'REP'
   REP(i,a.size()){
   ^~~
# Verdict Execution time Memory Grader output
1 Correct 69 ms 376 KB Output is correct
2 Correct 239 ms 504 KB Output is correct
3 Correct 3383 ms 632 KB Output is correct
4 Correct 3382 ms 632 KB Output is correct
5 Correct 3393 ms 508 KB Output is correct
6 Correct 3382 ms 584 KB Output is correct
7 Correct 3381 ms 452 KB Output is correct
8 Correct 3584 ms 508 KB Output is correct
9 Correct 3380 ms 504 KB Output is correct
10 Correct 3388 ms 632 KB Output is correct
11 Correct 3407 ms 608 KB Output is correct
12 Correct 3396 ms 644 KB Output is correct
13 Correct 3394 ms 668 KB Output is correct
14 Correct 3397 ms 504 KB Output is correct
15 Correct 3386 ms 832 KB Output is correct
16 Correct 3390 ms 636 KB Output is correct
17 Correct 3394 ms 504 KB Output is correct
18 Correct 3382 ms 632 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 69 ms 376 KB Output is correct
2 Correct 239 ms 504 KB Output is correct
3 Correct 3383 ms 632 KB Output is correct
4 Correct 3382 ms 632 KB Output is correct
5 Correct 3393 ms 508 KB Output is correct
6 Correct 3382 ms 584 KB Output is correct
7 Correct 3381 ms 452 KB Output is correct
8 Correct 3584 ms 508 KB Output is correct
9 Correct 3380 ms 504 KB Output is correct
10 Correct 3388 ms 632 KB Output is correct
11 Correct 3407 ms 608 KB Output is correct
12 Correct 3396 ms 644 KB Output is correct
13 Correct 3394 ms 668 KB Output is correct
14 Correct 3397 ms 504 KB Output is correct
15 Correct 3386 ms 832 KB Output is correct
16 Correct 3390 ms 636 KB Output is correct
17 Correct 3394 ms 504 KB Output is correct
18 Correct 3382 ms 632 KB Output is correct
19 Execution timed out 9024 ms 696 KB Time limit exceeded
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 9018 ms 636 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 69 ms 376 KB Output is correct
2 Correct 239 ms 504 KB Output is correct
3 Correct 3383 ms 632 KB Output is correct
4 Correct 3382 ms 632 KB Output is correct
5 Correct 3393 ms 508 KB Output is correct
6 Correct 3382 ms 584 KB Output is correct
7 Correct 3381 ms 452 KB Output is correct
8 Correct 3584 ms 508 KB Output is correct
9 Correct 3380 ms 504 KB Output is correct
10 Correct 3388 ms 632 KB Output is correct
11 Correct 3407 ms 608 KB Output is correct
12 Correct 3396 ms 644 KB Output is correct
13 Correct 3394 ms 668 KB Output is correct
14 Correct 3397 ms 504 KB Output is correct
15 Correct 3386 ms 832 KB Output is correct
16 Correct 3390 ms 636 KB Output is correct
17 Correct 3394 ms 504 KB Output is correct
18 Correct 3382 ms 632 KB Output is correct
19 Execution timed out 9024 ms 696 KB Time limit exceeded
20 Halted 0 ms 0 KB -