結果
| 問題 | 
                            No.1020 Reverse
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-04-11 19:29:11 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 260 bytes | 
| コンパイル時間 | 84 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 11,264 KB | 
| 最終ジャッジ日時 | 2024-09-19 07:12:47 | 
| 合計ジャッジ時間 | 2,999 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 WA * 1 | 
| other | AC * 9 WA * 6 | 
ソースコード
n,k = map(int,input().split())
s = input()
if n-k+1 % 2 == 0:
    for i in range(n):
        print(s[(k+i-1)%n],end='')
else:
    for i in range(n):
        if i <= n-k:
            print(s[(k+i-1)%n],end='')
        else:
            print(s[n-i-1],end='')