結果

問題 No.1650 Moving Coins
ユーザー nasutarou1341nasutarou1341
提出日時 2021-08-20 21:48:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 244 ms / 2,000 ms
コード長 380 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 128,508 KB
最終ジャッジ日時 2024-04-22 04:14:50
合計ジャッジ時間 8,902 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,712 KB
testcase_01 AC 35 ms
51,968 KB
testcase_02 AC 36 ms
52,028 KB
testcase_03 AC 161 ms
101,504 KB
testcase_04 AC 142 ms
99,228 KB
testcase_05 AC 157 ms
101,120 KB
testcase_06 AC 167 ms
101,268 KB
testcase_07 AC 164 ms
100,992 KB
testcase_08 AC 210 ms
116,824 KB
testcase_09 AC 205 ms
105,140 KB
testcase_10 AC 212 ms
114,816 KB
testcase_11 AC 216 ms
110,576 KB
testcase_12 AC 203 ms
109,976 KB
testcase_13 AC 198 ms
109,736 KB
testcase_14 AC 212 ms
104,420 KB
testcase_15 AC 200 ms
109,696 KB
testcase_16 AC 223 ms
113,896 KB
testcase_17 AC 217 ms
112,728 KB
testcase_18 AC 230 ms
116,276 KB
testcase_19 AC 239 ms
128,508 KB
testcase_20 AC 241 ms
128,272 KB
testcase_21 AC 244 ms
125,884 KB
testcase_22 AC 238 ms
125,856 KB
testcase_23 AC 235 ms
125,060 KB
testcase_24 AC 165 ms
101,632 KB
testcase_25 AC 167 ms
101,344 KB
testcase_26 AC 118 ms
108,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

ans = []
for i in range(N):
  a = A[i]
  b = B[i]
  if b < a:
    for n in range(a - b):
      ans.append([i + 1, "L"])
for i in range(N - 1, -1, -1):
  a = A[i]
  b = B[i]
  if a < b:
    for n in range(b - a):
      ans.append([i + 1, "R"])

print(len(ans))
for a, b in ans:
  print(a, b)
0