結果

問題 No.2239 Friday
ユーザー Teddy
提出日時 2023-03-11 10:06:15
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 475 bytes
コンパイル時間 1,642 ms
コンパイル使用メモリ 192,248 KB
最終ジャッジ日時 2025-02-11 09:52:25
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

void solve(){
    int a, b;
    cin >> a >> b;
    int same = 2*(min(a, b));
    int diff = abs(b- a);
    if(same <= diff){
        cout << diff << "\n";
    }else{
        int ans = (same - diff)%4;
        cout << min(4 - ans, ans) << "\n";
    }
}


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    // int t;
    // cin >> t;
    // while(t--){
    //    solve();     
    // }
    solve();
    return 0;
}
0