結果

問題 No.1650 Moving Coins
ユーザー 👑 timitimi
提出日時 2021-09-14 09:57:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 257 ms / 2,000 ms
コード長 389 bytes
コンパイル時間 377 ms
コンパイル使用メモリ 86,772 KB
実行使用メモリ 127,636 KB
最終ジャッジ日時 2023-09-09 05:25:05
合計ジャッジ時間 12,325 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,048 KB
testcase_01 AC 72 ms
70,960 KB
testcase_02 AC 73 ms
71,004 KB
testcase_03 AC 165 ms
78,396 KB
testcase_04 AC 163 ms
78,296 KB
testcase_05 AC 166 ms
79,124 KB
testcase_06 AC 181 ms
79,024 KB
testcase_07 AC 170 ms
78,300 KB
testcase_08 AC 212 ms
101,556 KB
testcase_09 AC 200 ms
100,812 KB
testcase_10 AC 206 ms
101,064 KB
testcase_11 AC 236 ms
100,068 KB
testcase_12 AC 201 ms
92,424 KB
testcase_13 AC 205 ms
92,460 KB
testcase_14 AC 227 ms
100,636 KB
testcase_15 AC 194 ms
89,048 KB
testcase_16 AC 243 ms
103,484 KB
testcase_17 AC 238 ms
104,188 KB
testcase_18 AC 256 ms
109,732 KB
testcase_19 AC 233 ms
127,636 KB
testcase_20 AC 234 ms
126,096 KB
testcase_21 AC 257 ms
125,936 KB
testcase_22 AC 254 ms
125,136 KB
testcase_23 AC 255 ms
125,084 KB
testcase_24 AC 142 ms
77,800 KB
testcase_25 AC 159 ms
78,484 KB
testcase_26 AC 149 ms
109,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int, input().split()))
B=list(map(int, input().split()))
L,R=[],[]
e=0
for i in range(N):
  e+=abs(A[i]-B[i])
  if A[i]>B[i]:
    L.append(i)
  elif A[i]<B[i]:
    R.append(i)
ans=[]
L=sorted(L)
R=sorted(R)[::-1]
print(e)
for l in L:
  d=abs(A[l]-B[l])
  for i in range(d):
    print(l+1,'L')
for r in R:
  d=abs(A[r]-B[r])
  for i in range(d):
    print(r+1,'R')
0