結果

問題 No.1020 Reverse
ユーザー NoaSaberNoaSaber
提出日時 2021-04-14 14:16:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 207 bytes
コンパイル時間 1,074 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 78,260 KB
最終ジャッジ日時 2023-09-13 03:56:04
合計ジャッジ時間 3,618 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
71,976 KB
testcase_01 AC 89 ms
71,704 KB
testcase_02 AC 92 ms
71,884 KB
testcase_03 AC 92 ms
71,444 KB
testcase_04 AC 93 ms
71,788 KB
testcase_05 AC 91 ms
71,836 KB
testcase_06 AC 91 ms
71,676 KB
testcase_07 AC 108 ms
77,460 KB
testcase_08 AC 98 ms
77,800 KB
testcase_09 AC 96 ms
77,408 KB
testcase_10 AC 103 ms
77,884 KB
testcase_11 AC 102 ms
77,736 KB
testcase_12 AC 101 ms
77,960 KB
testcase_13 AC 101 ms
78,000 KB
testcase_14 AC 103 ms
78,096 KB
testcase_15 AC 93 ms
73,000 KB
testcase_16 AC 91 ms
72,552 KB
testcase_17 AC 103 ms
78,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
from collections import deque
S=input()
que=deque([])
for i in range(K-1,N):
    que.append(S[i])
rest_l=S[:K-1]
if (N-K)%2==0:
    rest_l=rest_l[::-1]
print("".join(que)+rest_l)
0