結果

問題 No.1020 Reverse
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2020-07-21 21:32:30
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 126 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,584 KB
実行使用メモリ 9,012 KB
最終ジャッジ日時 2023-08-30 02:04:52
合計ジャッジ時間 1,510 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,792 KB
testcase_01 AC 16 ms
7,952 KB
testcase_02 AC 16 ms
7,808 KB
testcase_03 AC 15 ms
7,812 KB
testcase_04 AC 15 ms
7,820 KB
testcase_05 AC 17 ms
7,808 KB
testcase_06 AC 15 ms
7,732 KB
testcase_07 AC 16 ms
8,616 KB
testcase_08 AC 17 ms
8,648 KB
testcase_09 AC 17 ms
8,600 KB
testcase_10 AC 17 ms
8,656 KB
testcase_11 AC 17 ms
8,860 KB
testcase_12 AC 16 ms
8,764 KB
testcase_13 AC 17 ms
8,648 KB
testcase_14 AC 17 ms
9,012 KB
testcase_15 AC 17 ms
8,716 KB
testcase_16 AC 16 ms
8,764 KB
testcase_17 AC 16 ms
8,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
s = input()

t = s[k - 1:]
r = s[:k - 1]

if (n - k) % 2 == 0:
    r = r[::-1]

print(t + r)
0