結果

問題 No.1020 Reverse
ユーザー musuchika3
提出日時 2020-04-10 21:42:29
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 699 bytes
コンパイル時間 1,593 ms
コンパイル使用メモリ 166,484 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-09-15 19:44:21
合計ジャッジ時間 11,747 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 TLE * 3 -- * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef  long long ll;
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
//自作関数
template<class T> ll llpow(T x,T n){ll ans=1;while(n--){ans*=x;}return ans;}

#define rep(i,b,n) for(ll i=b;i<(ll)n;i++)
#define rep2(i, begin_i, end_i) for (ll i = (ll)begin_i; i < (ll)end_i; i++)

long long INF = 1LL<<60;
int n;
int main(){
    int n;
    int k; string s;
    cin>>n>>k>>s;
    auto b=s.begin();
    auto e=s.begin()+k;
    rep(i,0,n-k+1){
        reverse(b++,e++);
    }
    cout<<s<<endl;
    return 0;
}


0