結果

問題 No.2057 Ising Model
ユーザー tktk_snsn
提出日時 2022-08-26 21:49:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 276 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-10-13 22:22:05
合計ジャッジ時間 2,520 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 40 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

def gen(N):
    # 1,1,1,1..
    yield N - 1, N

    # 1, -1, 1, -1, ...
    s = N // 2
    t = N - s
    yield -(N - 1), s - t
    yield -(N - 1), t - s

    # -1, -1, ...
    yield N - 1, -N


N, A, B = map(int, input().split())

print(min(A * x - B * y for x, y in gen(N)))
0