QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#680572#5575. Knight's Tour ReduxEl_Medonho#WA 0ms3700kbC++201.2kb2024-10-26 21:35:082024-10-26 21:35:08

Judging History

This is the latest submission verdict.

  • [2024-10-26 21:35:08]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3700kb
  • [2024-10-26 21:35:08]
  • Submitted

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)