結果

問題 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
コンパイル時間 226 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 15,336 KB
最終ジャッジ日時 2024-10-01 23:31:03
合計ジャッジ時間 1,656 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,880 KB
testcase_01 AC 33 ms
10,880 KB
testcase_02 AC 31 ms
10,880 KB
testcase_03 WA -
testcase_04 AC 32 ms
10,880 KB
testcase_05 AC 31 ms
11,008 KB
testcase_06 AC 31 ms
10,880 KB
testcase_07 WA -
testcase_08 AC 36 ms
13,004 KB
testcase_09 AC 36 ms
12,928 KB
testcase_10 AC 38 ms
13,556 KB
testcase_11 WA -
testcase_12 AC 38 ms
13,456 KB
testcase_13 AC 39 ms
13,440 KB
testcase_14 AC 40 ms
14,232 KB
testcase_15 WA -
testcase_16 AC 40 ms
15,336 KB
testcase_17 AC 38 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