結果

問題 No.1020 Reverse
ユーザー convexineq
提出日時 2020-04-10 21:28:15
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 279 bytes
コンパイル時間 261 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,492 KB
最終ジャッジ日時 2024-09-15 19:10:49
合計ジャッジ時間 1,508 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 8 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read

from collections import deque

n,k = [int(i) for i in readline().split()]
s = input()


v = s[:k-1]
if k%2==0: v = v[::-1]
ans = s[k-1:]+v

print(ans)

0