結果

問題 No.3433 [Cherry 8th Tune A] ADD OIL!
コンテスト
ユーザー Meso Meso
提出日時 2026-02-07 10:10:35
言語 Python3
(3.14.3 + numpy 2.4.2 + scipy 1.17.0)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 416 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,495 ms
コンパイル使用メモリ 20,688 KB
実行使用メモリ 15,488 KB
最終ジャッジ日時 2026-02-07 10:10:48
合計ジャッジ時間 7,031 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

t = int(input())

for _ in range(t):
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    ans = float('inf')
    t = list(range(n))
    for i in range(n):
        total = 1
        for j in range(n):
            if i == j:
                total *= (a[j] - k)
            else:
                total *= a[j]
                
        ans = min(ans, total)

    print(ans)
        
        
0