結果

問題 No.1020 Reverse
ユーザー hatsuka_iwahatsuka_iwa
提出日時 2021-02-03 22:14:40
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 305 bytes
コンパイル時間 1,532 ms
コンパイル使用メモリ 169,340 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-12 18:01:22
合計ジャッジ時間 2,687 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 7 ms
4,380 KB
testcase_09 AC 6 ms
4,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 8 ms
4,376 KB
testcase_13 AC 9 ms
4,380 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 8 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
  int N, K;
  string S;
  deque<char> d;
  cin >> N >> K >> S;

  for (char c : S)
    d.push_back(c);
  
  for (int i = 0; i < K - 1; i++) {
    d.push_back(d.front());
    d.pop_front();
  }

  for (char c : d)
    cout << c;
  cout << endl;
}
0