結果

問題 No.1020 Reverse
ユーザー LaikaLaika
提出日時 2020-04-14 16:24:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 145 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 15,544 KB
最終ジャッジ日時 2024-04-09 05:29:10
合計ジャッジ時間 1,612 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 30 ms
10,624 KB
testcase_03 AC 32 ms
10,752 KB
testcase_04 AC 30 ms
10,624 KB
testcase_05 AC 30 ms
10,752 KB
testcase_06 AC 30 ms
10,752 KB
testcase_07 AC 34 ms
13,752 KB
testcase_08 AC 36 ms
14,592 KB
testcase_09 AC 35 ms
13,952 KB
testcase_10 AC 38 ms
15,312 KB
testcase_11 AC 39 ms
15,544 KB
testcase_12 AC 39 ms
15,512 KB
testcase_13 AC 38 ms
15,512 KB
testcase_14 AC 38 ms
15,492 KB
testcase_15 AC 39 ms
15,232 KB
testcase_16 AC 38 ms
15,260 KB
testcase_17 AC 37 ms
15,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int,input().split())
s = list(input())
if n-k & 1:
    print(''.join(s[k-1:]+s[:k-1]))
else:
    print(''.join(s[k-1:]+s[:k-1][::-1]))
0