結果

問題 No.1020 Reverse
ユーザー musuchika3musuchika3
提出日時 2020-04-10 21:42:29
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 699 bytes
コンパイル時間 1,596 ms
コンパイル使用メモリ 165,516 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-10-13 23:52:00
合計ジャッジ時間 11,782 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,372 KB
testcase_01 AC 2 ms
4,368 KB
testcase_02 AC 1 ms
4,372 KB
testcase_03 AC 2 ms
4,368 KB
testcase_04 AC 1 ms
4,368 KB
testcase_05 AC 2 ms
4,372 KB
testcase_06 AC 1 ms
4,368 KB
testcase_07 AC 1,108 ms
4,368 KB
testcase_08 TLE -
testcase_09 AC 118 ms
4,372 KB
testcase_10 TLE -
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
権限があれば一括ダウンロードができます

ソースコード

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