結果

問題 No.1650 Moving Coins
ユーザー yuusanlondonyuusanlondon
提出日時 2021-08-20 21:52:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 200 ms / 2,000 ms
コード長 452 bytes
コンパイル時間 331 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 131,740 KB
最終ジャッジ日時 2024-04-22 04:21:22
合計ジャッジ時間 7,410 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,840 KB
testcase_01 AC 38 ms
51,840 KB
testcase_02 AC 37 ms
51,456 KB
testcase_03 AC 98 ms
89,216 KB
testcase_04 AC 90 ms
88,704 KB
testcase_05 AC 97 ms
89,088 KB
testcase_06 AC 102 ms
88,576 KB
testcase_07 AC 98 ms
88,960 KB
testcase_08 AC 156 ms
109,048 KB
testcase_09 AC 146 ms
103,424 KB
testcase_10 AC 154 ms
107,964 KB
testcase_11 AC 170 ms
105,648 KB
testcase_12 AC 138 ms
95,232 KB
testcase_13 AC 132 ms
94,976 KB
testcase_14 AC 156 ms
103,040 KB
testcase_15 AC 128 ms
94,208 KB
testcase_16 AC 167 ms
110,304 KB
testcase_17 AC 170 ms
109,176 KB
testcase_18 AC 175 ms
117,528 KB
testcase_19 AC 188 ms
131,740 KB
testcase_20 AC 184 ms
131,512 KB
testcase_21 AC 200 ms
130,112 KB
testcase_22 AC 190 ms
130,876 KB
testcase_23 AC 196 ms
130,764 KB
testcase_24 AC 96 ms
95,488 KB
testcase_25 AC 98 ms
90,624 KB
testcase_26 AC 145 ms
122,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=[]
s=[]
for i in range(n):
    if a[i]<b[i]:
        s.append('R')
    else:
        s.append('L')
for i in range(n):
  if s[i]=='L':
    for j in range(a[i]-b[i]):
      ans.append(' '.join([str(i+1),'L']))
for i in range(n-1,-1,-1):
  if s[i]=='R':
    for j in range(b[i]-a[i]):
      ans.append(' '.join([str(i+1),'R']))
print(len(ans))
for i in ans:
    print(i)
0