結果

問題 No.2057 Ising Model
ユーザー shobonvipshobonvip
提出日時 2022-08-26 21:43:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 191 bytes
コンパイル時間 449 ms
コンパイル使用メモリ 82,364 KB
実行使用メモリ 53,692 KB
最終ジャッジ日時 2024-04-21 23:45:55
合計ジャッジ時間 3,295 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,592 KB
testcase_01 AC 38 ms
52,240 KB
testcase_02 AC 39 ms
52,976 KB
testcase_03 AC 38 ms
52,828 KB
testcase_04 AC 38 ms
53,636 KB
testcase_05 AC 38 ms
52,612 KB
testcase_06 AC 37 ms
51,828 KB
testcase_07 AC 38 ms
52,276 KB
testcase_08 AC 38 ms
52,676 KB
testcase_09 AC 37 ms
53,184 KB
testcase_10 AC 37 ms
52,944 KB
testcase_11 AC 39 ms
52,144 KB
testcase_12 WA -
testcase_13 AC 38 ms
53,468 KB
testcase_14 AC 38 ms
52,496 KB
testcase_15 AC 38 ms
51,440 KB
testcase_16 AC 38 ms
52,624 KB
testcase_17 AC 37 ms
52,484 KB
testcase_18 AC 38 ms
52,204 KB
testcase_19 AC 39 ms
52,640 KB
testcase_20 AC 37 ms
52,152 KB
testcase_21 AC 39 ms
52,420 KB
testcase_22 AC 37 ms
53,256 KB
testcase_23 WA -
testcase_24 AC 37 ms
52,008 KB
testcase_25 AC 37 ms
53,180 KB
testcase_26 AC 38 ms
51,880 KB
testcase_27 WA -
testcase_28 AC 38 ms
53,316 KB
testcase_29 AC 37 ms
52,304 KB
testcase_30 AC 38 ms
52,640 KB
testcase_31 AC 37 ms
51,688 KB
testcase_32 AC 37 ms
53,440 KB
testcase_33 AC 37 ms
52,136 KB
testcase_34 AC 38 ms
53,028 KB
testcase_35 AC 37 ms
52,500 KB
testcase_36 AC 38 ms
52,564 KB
testcase_37 AC 37 ms
52,364 KB
testcase_38 AC 37 ms
52,312 KB
testcase_39 AC 37 ms
51,944 KB
testcase_40 AC 37 ms
53,216 KB
testcase_41 AC 38 ms
52,272 KB
testcase_42 AC 38 ms
51,680 KB
testcase_43 AC 37 ms
51,936 KB
testcase_44 AC 38 ms
52,376 KB
testcase_45 WA -
testcase_46 AC 37 ms
51,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,a,b = map(int,input().split())

# 1,1,1,1,1 ..., 1
ans = a * (n-1) - b * n

# 1,-1,1,-1, ..., 1

if n % 2 == 0:
	ans = min(ans, -a * (n-1))
else:
	ans = min(ans, -a * (n-1) - b)

print(ans)
0