結果

問題 No.1650 Moving Coins
ユーザー ntudantuda
提出日時 2021-08-21 13:37:39
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 664 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 81,888 KB
実行使用メモリ 125,124 KB
最終ジャッジ日時 2024-04-23 05:13:29
合計ジャッジ時間 10,590 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
59,744 KB
testcase_01 AC 37 ms
52,744 KB
testcase_02 AC 37 ms
53,620 KB
testcase_03 AC 190 ms
102,232 KB
testcase_04 AC 172 ms
95,468 KB
testcase_05 AC 179 ms
99,140 KB
testcase_06 AC 200 ms
103,908 KB
testcase_07 AC 195 ms
104,344 KB
testcase_08 AC 234 ms
121,160 KB
testcase_09 AC 267 ms
111,324 KB
testcase_10 AC 233 ms
121,692 KB
testcase_11 AC 418 ms
119,364 KB
testcase_12 AC 271 ms
110,544 KB
testcase_13 AC 296 ms
110,560 KB
testcase_14 AC 335 ms
110,440 KB
testcase_15 AC 212 ms
110,748 KB
testcase_16 AC 243 ms
122,104 KB
testcase_17 AC 241 ms
120,528 KB
testcase_18 AC 258 ms
125,124 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()))
j = 0
ans = []
while A != B:
    for i in range(N):
        if A[i] == B[i]:
            continue
        elif A[i] > B[i]:
            if i == 0:
                ans.append([i+1, "L"])
                A[i] -= 1
            elif A[i] - A[i-1] > 1:
                ans.append([i+1, "L"])
                A[i] -= 1
        elif A[i] < B[i]:
            if i == N - 1:
                ans.append([i+1, "R"])
                A[i] += 1
            elif A[i + 1] - A[i] > 1:
                ans.append([i+1, "R"])
                A[i] += 1
print(len(ans))
for a in ans:
    print(*a)
0