結果

問題 No.1020 Reverse
ユーザー nehan_der_thalnehan_der_thal
提出日時 2020-04-10 21:47:06
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 120 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 86,784 KB
実行使用メモリ 72,500 KB
最終ジャッジ日時 2023-10-13 23:59:40
合計ジャッジ時間 2,675 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,424 KB
testcase_01 AC 71 ms
71,160 KB
testcase_02 AC 71 ms
71,420 KB
testcase_03 AC 70 ms
71,620 KB
testcase_04 AC 74 ms
71,360 KB
testcase_05 AC 71 ms
71,264 KB
testcase_06 AC 70 ms
71,516 KB
testcase_07 AC 73 ms
71,160 KB
testcase_08 AC 73 ms
71,896 KB
testcase_09 AC 74 ms
71,388 KB
testcase_10 AC 73 ms
72,440 KB
testcase_11 AC 72 ms
72,140 KB
testcase_12 AC 73 ms
72,204 KB
testcase_13 AC 74 ms
72,344 KB
testcase_14 AC 74 ms
72,380 KB
testcase_15 AC 74 ms
72,356 KB
testcase_16 AC 75 ms
72,500 KB
testcase_17 AC 74 ms
72,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
s = input().strip()
b, c = s[:K-1], s[K-1:]
if (N-K+1) % 2:
    b = b[::-1]
print(c+b)
0