結果
| 問題 |
No.1334 Multiply or Add
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-15 22:38:17 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 321 bytes |
| コンパイル時間 | 400 ms |
| コンパイル使用メモリ | 81,872 KB |
| 実行使用メモリ | 104,752 KB |
| 最終ジャッジ日時 | 2025-04-15 22:39:04 |
| 合計ジャッジ時間 | 6,639 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)
lam6er