QOJ.ac
QOJ
QOJ is currently under a maintenance. It might be unavailable in the following a few hours.
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#680572 | #5575. Knight's Tour Redux | El_Medonho# | WA | 0ms | 3700kb | C++20 | 1.2kb | 2024-10-26 21:35:08 | 2024-10-26 21:35:08 |
Judging History
answer
#include "bits/stdc++.h"
using namespace std;
#define endl '\n'
typedef long long ll;
signed main(){
ios_base::sync_with_stdio(false), cin.tie(nullptr);
int n;
cin >> n;
if(n == 1) {
cout << "POSSIBLE\n";
cout << "1 1\n";
return 0;
}
if(n % 10 != 0) {
cout << "IMPOSSIBLE\n";
return 0;
}
cout << "POSSIBLE\n";
int x = 0, y = -2;
for(int i = 0; i < n; i += 10) {
x += 1;
y += 3;
cout << x << ' ' << y << '\n';
x += 1;
y += 3;
cout << x << ' ' << y << '\n';
x += 3;
y -= 1;
cout << x << ' ' << y << '\n';
x += 3;
y -= 1;
cout << x << ' ' << y << '\n';
x += 1;
y += 3;
cout << x << ' ' << y << '\n';
x -= 3;
y += 1;
cout << x << ' ' << y << '\n';
x -= 3;
y += 1;
cout << x << ' ' << y << '\n';
x += 1;
y += 3;
cout << x << ' ' << y << '\n';
x += 3;
y -= 1;
cout << x << ' ' << y << '\n';
x += 3;
y -= 1;
cout << x << ' ' << y << '\n';
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3700kb
input:
1
output:
POSSIBLE 1 1
result:
ok answer = 1
Test #2:
score: 0
Accepted
time: 0ms
memory: 3660kb
input:
2
output:
IMPOSSIBLE
result:
ok answer = 0
Test #3:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
3
output:
IMPOSSIBLE
result:
ok answer = 0
Test #4:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
4
output:
IMPOSSIBLE
result:
ok answer = 0
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3660kb
input:
5
output:
IMPOSSIBLE
result:
wrong answer jury has the better answer: jans = 1, pans = 0 (1 is Possible)