結果

問題 No.1020 Reverse
ユーザー lloyzlloyz
提出日時 2022-03-20 00:39:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 204 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 53,760 KB
最終ジャッジ日時 2024-04-15 15:02:43
合計ジャッジ時間 1,769 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
51,840 KB
testcase_01 AC 44 ms
51,712 KB
testcase_02 AC 40 ms
51,584 KB
testcase_03 WA -
testcase_04 AC 40 ms
51,584 KB
testcase_05 AC 42 ms
51,456 KB
testcase_06 AC 41 ms
51,584 KB
testcase_07 WA -
testcase_08 AC 42 ms
52,992 KB
testcase_09 AC 42 ms
52,992 KB
testcase_10 AC 42 ms
53,376 KB
testcase_11 WA -
testcase_12 AC 42 ms
53,376 KB
testcase_13 AC 42 ms
53,760 KB
testcase_14 AC 42 ms
53,504 KB
testcase_15 AC 43 ms
53,120 KB
testcase_16 AC 43 ms
53,504 KB
testcase_17 AC 41 ms
53,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
s = input()
if n == k:
    print(s[::-1])
else:
    if n % 2 == 1 and k % 2 == 1:
        print(s[k - 1:] + s[:k - 1][::-1])
    else:
        print(s[k - 1:] + s[:k - 1])
0