結果

問題 No.2057 Ising Model
ユーザー t98slidert98slider
提出日時 2022-08-26 22:05:18
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 402 bytes
コンパイル時間 2,654 ms
コンパイル使用メモリ 181,884 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-22 00:09:58
合計ジャッジ時間 5,898 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 RE -
testcase_03 AC 2 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 2 ms
5,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 WA -
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 WA -
testcase_20 AC 2 ms
5,376 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 WA -
testcase_28 RE -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 WA -
testcase_45 RE -
testcase_46 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize ("O3","unroll-loops")
#pragma GCC target("avx512f")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    ll n, a, b, c1, c2, ans = 1ll << 62;
    cin >> n >> a >> b;
    c1 = n / 2, c2 = n - c1;
    int r = n / 2;
    for(ll i = 0; i <= r; i++){
        ans = min(ans, a * (-(i << 2) + n - 1) + b * (-n + (i << 1)));
    }
    cout << ans << '\n';
}
0