/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 5ms 532.0 KiB

Code

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

#define Alhamdulillah ios_base::sync_with_stdio(0), cin.tie(0);
#define ll long long
#define ull unsigned long long
#define endl '\n'
#define db(i) cout << "db -> " << i << endl;
#define pv(v) for(auto e : v)   cout << e << " ";   cout << endl;
#define pm(m) for(auto [x,y] : m)   cout << x << " " << y << endl;   cout << endl;


int tg;

void solve(){
    cin >> tg;
    
    for(int i=1;i<=tg;i++){
        if(i % 2 == 1){
            if(i == tg) cout << i-2 << " ";
            else    cout << i+1 << " ";
        }else{
            if(i == tg - 1) cout << tg << " ";
            else    cout << i - 1 << " ";
        }    
    }
    cout << endl;
    
}

int main(){
    Alhamdulillah
    int t=1;    cin >> t;
    while(t--)  solve();
    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 15:48:58
Judged At
2025-07-14 15:48:58
Judged By
Score
100
Total Time
5ms
Peak Memory
532.0 KiB