結果

問題 No.2239 Friday
ユーザー momoyuu
提出日時 2023-03-16 13:55:05
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 439 bytes
コンパイル時間 2,620 ms
コンパイル使用メモリ 243,776 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-18 09:20:31
合計ジャッジ時間 3,274 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
    int a,b;
    cin>>a>>b;
    int ans = 1e9;
    for(int i = 0;i<=a;i++){
        for(int j = 0;j<=b;j++){
            if(i>b||j>a) continue;
            if(i!=j) continue;
            //if(j+b-i!=a) continue;
            int good = i + j;
            int bad = a - i + b - j;
            ans = min(ans,abs(good-bad));
        }
    }
    cout<<ans<<endl;
}
0