Submission #412357

# Submission time Handle Problem Language Result Execution time Memory
412357 2021-05-26T17:47:39 Z nichke Bubble Sort 2 (JOI18_bubblesort2) C++14
17 / 100
9000 ms 596 KB
#include <bits/stdc++.h>
using namespace std;

vector<int> countScans(vector<int> A, vector<int> X, vector<int> V) {
	vector<int> ans;
	for (int i = 0; i < X.size(); i++) {
		A[X[i]] = V[i];
		int res = 0;
		for (int j = 0; j < A.size(); j++) {
			int cnt = 0;
			for (int k = 0; k < j; k++) {
				cnt += (A[k] > A[j]);
			}
			res = max(res, cnt);
		}
		ans.push_back(res);
	}
	return ans;
}

Compilation message

bubblesort2.cpp: In function 'std::vector<int> countScans(std::vector<int>, std::vector<int>, std::vector<int>)':
bubblesort2.cpp:6:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 |  for (int i = 0; i < X.size(); i++) {
      |                  ~~^~~~~~~~~~
bubblesort2.cpp:9:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |   for (int j = 0; j < A.size(); j++) {
      |                   ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 67 ms 296 KB Output is correct
2 Correct 218 ms 316 KB Output is correct
3 Correct 3114 ms 504 KB Output is correct
4 Correct 3185 ms 392 KB Output is correct
5 Correct 3303 ms 380 KB Output is correct
6 Correct 3230 ms 376 KB Output is correct
7 Correct 3103 ms 500 KB Output is correct
8 Correct 3131 ms 496 KB Output is correct
9 Correct 3159 ms 372 KB Output is correct
10 Correct 3109 ms 484 KB Output is correct
11 Correct 3082 ms 504 KB Output is correct
12 Correct 3101 ms 368 KB Output is correct
13 Correct 3088 ms 380 KB Output is correct
14 Correct 3129 ms 372 KB Output is correct
15 Correct 3101 ms 372 KB Output is correct
16 Correct 3077 ms 488 KB Output is correct
17 Correct 3163 ms 368 KB Output is correct
18 Correct 3098 ms 368 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 67 ms 296 KB Output is correct
2 Correct 218 ms 316 KB Output is correct
3 Correct 3114 ms 504 KB Output is correct
4 Correct 3185 ms 392 KB Output is correct
5 Correct 3303 ms 380 KB Output is correct
6 Correct 3230 ms 376 KB Output is correct
7 Correct 3103 ms 500 KB Output is correct
8 Correct 3131 ms 496 KB Output is correct
9 Correct 3159 ms 372 KB Output is correct
10 Correct 3109 ms 484 KB Output is correct
11 Correct 3082 ms 504 KB Output is correct
12 Correct 3101 ms 368 KB Output is correct
13 Correct 3088 ms 380 KB Output is correct
14 Correct 3129 ms 372 KB Output is correct
15 Correct 3101 ms 372 KB Output is correct
16 Correct 3077 ms 488 KB Output is correct
17 Correct 3163 ms 368 KB Output is correct
18 Correct 3098 ms 368 KB Output is correct
19 Execution timed out 9093 ms 596 KB Time limit exceeded
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 9015 ms 588 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 67 ms 296 KB Output is correct
2 Correct 218 ms 316 KB Output is correct
3 Correct 3114 ms 504 KB Output is correct
4 Correct 3185 ms 392 KB Output is correct
5 Correct 3303 ms 380 KB Output is correct
6 Correct 3230 ms 376 KB Output is correct
7 Correct 3103 ms 500 KB Output is correct
8 Correct 3131 ms 496 KB Output is correct
9 Correct 3159 ms 372 KB Output is correct
10 Correct 3109 ms 484 KB Output is correct
11 Correct 3082 ms 504 KB Output is correct
12 Correct 3101 ms 368 KB Output is correct
13 Correct 3088 ms 380 KB Output is correct
14 Correct 3129 ms 372 KB Output is correct
15 Correct 3101 ms 372 KB Output is correct
16 Correct 3077 ms 488 KB Output is correct
17 Correct 3163 ms 368 KB Output is correct
18 Correct 3098 ms 368 KB Output is correct
19 Execution timed out 9093 ms 596 KB Time limit exceeded
20 Halted 0 ms 0 KB -