結果

問題 No.1020 Reverse
ユーザー uni_pythonuni_python
提出日時 2020-06-24 21:33:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 316 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 86,520 KB
実行使用メモリ 72,500 KB
最終ジャッジ日時 2023-09-16 21:20:59
合計ジャッジ時間 2,681 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,156 KB
testcase_01 AC 75 ms
71,084 KB
testcase_02 AC 74 ms
71,152 KB
testcase_03 AC 74 ms
71,420 KB
testcase_04 AC 74 ms
71,332 KB
testcase_05 AC 74 ms
71,116 KB
testcase_06 AC 76 ms
71,160 KB
testcase_07 AC 77 ms
71,248 KB
testcase_08 AC 77 ms
71,936 KB
testcase_09 AC 77 ms
71,260 KB
testcase_10 AC 77 ms
72,340 KB
testcase_11 AC 78 ms
71,732 KB
testcase_12 AC 75 ms
71,752 KB
testcase_13 AC 78 ms
71,908 KB
testcase_14 AC 76 ms
72,040 KB
testcase_15 AC 78 ms
72,500 KB
testcase_16 AC 77 ms
72,432 KB
testcase_17 AC 75 ms
72,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,K=MI()
    S=input()
    
    ans=""
    ans+=S[K-1:]
    T=S[0:K-1]
    if (N-K+1)%2==0:
        ans+=T
    else:
        ans+=T[::-1]
    print(ans)


main()
0