結果

問題 No.1650 Moving Coins
ユーザー ntudantuda
提出日時 2021-08-21 13:31:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 698 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 82,984 KB
実行使用メモリ 128,876 KB
最終ジャッジ日時 2024-04-23 05:08:32
合計ジャッジ時間 8,214 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
52,772 KB
testcase_01 AC 35 ms
52,868 KB
testcase_02 AC 37 ms
53,144 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 211 ms
128,876 KB
testcase_21 WA -
testcase_22 AC 218 ms
127,620 KB
testcase_23 AC 206 ms
127,364 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 114 ms
108,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
j = 0
ans = []
while A != B and j < 5:
    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
    j += 1            
print(len(ans))
for a in ans:
    print(*a)
0