結果

問題 No.1020 Reverse
ユーザー 67oYG9nh2YMmIci67oYG9nh2YMmIci
提出日時 2020-07-20 12:34:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 15 ms / 2,000 ms
コード長 124 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 8,792 KB
最終ジャッジ日時 2023-08-25 00:58:01
合計ジャッジ時間 1,747 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,820 KB
testcase_01 AC 14 ms
7,868 KB
testcase_02 AC 14 ms
7,880 KB
testcase_03 AC 14 ms
7,868 KB
testcase_04 AC 14 ms
7,868 KB
testcase_05 AC 14 ms
7,820 KB
testcase_06 AC 14 ms
7,788 KB
testcase_07 AC 15 ms
8,304 KB
testcase_08 AC 14 ms
8,512 KB
testcase_09 AC 15 ms
8,604 KB
testcase_10 AC 15 ms
8,744 KB
testcase_11 AC 15 ms
8,672 KB
testcase_12 AC 14 ms
8,792 KB
testcase_13 AC 14 ms
8,644 KB
testcase_14 AC 15 ms
8,652 KB
testcase_15 AC 15 ms
8,448 KB
testcase_16 AC 15 ms
8,576 KB
testcase_17 AC 15 ms
8,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
S=input()
ans=S[K-1:]
if (N-K)%2 == 1:
    ans+=S[:K-1]
else:
    ans+=S[:K-1][::-1]
print(ans)
0