Submission #945005

# Submission time Handle Problem Language Result Execution time Memory
945005 2024-03-13T09:50:34 Z dsyz Chameleon's Love (JOI20_chameleon) C++17
0 / 100
14 ms 596 KB
#include <bits/stdc++.h>
#include "chameleon.h"
using namespace std;
using ll = long long;
#define MAXN (1000005)

void Solve(int N) {
	vector<pair<ll,ll> > v;
	bool done[2 * N];
	memset(done,0,sizeof(done));
	for(ll i = 0;i < 2*N;i++){
		if(done[i]) continue;
		for(ll j = i + 1;j < 2*N;j++){
			if(done[i]) break;
			if(done[j]) continue;
			vector<int> p(2);
			p[0] = i + 1;
			p[1] = j + 1;
			ll colours = Query(p);
			if(colours == 1){
				v.push_back({i,j});
				done[i] = 1;
				done[j] = 1;
				break;
			}
		}
	}
	for(ll i = 0;i < N;i++){
		Answer(v[i].first + 1,v[i].second + 1);
	}
}
# 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 Incorrect 14 ms 344 KB Wrong Answer [3]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Incorrect 0 ms 596 KB Wrong Answer [6]
3 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 Incorrect 14 ms 344 KB Wrong Answer [3]
4 Halted 0 ms 0 KB -