Submission #898686

# Submission time Handle Problem Language Result Execution time Memory
898686 2024-01-05T02:51:18 Z Darren0724 Minerals (JOI19_minerals) C++17
40 / 100
20 ms 2648 KB
#include "minerals.h"
#include <bits/stdc++.h>
using namespace std;
//Query(int)
//Answer(int,int)
void dc(vector<int> &a,vector<int> &b){
	int n=a.size();
	if(n==1){
		Answer(a[0],b[0]);
		return;
	}
	int m=n/2;
	int now=0;
	for(int i=m;i<n;i++){
		now=Query(a[i]);
	}
	vector<int> a1,a2,b1,b2;
	for(int i=0;i<m;i++){
		a1.push_back(a[i]);
	}
	for(int i=m;i<n;i++){
		a2.push_back(a[i]);
	}
	for(int i=0;i<n;i++){
		int t=Query(b[i]);
		if(t==now){
			b1.push_back(b[i]);
		}
		else{
			b2.push_back(b[i]);
		}
		now=t;
	}
	for(int j:b1){
		Query(j);
	}
	dc(a1,b1);
	dc(b2,a2);
}
void Solve(int n) {
	int now=0;
	vector<int> a,b;
	for(int i=1;i<=n*2;i++){
		int t=Query(i);
		if(t==now){
			b.push_back(i);
			Query(i);
		}
		else{
			a.push_back(i);
		}
		now=t;
	}
	dc(a,b);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 600 KB Output is correct
3 Correct 2 ms 600 KB Output is correct
4 Correct 5 ms 856 KB Output is correct
5 Correct 11 ms 1112 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 600 KB Output is correct
7 Correct 2 ms 600 KB Output is correct
8 Correct 5 ms 856 KB Output is correct
9 Correct 11 ms 1112 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 6 ms 1112 KB Output is correct
12 Correct 9 ms 1108 KB Output is correct
13 Correct 7 ms 1112 KB Output is correct
14 Correct 7 ms 1112 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 600 KB Output is correct
7 Correct 2 ms 600 KB Output is correct
8 Correct 5 ms 856 KB Output is correct
9 Correct 11 ms 1112 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 6 ms 1112 KB Output is correct
12 Correct 9 ms 1108 KB Output is correct
13 Correct 7 ms 1112 KB Output is correct
14 Correct 7 ms 1112 KB Output is correct
15 Incorrect 20 ms 2648 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 600 KB Output is correct
7 Correct 2 ms 600 KB Output is correct
8 Correct 5 ms 856 KB Output is correct
9 Correct 11 ms 1112 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 6 ms 1112 KB Output is correct
12 Correct 9 ms 1108 KB Output is correct
13 Correct 7 ms 1112 KB Output is correct
14 Correct 7 ms 1112 KB Output is correct
15 Incorrect 20 ms 2648 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 600 KB Output is correct
7 Correct 2 ms 600 KB Output is correct
8 Correct 5 ms 856 KB Output is correct
9 Correct 11 ms 1112 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 6 ms 1112 KB Output is correct
12 Correct 9 ms 1108 KB Output is correct
13 Correct 7 ms 1112 KB Output is correct
14 Correct 7 ms 1112 KB Output is correct
15 Incorrect 20 ms 2648 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 600 KB Output is correct
7 Correct 2 ms 600 KB Output is correct
8 Correct 5 ms 856 KB Output is correct
9 Correct 11 ms 1112 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 6 ms 1112 KB Output is correct
12 Correct 9 ms 1108 KB Output is correct
13 Correct 7 ms 1112 KB Output is correct
14 Correct 7 ms 1112 KB Output is correct
15 Incorrect 20 ms 2648 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 600 KB Output is correct
7 Correct 2 ms 600 KB Output is correct
8 Correct 5 ms 856 KB Output is correct
9 Correct 11 ms 1112 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 6 ms 1112 KB Output is correct
12 Correct 9 ms 1108 KB Output is correct
13 Correct 7 ms 1112 KB Output is correct
14 Correct 7 ms 1112 KB Output is correct
15 Incorrect 20 ms 2648 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 600 KB Output is correct
7 Correct 2 ms 600 KB Output is correct
8 Correct 5 ms 856 KB Output is correct
9 Correct 11 ms 1112 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 6 ms 1112 KB Output is correct
12 Correct 9 ms 1108 KB Output is correct
13 Correct 7 ms 1112 KB Output is correct
14 Correct 7 ms 1112 KB Output is correct
15 Incorrect 20 ms 2648 KB Wrong Answer [2]
16 Halted 0 ms 0 KB -