結果
問題 |
No.2057 Ising Model
|
ユーザー |
![]() |
提出日時 | 2025-03-20 20:38:18 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 230 bytes |
コンパイル時間 | 228 ms |
コンパイル使用メモリ | 81,852 KB |
実行使用メモリ | 53,724 KB |
最終ジャッジ日時 | 2025-03-20 20:38:44 |
合計ジャッジ時間 | 3,482 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 40 WA * 4 |
ソースコード
N, A, B = map(int, input().split()) D = B - 2 * A if D > 0: res = A * (N - 1) - B * N elif D < 0: if N % 2 == 0: res = -A * (N - 1) else: res = -A * (N - 1) - B else: res = -A * (N + 1) print(res)