結果

問題 No.1020 Reverse
ユーザー stngstng
提出日時 2020-04-11 19:29:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 260 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 11,732 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2023-10-19 11:02:22
合計ジャッジ時間 3,408 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 30 ms
10,000 KB
testcase_02 AC 30 ms
10,000 KB
testcase_03 AC 32 ms
10,016 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 30 ms
10,000 KB
testcase_07 AC 134 ms
10,244 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 196 ms
10,340 KB
testcase_11 AC 202 ms
10,368 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 204 ms
10,368 KB
testcase_15 AC 181 ms
10,340 KB
testcase_16 AC 181 ms
10,332 KB
testcase_17 AC 199 ms
10,352 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