結果

問題 No.1020 Reverse
ユーザー convexineqconvexineq
提出日時 2020-04-10 21:30:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 665 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 8,752 KB
最終ジャッジ日時 2023-10-13 23:23:29
合計ジャッジ時間 1,835 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,872 KB
testcase_01 AC 15 ms
7,752 KB
testcase_02 AC 15 ms
7,872 KB
testcase_03 AC 15 ms
7,760 KB
testcase_04 AC 16 ms
7,812 KB
testcase_05 AC 16 ms
7,688 KB
testcase_06 AC 16 ms
7,712 KB
testcase_07 AC 16 ms
8,552 KB
testcase_08 AC 16 ms
8,692 KB
testcase_09 AC 17 ms
8,444 KB
testcase_10 AC 17 ms
8,660 KB
testcase_11 AC 16 ms
8,644 KB
testcase_12 AC 17 ms
8,548 KB
testcase_13 AC 17 ms
8,596 KB
testcase_14 AC 17 ms
8,736 KB
testcase_15 AC 16 ms
8,676 KB
testcase_16 AC 17 ms
8,752 KB
testcase_17 AC 17 ms
8,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

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

print(ans)

0