結果
問題 | No.1020 Reverse |
ユーザー |
![]() |
提出日時 | 2020-04-12 00:54:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 353 bytes |
コンパイル時間 | 1,390 ms |
コンパイル使用メモリ | 168,116 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-19 19:00:00 |
合計ジャッジ時間 | 2,656 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 WA * 4 |
ソースコード
#include <bits/stdc++.h>#define rep(i,n) for(int i=0;i<(n);i++)#define all(x) (x).begin(), (x).end()using ll = long long;using namespace std;int main() {int N,K;cin >> N >> K;string S;cin >> S;string s1 = S.substr(0,K-1);string s2 = S.substr(K-1);if(N%2==1&&K%2==1) reverse(all(s1));cout << s2+s1 << endl;}