結果

問題 No.1020 Reverse
ユーザー stngstng
提出日時 2020-04-11 19:31:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 200 ms / 2,000 ms
コード長 262 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 11,944 KB
実行使用メモリ 10,384 KB
最終ジャッジ日時 2023-10-19 11:04:28
合計ジャッジ時間 3,167 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,016 KB
testcase_01 AC 31 ms
10,016 KB
testcase_02 AC 30 ms
10,016 KB
testcase_03 AC 30 ms
10,032 KB
testcase_04 AC 30 ms
10,016 KB
testcase_05 AC 30 ms
10,032 KB
testcase_06 AC 30 ms
10,016 KB
testcase_07 AC 134 ms
10,260 KB
testcase_08 AC 158 ms
10,304 KB
testcase_09 AC 132 ms
10,256 KB
testcase_10 AC 200 ms
10,356 KB
testcase_11 AC 199 ms
10,384 KB
testcase_12 AC 188 ms
10,384 KB
testcase_13 AC 186 ms
10,384 KB
testcase_14 AC 200 ms
10,384 KB
testcase_15 AC 186 ms
10,356 KB
testcase_16 AC 180 ms
10,348 KB
testcase_17 AC 178 ms
10,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
s = input()

if (n-k+1) % 2 == 0:
    for i in range(n):
        print(s[(k+i-1)%n],end='')
else:
    for i in range(n):
        if i <= n-k:
            print(s[(k+i-1)%n],end='')
        else:
            print(s[n-i-1],end='')

0