結果
問題 | No.1020 Reverse |
ユーザー |
|
提出日時 | 2020-05-18 23:30:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 350 bytes |
コンパイル時間 | 1,716 ms |
コンパイル使用メモリ | 168,052 KB |
実行使用メモリ | 13,640 KB |
最終ジャッジ日時 | 2024-10-01 22:12:16 |
合計ジャッジ時間 | 5,957 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 4 TLE * 1 -- * 10 |
ソースコード
#include <bits/stdc++.h>#define rep(i,n) for(int i=0; i<(n); i++)using namespace std;typedef long long ll;int main(){int n,k; cin>>n>>k;string s; cin>>s;int L=n-k+1;for(int i=0; i<L; i++){string p=s.substr(i,k);reverse(p.begin(), p.end());int t=0;for(int j=i; j<i+k; j++){s[j]=p[t];t++;}}cout << s << endl;}