Submission #69226

# Submission time Handle Problem Language Result Execution time Memory
69226 2018-08-20T09:58:45 Z ekrem Bubble Sort 2 (JOI18_bubblesort2) C++
17 / 100
9000 ms 2972 KB
#include <bits/stdc++.h>
#include "bubblesort2.h"
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define N 1000005
using namespace std;

typedef vector < int > vi;

vi countScans(vi a, vi b, vi c){
	vi ans;
	for(int i = 0; i < int(b.size()); i++){
		int cvp = 0;
		a[b[i]] = c[i];
		vi d = a;
		// for(int i = 0; i < d.size(); i++)cout << d[i] << " ";cout << endl;
		sort(d.begin(), d.end());
		map < int , int > yer;
		for(int i = 0; i < int(d.size()); i++){
			if(i + 1 != int(d.size()) and d[i + 1] == d[i])
				continue;
			yer[d[i]] = i;
		}
		for(int i = 0; i < int(a.size()); i++)
			if(i > yer[a[i]])
				cvp = max(cvp, i - yer[a[i]]);
		ans.pb(cvp);
	}
	return ans;
}


// int main(){
// 	freopen("in.txt", "r", stdin);
// 	freopen("out.txt", "w", stdout);
// 	int n,q;
// 	scanf("%d %d",&n ,&q);	
// 	vi a(n);
// 	for(int i=0;i<n;i++)
// 		scanf("%d",&a[i]);
// 	vi b(q), c(q);
// 	for(int j=0;j<q;j++){
// 		scanf("%d %d",&b[j], &c[j]);
// 	}
// 	vi cvp = countScans(a, b, c);
// 	for(int j=0;j<int(cvp.size());j++)
// 		printf("%d\n",cvp[j]);
// }
# Verdict Execution time Memory Grader output
1 Correct 85 ms 416 KB Output is correct
2 Correct 253 ms 676 KB Output is correct
3 Correct 1274 ms 760 KB Output is correct
4 Correct 1274 ms 996 KB Output is correct
5 Correct 1315 ms 996 KB Output is correct
6 Correct 1147 ms 1096 KB Output is correct
7 Correct 1235 ms 1096 KB Output is correct
8 Correct 1344 ms 1432 KB Output is correct
9 Correct 1252 ms 1432 KB Output is correct
10 Correct 1054 ms 1432 KB Output is correct
11 Correct 1128 ms 1456 KB Output is correct
12 Correct 1058 ms 1492 KB Output is correct
13 Correct 970 ms 1528 KB Output is correct
14 Correct 1110 ms 1568 KB Output is correct
15 Correct 972 ms 1600 KB Output is correct
16 Correct 984 ms 1700 KB Output is correct
17 Correct 1051 ms 1864 KB Output is correct
18 Correct 1053 ms 1864 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 85 ms 416 KB Output is correct
2 Correct 253 ms 676 KB Output is correct
3 Correct 1274 ms 760 KB Output is correct
4 Correct 1274 ms 996 KB Output is correct
5 Correct 1315 ms 996 KB Output is correct
6 Correct 1147 ms 1096 KB Output is correct
7 Correct 1235 ms 1096 KB Output is correct
8 Correct 1344 ms 1432 KB Output is correct
9 Correct 1252 ms 1432 KB Output is correct
10 Correct 1054 ms 1432 KB Output is correct
11 Correct 1128 ms 1456 KB Output is correct
12 Correct 1058 ms 1492 KB Output is correct
13 Correct 970 ms 1528 KB Output is correct
14 Correct 1110 ms 1568 KB Output is correct
15 Correct 972 ms 1600 KB Output is correct
16 Correct 984 ms 1700 KB Output is correct
17 Correct 1051 ms 1864 KB Output is correct
18 Correct 1053 ms 1864 KB Output is correct
19 Execution timed out 9053 ms 2424 KB Time limit exceeded
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6803 ms 2424 KB Output is correct
2 Execution timed out 9026 ms 2972 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 85 ms 416 KB Output is correct
2 Correct 253 ms 676 KB Output is correct
3 Correct 1274 ms 760 KB Output is correct
4 Correct 1274 ms 996 KB Output is correct
5 Correct 1315 ms 996 KB Output is correct
6 Correct 1147 ms 1096 KB Output is correct
7 Correct 1235 ms 1096 KB Output is correct
8 Correct 1344 ms 1432 KB Output is correct
9 Correct 1252 ms 1432 KB Output is correct
10 Correct 1054 ms 1432 KB Output is correct
11 Correct 1128 ms 1456 KB Output is correct
12 Correct 1058 ms 1492 KB Output is correct
13 Correct 970 ms 1528 KB Output is correct
14 Correct 1110 ms 1568 KB Output is correct
15 Correct 972 ms 1600 KB Output is correct
16 Correct 984 ms 1700 KB Output is correct
17 Correct 1051 ms 1864 KB Output is correct
18 Correct 1053 ms 1864 KB Output is correct
19 Execution timed out 9053 ms 2424 KB Time limit exceeded
20 Halted 0 ms 0 KB -