結果
| 問題 | No.3278 Avoid Division | 
| コンテスト | |
| ユーザー |  とりゐ | 
| 提出日時 | 2025-09-19 17:26:42 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 857 bytes | 
| コンパイル時間 | 301 ms | 
| コンパイル使用メモリ | 82,180 KB | 
| 実行使用メモリ | 60,364 KB | 
| 最終ジャッジ日時 | 2025-09-19 20:50:44 | 
| 合計ジャッジ時間 | 4,258 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 1 | 
| other | AC * 9 WA * 15 | 
ソースコード
n = int(input())
command = []
flag_add = False
flag_div = False
for i in range(1, n + 1):
    op, Ai = input().split()
    if op == "+":
        if not flag_div:
            command.append(("add", "a", "a", "A[{}]".format(i)))
        else:
            command.append(("mul", "c", "b", "A[{}]".format(i)))
            command.append(("add", "a", "a", "c"))
        flag_add = True
    if op == "*":
        if not flag_add:
            continue
        else:
            command.append(("mul", "a", "a", "A[{}]".format(i)))
    if op == "/":
        if not flag_add:
            continue
        if not flag_div:
            command.append(("add", "b", "b", "A[{}]".format(i)))
            flag_div = True
        else:
            command.append(("mul", "b", "b", "A[{}]".format(i)))
print(len(command))
for op, a, b, c in command:
    print(op, a, b, c)
            
            
            
        