QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#485207#5575. Knight's Tour ReduxUESTC_DECAYALI#WA 0ms3988kbC++14962b2024-07-20 15:01:002024-07-20 15:01:01

Judging History

This is the latest submission verdict.

  • [2024-07-20 15:01:01]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3988kb
  • [2024-07-20 15:01:00]
  • Submitted

answer

#include<cstdio>
#include<iostream>
#include<vector>
#include<utility>
#define RI register int
#define CI const int&
#define fi first
#define se second
using namespace std;
typedef pair <int,int> pi;
int main()
{
    int n; scanf("%d",&n);
    if (n==1) return puts("POSSIBLE\n1 1"),0;
    if (n<6) return puts("IMPOSSIBLE"),0;
    vector <pi> A[12]; int s=0;
    A[6]={{1,1},{2,4},{5,5},{6,2},{3,3},{4,6}};
    A[7]={{1,1},{2,4},{3,7},{6,6},{7,3},{4,2},{5,5}};
    A[8]={{1,1},{2,4},{3,7},{6,8},{7,5},{8,2},{5,3},{4,6}};
    A[9]={{1,1},{2,4},{3,7},{6,8},{5,5},{4,2},{7,3},{8,6},{9,9}};
    A[10]={{1,1},{2,4},{3,7},{4,10},{7,9},{6,6},{5,3},{8,2},{9,5},{10,8}};
    A[11]={{1,1},{2,4},{3,7},{4,10},{7,11},{8,8},{11,9},{10,6},{9,3},{6,2},{5,5}};
    puts("POSSIBLE");
    while (n-s>=12)
    {
        for (auto [x,y]:A[6]) printf("%d %d\n",s+x,s+y); s+=6;
    }
    for (auto [x,y]:A[n-s]) printf("%d %d\n",s+x,s+y);
    return 0;
}

詳細信息

Test #1:

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

input:

1

output:

POSSIBLE
1 1

result:

ok answer = 1

Test #2:

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

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: 3624kb

input:

4

output:

IMPOSSIBLE

result:

ok answer = 0

Test #5:

score: -100
Wrong Answer
time: 0ms
memory: 3988kb

input:

5

output:

IMPOSSIBLE

result:

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