結果
問題 |
No.1334 Multiply or Add
|
ユーザー |
![]() |
提出日時 | 2025-04-15 22:37:24 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 321 bytes |
コンパイル時間 | 212 ms |
コンパイル使用メモリ | 82,000 KB |
実行使用メモリ | 104,732 KB |
最終ジャッジ日時 | 2025-04-15 22:38:10 |
合計ジャッジ時間 | 7,537 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 49 WA * 22 |
ソースコード
import math n = int(input()) a = list(map(int, input().split())) sum_total = sum(a) sum_log = 0.0 for num in a: sum_log += math.log(num) mod = 10**9 + 7 if sum_log > math.log(sum_total): product = 1 for num in a: product = (product * num) % mod print(product) else: print(sum_total % mod)