結果

問題 No.1020 Reverse
ユーザー kept1994kept1994
提出日時 2022-05-09 02:36:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 285 bytes
コンパイル時間 431 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 96,136 KB
最終ジャッジ日時 2023-09-23 03:25:22
合計ジャッジ時間 5,830 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#!/usr/bin/env python3
import sys
MOD = 998244353
input = sys.stdin.readline

def main():
    N, K = map(int, input().split())
    S = input()
    for i in range(N - K + 1):
        S = S[:i] + S[i:i + K][::-1] + S[i + K:]
    print(S)
    return

if __name__ == '__main__':
    main()
0