Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while(t--){
int a;
cin >> a;
vector<int>v(a);
for(int i = 0 ; i < a ; i++){
v[i] = i + 1;
}
if(a == 2){
swap(v[0] , v[1]);
}
else{
int tmp = v[0];
for(int i = 0 ; i < a - 1 ; i++){
v[i] = v[i + 1];
}
v[a - 1] = tmp;
}
for(int i = 0 ; i < a ; i++){
cout << v[i] << " ";
}
cout << endl;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1210 A. Smallest Permutation
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-07-14 18:13:43
- Judged At
- 2025-07-14 18:13:43
- Judged By
- Score
- 0
- Total Time
- 2ms
- Peak Memory
- 536.0 KiB