結果

問題 No.1020 Reverse
ユーザー yosakayosaka
提出日時 2020-04-11 01:46:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 170 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 10,600 KB
実行使用メモリ 14,008 KB
最終ジャッジ日時 2023-10-14 12:25:30
合計ジャッジ時間 1,482 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,860 KB
testcase_01 AC 15 ms
7,860 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 16 ms
7,856 KB
testcase_05 AC 16 ms
7,824 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 24 ms
11,908 KB
testcase_09 AC 22 ms
11,172 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 25 ms
12,680 KB
testcase_13 AC 25 ms
12,764 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 26 ms
12,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
N, K = map(int, input().split())
S = list(input())
if (N-K) % 2 == 0:
    ans = S[K-1:] + S[:K-1:-1]
else:
    ans = S[K-1:] + S[:K-1]
print("".join(ans))
0