Submission #944990

# Submission time Handle Problem Language Result Execution time Memory
944990 2024-03-13T09:39:18 Z AccountName Chameleon's Love (JOI20_chameleon) C++14
0 / 100
14 ms 596 KB
#include "chameleon.h"
//#include <vector>
#include <bits/stdc++.h>
using namespace std;

namespace {

int variable_example = 1;

}  // namespace

void Solve(int N) {
	bool found[1005];
	for (int i = 0; i < 1005; i++)
	{
		found[i] = false;
	}
	
	for (int i = 0; i < 2 * N - 1; i++)
	{
		for (int j = i + 1; j < 2 * N; j++)
		{
			if (found[i + 1]) break;
			if (found[j + 1]) continue;
			
			vector<int> p(2);
			p[0] = i + 1;
			p[1] = j + 1;
			
			int result = Query(p);
			
			//cout << p[0] << " " << p[1] << " " << result << "\n";
			
			if (result == 1)
			{
				found[i + 1] = true;
				found[j + 1] = true;
				
				Answer(i + 1, j + 1);
				
				//cout << "answer\n";
				break;
			}
		}
		
	}
	
	/*
	std::vector<int> p(3);
	p[0] = 1;
	p[1] = 2;
	p[2] = 3;
	variable_example = Query(p);
	
	for (int i = 0; i < N; i++) {
		Answer(i * 2 + 1, i * 2 + 2);
		cout << "test\n";
	}
	*/
}

Compilation message

chameleon.cpp:8:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    8 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 596 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Incorrect 14 ms 448 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 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 596 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Incorrect 14 ms 448 KB Wrong Answer [3]
4 Halted 0 ms 0 KB -