結果

問題 No.1020 Reverse
ユーザー GeckoちゃんGeckoちゃん
提出日時 2020-05-20 12:15:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 439 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 15,332 KB
最終ジャッジ日時 2024-04-09 22:54:29
合計ジャッジ時間 1,592 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,880 KB
testcase_01 AC 30 ms
11,008 KB
testcase_02 AC 30 ms
10,880 KB
testcase_03 WA -
testcase_04 AC 28 ms
10,880 KB
testcase_05 AC 28 ms
10,880 KB
testcase_06 AC 29 ms
10,880 KB
testcase_07 WA -
testcase_08 AC 34 ms
13,008 KB
testcase_09 AC 34 ms
12,928 KB
testcase_10 AC 37 ms
13,556 KB
testcase_11 WA -
testcase_12 AC 37 ms
13,460 KB
testcase_13 AC 36 ms
13,440 KB
testcase_14 AC 37 ms
14,228 KB
testcase_15 WA -
testcase_16 AC 38 ms
15,332 KB
testcase_17 AC 36 ms
13,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
import copy
S=list(input())

"""
S2 = copy.copy(S)
s=[0]*N
for i in range(0,N-K+1):
    for k, c in enumerate(reversed(list(S2[i:i+K]))):
        S2[i+k] = c
        s[i+k] += 1

# print('S2', S2)
# print('s', s)
"""

shift = K-1
# print(shift)

if N%2 == 1 and K%2 == 1:
    a="".join(S[shift:]) + "".join(reversed(S[:shift]))
else:
    a="".join(S[shift:]) + "".join(S[:shift])
print(a)
#print(list(a) == S2)
0