/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 400.0 KiB
#2 Wrong Answer 1ms 396.0 KiB

Code

// Author: Mushfiq R.
#include <bits/stdc++.h>
#define endl "\n"
#define ll long long
#define ld long double
#define ull unsigned long long
#define vsort(v) sort(v.begin(), v.end())
#define rsort(v) sort(v.begin(), v.end(), greater<int>())
#define fastIO (ios_base::sync_with_stdio(false), cin.tie(NULL));
using namespace std;

int main()
{
    fastIO;
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;

        if (n == 3)
        {
            cout << "2 3 1" << endl;
            continue;
        }
        else
        {
            string ans = "";
            for (int i = 1; i <= n; i += 2)
            {

                ans += to_string(i + 1) + " " + to_string(i) + " ";
            }
            cout << ans << endl;
            continue;
        }
    }

    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:47:07
Judged At
2025-07-14 15:47:07
Judged By
Score
0
Total Time
1ms
Peak Memory
400.0 KiB