/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 14ms 3.02 MiB
#2 Wrong Answer 17ms 3.066 MiB

Code

T = int(input())
for _ in range(T):
    N = int(input())
    res = list(range(1, N + 1))
    if N % 2 == 0:
        for i in range(0, N, 2):
            res[i], res[i+1] = res[i+1], res[i]
    else:
        for i in range(0, N - 3, 2):
            res[i], res[i+1] = res[i+1], res[i]
        res[N-3], res[N-2], res[N-1] = res[N-1], res[N-3], res[N-2]
    print(' '.join(map(str, res)))

Information

Submit By
Type
Submission
Problem
P1210 A. Smallest Permutation
Contest
Educational Round 1
Language
Python 3 (Python 3.12.3)
Submit At
2025-07-14 15:37:54
Judged At
2025-07-14 15:37:54
Judged By
Score
0
Total Time
17ms
Peak Memory
3.066 MiB