結果

問題 No.1020 Reverse
ユーザー convexineqconvexineq
提出日時 2020-04-10 21:28:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 279 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 10,404 KB
実行使用メモリ 9,336 KB
最終ジャッジ日時 2023-10-13 23:19:23
合計ジャッジ時間 1,530 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,340 KB
testcase_01 AC 16 ms
8,324 KB
testcase_02 AC 16 ms
8,352 KB
testcase_03 AC 17 ms
8,492 KB
testcase_04 WA -
testcase_05 AC 17 ms
8,376 KB
testcase_06 WA -
testcase_07 AC 18 ms
8,636 KB
testcase_08 WA -
testcase_09 AC 17 ms
8,752 KB
testcase_10 WA -
testcase_11 AC 18 ms
9,036 KB
testcase_12 WA -
testcase_13 AC 18 ms
8,976 KB
testcase_14 WA -
testcase_15 AC 18 ms
9,336 KB
testcase_16 WA -
testcase_17 AC 17 ms
8,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read

from collections import deque

n,k = [int(i) for i in readline().split()]
s = input()


v = s[:k-1]
if k%2==0: v = v[::-1]
ans = s[k-1:]+v

print(ans)

0