結果
| 問題 |
No.1020 Reverse
|
| コンテスト | |
| ユーザー |
mmn15277198
|
| 提出日時 | 2020-07-03 19:26:28 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 389 bytes |
| コンパイル時間 | 787 ms |
| コンパイル使用メモリ | 76,072 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-09-16 20:53:48 |
| 合計ジャッジ時間 | 7,078 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 4 TLE * 2 -- * 9 |
ソースコード
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
using namespace std;
int main() {
int n,k;
cin >> n >> k;
string s;
cin >> s;
for(int i=0;i<=n-k;i++){
string a=s.substr(0,i);
string b=s.substr(i,k);
reverse(b.begin(),b.end());
string c=s.substr(i+k,s.size());
s=a+b+c;
}
cout << s << endl;
return 0;
}
mmn15277198