結果
| 問題 |
No.3183 Swap or Rotate
|
| コンテスト | |
| ユーザー |
PyonPyon
|
| 提出日時 | 2025-06-20 22:41:19 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,163 bytes |
| コンパイル時間 | 5,446 ms |
| コンパイル使用メモリ | 335,076 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-06-20 22:41:30 |
| 合計ジャッジ時間 | 8,884 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | WA * 21 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef long double ld;
#define sz(c) ((ll)(c).size())
#define ALL(x) x.begin(),x.end()
#define LB(A,x) (ll)(lower_bound(ALL(A),x)-A.begin())
#define UB(A,x) (ll)(upper_bound(ALL(A),x)-A.begin())
#define BS(A,x) binary_search(ALL(A),x)
#define rep(i,a,b) for(int i=a;i<b;i++)
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
using vi = vector<int>;
using vvi = vector<vi>;
using li =vector<ll>;
using lli=vector<li>;
const long long mod=998244353;
//using mint = modint998244353;
int main() {
int n;cin>>n;
vi A(n);
rep(i,0,n)cin>>A[i];
vi B(n);
iota(ALL(B),0);
rep(i,0,n-1){
rep(j,0,n-1){
if(A[j]>A[j+1]){cout<<"R";swap(A[j],A[j+1]);}
cout<<"S";
}
cout<<"S";
}
/*int r=0;
while(true){
if(A[r%n]>A[(r+1)%n]){cout<<"R";swap(A[r%n],A[(r+1)%n]);continue;}
bool ok=true;
rep(i,0,n){if(A[(i+r)%n]!=B[i])ok=false;}
cout<<"S";r++;continue;
}*/
cout<<endl;
rep(i,0,n)cout<<A[i]<<" ";
}
PyonPyon