結果

問題 No.1020 Reverse
ユーザー splash9494splash9494
提出日時 2020-05-04 21:33:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 150 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 84,104 KB
最終ジャッジ日時 2023-09-07 05:47:56
合計ジャッジ時間 2,823 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,652 KB
testcase_01 AC 73 ms
71,392 KB
testcase_02 AC 71 ms
71,324 KB
testcase_03 AC 72 ms
71,536 KB
testcase_04 AC 73 ms
71,368 KB
testcase_05 AC 73 ms
71,392 KB
testcase_06 AC 71 ms
71,444 KB
testcase_07 AC 83 ms
80,036 KB
testcase_08 AC 82 ms
77,900 KB
testcase_09 AC 78 ms
75,660 KB
testcase_10 AC 86 ms
83,940 KB
testcase_11 AC 86 ms
84,104 KB
testcase_12 AC 80 ms
79,316 KB
testcase_13 AC 81 ms
79,588 KB
testcase_14 AC 86 ms
84,092 KB
testcase_15 AC 87 ms
83,664 KB
testcase_16 AC 87 ms
83,728 KB
testcase_17 AC 83 ms
79,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
S = list(input())

f = S[K-1:]
r =S[:K-1] if (N - K + 1) % 2 == 0 else list(reversed(S[:K-1]))
print(''.join(f + r))
0