結果
| 問題 | No.1650 Moving Coins |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-12-25 13:42:43 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 120 ms / 2,000 ms |
| コード長 | 453 bytes |
| 記録 | |
| コンパイル時間 | 117 ms |
| コンパイル使用メモリ | 85,312 KB |
| 実行使用メモリ | 132,940 KB |
| 最終ジャッジ日時 | 2026-04-09 21:26:35 |
| 合計ジャッジ時間 | 6,454 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
desc = []
asc = []
ans = 0
for i in range(N):
if A[i] <= B[i]:
asc.append((i + 1, abs(A[i] - B[i])))
else:
desc.append((i + 1, abs(A[i] - B[i])))
ans += abs(A[i] - B[i])
asc = asc[::-1]
print(ans)
for index, cnt in asc:
for j in range(cnt):
print(str(index) + ' R')
for index, cnt in desc:
for j in range(cnt):
print(str(index) + ' L')