結果

問題 No.1650 Moving Coins
ユーザー ch1channnch1channn
提出日時 2022-12-13 17:12:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 201 ms / 2,000 ms
コード長 559 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 118,320 KB
最終ジャッジ日時 2024-04-25 02:28:30
合計ジャッジ時間 8,564 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
51,968 KB
testcase_01 AC 42 ms
51,840 KB
testcase_02 AC 42 ms
52,096 KB
testcase_03 AC 129 ms
101,444 KB
testcase_04 AC 111 ms
92,628 KB
testcase_05 AC 120 ms
98,400 KB
testcase_06 AC 132 ms
102,036 KB
testcase_07 AC 135 ms
102,144 KB
testcase_08 AC 172 ms
107,264 KB
testcase_09 AC 168 ms
103,808 KB
testcase_10 AC 175 ms
108,124 KB
testcase_11 AC 187 ms
109,680 KB
testcase_12 AC 162 ms
101,828 KB
testcase_13 AC 161 ms
101,880 KB
testcase_14 AC 178 ms
104,232 KB
testcase_15 AC 152 ms
100,736 KB
testcase_16 AC 188 ms
112,080 KB
testcase_17 AC 187 ms
111,116 KB
testcase_18 AC 194 ms
109,944 KB
testcase_19 AC 193 ms
118,292 KB
testcase_20 AC 194 ms
117,288 KB
testcase_21 AC 200 ms
118,320 KB
testcase_22 AC 201 ms
117,556 KB
testcase_23 AC 198 ms
117,180 KB
testcase_24 AC 124 ms
99,048 KB
testcase_25 AC 128 ms
100,204 KB
testcase_26 AC 137 ms
108,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
if sys.platform =='ios':
	import clipboard
	a=clipboard.get()
	a = a.split('\n')
	text = '\n'.join(a)
	with open('input_file.txt','w') as f:
		f.write(text)
	sys.stdin = open('input_file.txt')
	
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
ans = []

for i in range(n):
	if a[i] <= b[i]:
		continue
	for _ in range(a[i]-b[i]):
		ans.append("%d L"%(i+1))
		
for i in range(n-1,-1,-1):
	if a[i] >= b[i]:
		continue
	for _ in range(b[i]-a[i]):
		ans.append("%d R"%(i+1))
		
print(len(ans))
print(*ans,sep="\n")
0