結果
| 問題 |
No.2057 Ising Model
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-28 02:24:54 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 261 bytes |
| コンパイル時間 | 225 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 65,920 KB |
| 最終ジャッジ日時 | 2024-11-22 15:24:55 |
| 合計ジャッジ時間 | 4,866 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 44 |
ソースコード
n, a, b = map(int, input().split()) sgn = [1, -1] dp = [- b * sgn[i] for i in range(2)] for _ in range(n - 1): ndp = [INF for _ in range(2)] ndp[0] = min(dp[0] + a - b, dp[1] - a - b) ndp[1] = min(dp[0] - a + b, dp[1] + a + b) dp = ndp print(min(dp))