QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#142106#5575. Knight's Tour Reduxammardab3an#WA 1ms3500kbC++171.0kb2023-08-18 14:51:522023-08-18 14:51:54

Judging History

This is the latest submission verdict.

  • [2023-08-18 14:51:54]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 3500kb
  • [2023-08-18 14:51:52]
  • Submitted

answer

#include <bits/stdc++.h>

using namespace std;

int main()
{

	int n;
	cin >> n;
	vector<pair<int, int>>v10 = { {1,1},{4,2},{3,5},{2,8},{5,9},{6,6},{7,3},{10,4},{9,7},{8,10} };
	vector<pair<int, int>>v8 = { {1,1},{2,4},{3,7},{6,8},{5,5},{4,2},{7,3},{8,6} };
	vector<pair<int, int>>v7 = { {1,1},{4,2},{3,7},{6,6},{7,3},{4,2},{5,5} };

	for (int i = 0; i < 4; i++) {
		if (n < i * 10)break;
		int m = (n - i * 10) % 8;
		if (!m||m==1||m==7) {
			cout << "POSSIBLE\n";
			int cur = 0;
			for (int j = 0; j < i; j++) {
				for (auto x: v10)cout << x.first + cur << " " << x.second + cur << '\n';
				cur += 10;
			}
			n -= 10 * i;
			int mm = n / 8;
			while (mm--) {
				for (auto x : v8) {
					cout << x.first + cur << " " << x.second + cur << '\n';
				}
				n -= 8;
				cur += 8;
			}
			if (m == 1) {
				cout << cur+1 << " " << cur+1 << '\n';
			}
			else if (m == 7) {
				for (auto x : v7) {
					cout << x.first + cur << " " << x.second + cur << '\n';
				}
			}
			return 0;
		}
	}
	cout << "IMPOSSIBLE\n";

}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3500kb

input:

1

output:

POSSIBLE
1 1

result:

ok answer = 1

Test #2:

score: 0
Accepted
time: 1ms
memory: 3468kb

input:

2

output:

IMPOSSIBLE

result:

ok answer = 0

Test #3:

score: 0
Accepted
time: 0ms
memory: 3432kb

input:

3

output:

IMPOSSIBLE

result:

ok answer = 0

Test #4:

score: 0
Accepted
time: 1ms
memory: 3500kb

input:

4

output:

IMPOSSIBLE

result:

ok answer = 0

Test #5:

score: -100
Wrong Answer
time: 1ms
memory: 3472kb

input:

5

output:

IMPOSSIBLE

result:

wrong answer jury has the better answer: jans = 1, pans = 0 (1 is Possible)