Submission #852106

# Submission time Handle Problem Language Result Execution time Memory
852106 2023-09-21T08:38:32 Z MrDeboo Bubble Sort 2 (JOI18_bubblesort2) C++17
38 / 100
9000 ms 2672 KB
#include "bubblesort2.h"
#include "bits/stdc++.h"
using namespace std;
std::vector<int> countScans(std::vector<int> a,std::vector<int> x,std::vector<int> v){
	vector<int>answer;
	for (int j=0;j<x.size();j++) {
		a[x[j]]=v[j];
		vector<pair<int,int>>voc;
		for(int i=0;i<a.size();i++){
			voc.push_back({a[i],i});
		}
		sort(voc.begin(),voc.end());
		int ans=0;
		for(int i=0;i<a.size();i++)ans=max(ans,voc[i].second-i);
		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:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 |  for (int j=0;j<x.size();j++) {
      |               ~^~~~~~~~~
bubblesort2.cpp:9:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |   for(int i=0;i<a.size();i++){
      |               ~^~~~~~~~~
bubblesort2.cpp:14:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |   for(int i=0;i<a.size();i++)ans=max(ans,voc[i].second-i);
      |               ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 13 ms 344 KB Output is correct
2 Correct 34 ms 492 KB Output is correct
3 Correct 214 ms 344 KB Output is correct
4 Correct 214 ms 344 KB Output is correct
5 Correct 206 ms 344 KB Output is correct
6 Correct 140 ms 344 KB Output is correct
7 Correct 182 ms 344 KB Output is correct
8 Correct 203 ms 540 KB Output is correct
9 Correct 209 ms 344 KB Output is correct
10 Correct 142 ms 792 KB Output is correct
11 Correct 134 ms 344 KB Output is correct
12 Correct 135 ms 344 KB Output is correct
13 Correct 138 ms 344 KB Output is correct
14 Correct 140 ms 784 KB Output is correct
15 Correct 136 ms 532 KB Output is correct
16 Correct 145 ms 344 KB Output is correct
17 Correct 127 ms 536 KB Output is correct
18 Correct 120 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 13 ms 344 KB Output is correct
2 Correct 34 ms 492 KB Output is correct
3 Correct 214 ms 344 KB Output is correct
4 Correct 214 ms 344 KB Output is correct
5 Correct 206 ms 344 KB Output is correct
6 Correct 140 ms 344 KB Output is correct
7 Correct 182 ms 344 KB Output is correct
8 Correct 203 ms 540 KB Output is correct
9 Correct 209 ms 344 KB Output is correct
10 Correct 142 ms 792 KB Output is correct
11 Correct 134 ms 344 KB Output is correct
12 Correct 135 ms 344 KB Output is correct
13 Correct 138 ms 344 KB Output is correct
14 Correct 140 ms 784 KB Output is correct
15 Correct 136 ms 532 KB Output is correct
16 Correct 145 ms 344 KB Output is correct
17 Correct 127 ms 536 KB Output is correct
18 Correct 120 ms 344 KB Output is correct
19 Correct 3039 ms 1360 KB Output is correct
20 Correct 3990 ms 1192 KB Output is correct
21 Correct 3652 ms 948 KB Output is correct
22 Correct 3894 ms 1104 KB Output is correct
23 Correct 2530 ms 1144 KB Output is correct
24 Correct 2565 ms 1104 KB Output is correct
25 Correct 2541 ms 1148 KB Output is correct
26 Correct 2557 ms 884 KB Output is correct
27 Correct 2524 ms 1104 KB Output is correct
28 Correct 2488 ms 912 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5259 ms 1704 KB Output is correct
2 Execution timed out 9023 ms 2672 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 13 ms 344 KB Output is correct
2 Correct 34 ms 492 KB Output is correct
3 Correct 214 ms 344 KB Output is correct
4 Correct 214 ms 344 KB Output is correct
5 Correct 206 ms 344 KB Output is correct
6 Correct 140 ms 344 KB Output is correct
7 Correct 182 ms 344 KB Output is correct
8 Correct 203 ms 540 KB Output is correct
9 Correct 209 ms 344 KB Output is correct
10 Correct 142 ms 792 KB Output is correct
11 Correct 134 ms 344 KB Output is correct
12 Correct 135 ms 344 KB Output is correct
13 Correct 138 ms 344 KB Output is correct
14 Correct 140 ms 784 KB Output is correct
15 Correct 136 ms 532 KB Output is correct
16 Correct 145 ms 344 KB Output is correct
17 Correct 127 ms 536 KB Output is correct
18 Correct 120 ms 344 KB Output is correct
19 Correct 3039 ms 1360 KB Output is correct
20 Correct 3990 ms 1192 KB Output is correct
21 Correct 3652 ms 948 KB Output is correct
22 Correct 3894 ms 1104 KB Output is correct
23 Correct 2530 ms 1144 KB Output is correct
24 Correct 2565 ms 1104 KB Output is correct
25 Correct 2541 ms 1148 KB Output is correct
26 Correct 2557 ms 884 KB Output is correct
27 Correct 2524 ms 1104 KB Output is correct
28 Correct 2488 ms 912 KB Output is correct
29 Correct 5259 ms 1704 KB Output is correct
30 Execution timed out 9023 ms 2672 KB Time limit exceeded
31 Halted 0 ms 0 KB -