結果
| 問題 |
No.3278 Avoid Division
|
| コンテスト | |
| ユーザー |
ゼット
|
| 提出日時 | 2025-09-19 22:28:56 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 489 bytes |
| コンパイル時間 | 324 ms |
| コンパイル使用メモリ | 82,460 KB |
| 実行使用メモリ | 60,328 KB |
| 最終ジャッジ日時 | 2025-09-19 22:29:01 |
| 合計ジャッジ時間 | 4,306 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | AC * 10 WA * 14 |
ソースコード
N=int(input())
a,b=0,0
L=[]
for i in range(N):
t,x=input().split()
p='A['+str(i+1)+']'
x=int(x)
if t=='*':
L.append(('mul','a','a',p))
a*=x
elif t=='+':
if b>0:
L.append(('mul',p,p,'b'))
x*=b
L.append(('add','a','a',p))
a+=x
else:
if b==0:
L.append(('add','b','b',p))
b+=x
else:
L.append(('mul','b','b',p))
b*=x
if b>0:
L.append(('div','a','a','b'))
print(len(L))
for i in range(len(L)):
h=L[i][:]
print(*h)
ゼット