結果

問題 No.1650 Moving Coins
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-08-20 21:49:10
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 500 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 82,944 KB
実行使用メモリ 121,340 KB
最終ジャッジ日時 2024-04-22 04:15:49
合計ジャッジ時間 10,974 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
57,600 KB
testcase_01 AC 42 ms
51,712 KB
testcase_02 AC 43 ms
51,968 KB
testcase_03 AC 201 ms
101,076 KB
testcase_04 AC 180 ms
96,256 KB
testcase_05 AC 198 ms
98,544 KB
testcase_06 AC 212 ms
101,652 KB
testcase_07 AC 226 ms
101,620 KB
testcase_08 AC 300 ms
121,208 KB
testcase_09 AC 308 ms
107,904 KB
testcase_10 AC 258 ms
121,340 KB
testcase_11 AC 344 ms
110,180 KB
testcase_12 AC 309 ms
110,772 KB
testcase_13 AC 316 ms
107,144 KB
testcase_14 AC 365 ms
104,072 KB
testcase_15 AC 242 ms
111,232 KB
testcase_16 AC 285 ms
117,856 KB
testcase_17 AC 269 ms
112,920 KB
testcase_18 AC 293 ms
115,592 KB
testcase_19 TLE -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = []
cnt = 0
while True:
	if a == b: break
	for i in range(n):
		if a[i] == b[i]: continue
		if a[i] < b[i]:
			while a[i] < b[i]:
				if i < n - 1 and a[i] + 1 == a[i + 1]: break
				a[i] += 1
				cnt += 1
				ans.append([i + 1, "R"])
		else:
			while a[i] > b[i]:
				if i > 0 and a[i] - 1 == a[i - 1]: break
				a[i] -= 1
				cnt += 1
				ans.append([i + 1, "L"])
print(len(ans))
for i in ans:
	print(*i)
0