結果

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

ソースコード

diff #

#include <stdio.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric>
#include <string>
#include <map>
#include <stack>
using namespace std;
typedef long long int lli;
#define urept(soeji, start, n) for (int soeji = start; soeji < n; soeji++)
#define drept(soeji, start, n) for (int soeji = start; soeji > n; soeji--)
int main(void)
{
    int N, K;
    cin >> N >> K;
    string s;
    cin >> s;
    int x = N - K + 1;
    for (int i = 0; i < x; i++)
    {
        reverse(s.begin() + i, s.begin() + (i + K));
    }
    cout << s << endl;
    return 0;
}
0