結果
問題 | No.1020 Reverse |
ユーザー |
|
提出日時 | 2020-04-10 21:33:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 36 ms / 2,000 ms |
コード長 | 185 bytes |
コンパイル時間 | 88 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,200 KB |
最終ジャッジ日時 | 2024-09-15 19:22:05 |
合計ジャッジ時間 | 1,504 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 |
ソースコード
n,k = map(int,input().split()) s = input() if k == n: print(s[::-1]) else: if (n + k) % 2 == 0: print(s[k-1:] + s[:k-1][::-1]) else: print(s[k-1:] + s[:k-1])