結果
| 問題 |
No.1020 Reverse
|
| コンテスト | |
| ユーザー |
Ichimiya
|
| 提出日時 | 2020-07-20 23:26:11 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 377 bytes |
| コンパイル時間 | 1,655 ms |
| コンパイル使用メモリ | 168,736 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-24 19:54:52 |
| 合計ジャッジ時間 | 2,602 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 |
ソースコード
#include <bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
const int64_t mod = 1e9 + 7;
int main() {
int N, K;
string S;
cin >> N >> K >> S;
string s1, s2;
s1 = S.substr(0, K - 1);
s2 = S.substr(K - 1);
/*cout << "s1:" << s1 << endl;
cout << "s2:" << s2 << endl;*/
if ((N - K) % 2 == 0) {
reverse(s1.begin(), s1.end());
}
cout << s2 + s1 << endl;
}
Ichimiya