結果
| 問題 |
No.1020 Reverse
|
| コンテスト | |
| ユーザー |
kpinkcat
|
| 提出日時 | 2023-08-24 19:14:11 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 376 bytes |
| コンパイル時間 | 950 ms |
| コンパイル使用メモリ | 100,776 KB |
| 最終ジャッジ日時 | 2025-02-16 13:11:51 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 WA * 7 |
ソースコード
#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
using namespace std;
int main()
{
int n, k;
string s, pre, post;
cin >> n >> k >> s;
pre = s.substr(0, k-1);
post = s.substr(k-1);
if (!(k%2)) reverse(pre.begin(), pre.end());
cout << post + pre << endl;
}
kpinkcat