QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#629195#9428. Be PositiveKIRITO1211#WA 1ms3708kbC++23859b2024-10-11 08:36:502024-10-11 08:36:50

Judging History

你现在查看的是最新测评结果

  • [2024-10-11 08:36:50]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3708kb
  • [2024-10-11 08:36:50]
  • 提交

answer

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define int long long
using ll = long long;
using i64 = long long;
const int mod = 998244353;
// #define DEBUG

// 线段树合并信息

void solve() {
    int n;std::cin>>n;
    if(n % 4 == 0 || n == 1){
        std::cout<<"impossible\n";
        return;
    }
    int tp = ((n) / 4) * 4 + 1;
    std::cout<<tp<<' ';

    int res = tp;
    for(int i = 0;i < n;i++){
        if(i == tp) continue;
        res ^= i;
        std::cout<<i<<' ';
    }

    //std::cerr<<res<<'\n';
    std::cout<<'\n';
}

signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int t = 1;
    // int res = 0;
    // for(int i = 1;i <= 1145;i++) res |= i;
    // std::cerr<<res<<'\n';
    std::cin>>t;
    while (t--) {
        solve();
    }
    return 0;
}

詳細信息

Test #1:

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

input:

4
1
2
3
4

output:

impossible
1 0 
1 0 2 
impossible

result:

ok 4 test cases (4 test cases)

Test #2:

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

input:

10
1
2
3
4
5
6
7
8
9
10

output:

impossible
1 0 
1 0 2 
impossible
5 0 1 2 3 4 
5 0 1 2 3 4 
5 0 1 2 3 4 6 
impossible
9 0 1 2 3 4 5 6 7 8 
9 0 1 2 3 4 5 6 7 8 

result:

wrong answer not permutation (test case 5)