結果
| 問題 | No.3278 Avoid Division |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-09-20 03:37:45 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 66 ms / 2,000 ms |
| + 96µs | |
| コード長 | 743 bytes |
| 記録 | |
| コンパイル時間 | 257 ms |
| コンパイル使用メモリ | 96,240 KB |
| 実行使用メモリ | 79,104 KB |
| 最終ジャッジ日時 | 2026-07-15 04:16:55 |
| 合計ジャッジ時間 | 6,870 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 24 |
ソースコード
#yukicoder3278 Avoid Division
def solve():
N = int(input())
bunbo_flag = 0
ans = []
for i in range(1, N + 1):
op, _ = input().split()
if op == '+':
if bunbo_flag == 0:
ans.append(f'add a a A[{i}]')
else:
ans.append(f'mul c b A[{i}]')
ans.append(f'add a a c')
elif op == '*':
ans.append(f'mul a a A[{i}]')
elif op == '/':
if bunbo_flag == 0:
ans.append(f'add b b A[{i}]')
bunbo_flag = 1
else:
ans.append(f'mul b b A[{i}]')
if bunbo_flag == 1:
ans.append(f'div a a b')
print(len(ans))
print(*ans, sep = '\n')
solve()