結果
問題 |
No.1021 Children in Classrooms
|
ユーザー |
|
提出日時 | 2021-07-01 21:04:25 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 137 ms / 2,000 ms |
コード長 | 374 bytes |
コンパイル時間 | 1,195 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 117,632 KB |
最終ジャッジ日時 | 2024-06-28 10:23:11 |
合計ジャッジ時間 | 4,103 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
n,m=map(int,input().split()) a=list(map(int,input().split())) s=input() stat=0 for o in s: if o=='L': stat+=1 if 0<stat<n: a[stat]+=a[stat-1] a[stat-1]=0 if stat==n:stat=n-1 else: stat-=1 if -n<stat<0: a[stat-1]+=a[stat] a[stat]=0 if stat==-n:stat=-n+1 a=list(a) if stat==0: print(*a) else: print(*a[stat:]+a[:stat])