結果
| 問題 | No.1020 Reverse |
| コンテスト | |
| ユーザー |
risujiroh
|
| 提出日時 | 2020-04-10 21:30:12 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 368 bytes |
| コンパイル時間 | 1,531 ms |
| コンパイル使用メモリ | 168,676 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-15 19:14:54 |
| 合計ジャッジ時間 | 2,261 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define DEBUG(...)
#endif
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n, k;
cin >> n >> k;
string s;
cin >> s;
rotate(begin(s), begin(s) + (k - 1), end(s));
if ((n - k + 1) & 1) {
reverse(end(s) - (k - 1), end(s));
}
cout << s << '\n';
}
risujiroh