結果
| 問題 | 
                            No.1020 Reverse
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-12-06 06:41:46 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 505 bytes | 
| コンパイル時間 | 116 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 16,640 KB | 
| 最終ジャッジ日時 | 2024-07-07 08:50:53 | 
| 合計ジャッジ時間 | 4,394 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 4 TLE * 1 -- * 10 | 
ソースコード
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from math import *
input = sys.stdin.readline
# sys.setrecursionlimit(10 ** 6)
MOD = 10 ** 9 + 7
# Input #######################################
N, K = list(map(int, input().split()))
S = input().rstrip()
# MAIN #######################################
s = S
for i in range(N - K + 1):
    s = "".join((s[:i], s[i : i + K][::-1], s[i + K :]))
print(s)
# END #######################################