結果
問題 | No.1020 Reverse |
ユーザー | uni_python |
提出日時 | 2020-06-24 21:33:14 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 43 ms / 2,000 ms |
コード長 | 316 bytes |
コンパイル時間 | 149 ms |
コンパイル使用メモリ | 82,412 KB |
実行使用メモリ | 54,144 KB |
最終ジャッジ日時 | 2024-07-03 20:21:04 |
合計ジャッジ時間 | 1,652 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 |
ソースコード
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()