結果

問題 No.1020 Reverse
ユーザー splash9494splash9494
提出日時 2020-05-04 21:24:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 157 bytes
コンパイル時間 413 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 81,936 KB
最終ジャッジ日時 2023-09-07 05:36:09
合計ジャッジ時間 3,535 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,020 KB
testcase_01 AC 74 ms
71,228 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 74 ms
71,508 KB
testcase_05 AC 73 ms
71,436 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 79 ms
77,912 KB
testcase_09 AC 78 ms
75,440 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 82 ms
79,832 KB
testcase_13 AC 83 ms
80,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 83 ms
81,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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