結果

問題 No.3183 Swap or Rotate
ユーザー eve__fuyuki
提出日時 2025-07-02 16:34:08
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 559 bytes
コンパイル時間 1,898 ms
コンパイル使用メモリ 196,244 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-07-02 16:34:15
合計ジャッジ時間 5,967 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 1 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

void fast_io() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
}

int main() {
    fast_io();
    int n;
    cin >> n;
    vector<int> p(n);
    for (int i = 0; i < n; i++) {
        cin >> p[i];
    }
    string ans = "";
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n - 1; j++) {
            if (p[j] > p[j + 1]) {
                swap(p[j], p[j + 1]);
                ans.push_back('S');
            }
            ans.push_back('R');
        }
    }
    cout << ans << endl;
}
0