/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Wrong Answer 2ms 404.0 KiB

Code

#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main() {
  int t;
  cin >> t;
  while (t--){
    ll n;
    cin >> n;
    if (n & 1){
      if (n == 3){
        cout << "2 3 1\n";
        continue;
      }
      cout << "2 1 ";
      for (int i = 4; i < n - 1; i += 2){
        cout << i + 1 << " " << i << " ";
      }
      cout << n - 1 << " " << n << " " << n - 2 << endl;
    } else {
      for (int i = 2; i <= n; i += 2){
        cout << i << " " << i - 1 << " ";
      }
      cout << endl;
    }
  }
}

Information

Submit By
Type
Submission
Problem
P1210 A. Smallest Permutation
Contest
Educational Round 1
Language
C++17 (G++ 13.2.0)
Submit At
2025-07-14 15:50:29
Judged At
2025-07-14 15:50:29
Judged By
Score
0
Total Time
2ms
Peak Memory
532.0 KiB