結果
問題 |
No.3183 Swap or Rotate
|
ユーザー |
|
提出日時 | 2025-06-20 22:17:46 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 439 bytes |
コンパイル時間 | 1,889 ms |
コンパイル使用メモリ | 198,884 KB |
実行使用メモリ | 7,848 KB |
最終ジャッジ日時 | 2025-06-20 22:17:51 |
合計ジャッジ時間 | 5,176 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 1 WA * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; vector<int> P(N); for(auto &p : P) cin >> p; string answer = ""; while(answer.size() < 20000){ if(P.at(0) > P.at(1) && P.at(0) != N-1) answer += 'S',swap(P.at(0),P.at(1)); else answer += 'R',rotate(P.begin(),P.begin()+1,P.end()); } cout << answer << endl; }