結果
| 問題 |
No.1020 Reverse
|
| コンテスト | |
| ユーザー |
iqueue02
|
| 提出日時 | 2020-04-12 10:59:43 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 387 bytes |
| コンパイル時間 | 1,407 ms |
| コンパイル使用メモリ | 167,568 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-22 02:16:51 |
| 合計ジャッジ時間 | 2,424 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 1 WA * 14 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;
int main(){
int n, k;
cin >> n >> k;
string s;
cin >> s;
auto s1 = s.substr(0, k - 1);
auto s2 = s.substr(k - 1);
if ((n - k) & 1) reverse(s1.begin(), s1.end());
cout << s2 + s1 << endl;
return 0;
}
iqueue02