/ SeriousOJ /

Record Detail

Wrong Answer


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

Code

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

int solve(){
    int n;
    cin>>n;
    vector<int> a(n);
    for(int i = 0; i < n; i++){
        a[i] = i+1;
    }
    for(int i = 0; i < n/2; i++){
        swap(a[i], a[n-i-1]);
    }
    if(n%2 == 1){
        swap(a[n/2], a[n/2+1]);
    }
    for(auto it: a){
        cout<<it<<" ";
    }
    cout << endl;
    return 0;
}
int32_t main(){
    ios::sync_with_stdio(false); 
    cin.tie(0); cout.tie(0);
 
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    

    int t;
    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:34:22
Judged At
2025-07-14 15:34:22
Judged By
Score
0
Total Time
2ms
Peak Memory
580.0 KiB