結果

問題 No.2239 Friday
ユーザー srjywrdnprkt
提出日時 2023-04-22 05:09:43
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 440 bytes
コンパイル時間 945 ms
コンパイル使用メモリ 103,684 KB
最終ジャッジ日時 2025-02-12 12:56:15
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>

using namespace std;
using ll = long long;

int main(){

    ll A, B, ans=1e5;
    cin >> A >> B;
    for (int i=0; i<=A; i++){
        ans = min(ans, abs(B-A+2*i-2*(A-i)));
    }

    cout << ans << endl;

    return 0;
}
0