結果
問題 | No.2057 Ising Model |
ユーザー |
![]() |
提出日時 | 2022-08-26 21:59:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 315 bytes |
コンパイル時間 | 1,354 ms |
コンパイル使用メモリ | 165,392 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 22:35:10 |
合計ジャッジ時間 | 2,445 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 40 WA * 4 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll=long long; using ld=long double; using P=pair<ll,ll>; using V=vector<ll>; #define rep(i,n) for(int i=0;i<n;i++) #define REP(i,n) for(int i=1;i<=n;i++) int main(){ ll n,a,b; cin >> n >> a >> b; cout << min((n-1)*a*(-1)-n%2*b,(n-1)*a-b*n) << endl; }