結果

問題 No.333 門松列を数え上げ
ユーザー oooooba
提出日時 2021-02-04 22:32:36
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 457 bytes
コンパイル時間 897 ms
コンパイル使用メモリ 104,676 KB
最終ジャッジ日時 2025-01-18 11:17:12
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <numeric>
#include <optional>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

int main() {
    int32_t a, b;
    cin >> a >> b;
    int32_t ans;
    if (a < b)
        ans = (a - 1) + (b - a - 1);
    else
        ans = (int32_t(2e9) - a) + (a - b - 1);
    cout << ans << endl;
    return 0;
}
0