結果

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

ソースコード

diff #

#include <bits/stdc++.h>

using i64 = long long;

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    int A, B;
    std::cin >> A >> B;
    
    int ans = A + B;
    for (int i = std::abs(A - B); i <= A + B; i += 2) {
        ans = std::min(ans, std::abs(i -( A + B - i)));
    }
    std::cout << ans << "\n";
    
    return 0;
}
0