結果
| 問題 |
No.1650 Moving Coins
|
| コンテスト | |
| ユーザー |
brthyyjp
|
| 提出日時 | 2021-08-21 14:45:25 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 237 ms / 2,000 ms |
| コード長 | 376 bytes |
| コンパイル時間 | 164 ms |
| コンパイル使用メモリ | 81,792 KB |
| 実行使用メモリ | 130,476 KB |
| 最終ジャッジ日時 | 2024-10-15 05:48:06 |
| 合計ジャッジ時間 | 8,869 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans1 = []
ans2 = []
m = 0
for i, (a, b) in enumerate(zip(A, B)):
d = a-b
if d < 0:
ans1 += [(i+1, 'R')]*abs(d)
elif d > 0:
ans2 += [(i+1, 'L')]*abs(d)
m += abs(d)
print(m)
ans1.reverse()
for k, c in ans1:
print(k, c)
for k, c in ans2:
print(k, c)
brthyyjp