/ SeriousOJ /

Record Detail

Wrong Answer


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

Code

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(a) a.begin(), a.end()
typedef vector<ll> vll;
#define life ios_base::sync_with_stdio(false);
#define saver cin.tie(0);
#define f first
#define s second
#define nxt cout << endl;
const int mod = 1e9 + 7;
const int N = 1e5 + 10;
#define rep(i, a, b) for (int(i) = (a); (i) < (b); ++(i))
#define rep0(i, a) rep(i, 0, a)
#define pb push_back

int main()
{
   life saver int t;
   cin >> t;
   while (t--)
   {
      int n;
      cin >> n;
      vll v(n + 1);

      for (int i = 1; i <= n; i++)
      {
         if (i & 1)
            v[i] = i + 1;
         else
            v[i] = i - 1;
      }
      if (n & 1)
         v.back() = n;
      swap(v[n - 1], v[n]);
      for (int i = 1; i < n + 1; i++)
      {
         cout << v[i] << " ";
      }
      cout << endl;
   }

   return 0;
}

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 16:35:31
Judged At
2025-07-14 16:35:31
Judged By
Score
0
Total Time
2ms
Peak Memory
764.0 KiB