結果

問題 No.799 赤黒かーどげぇむ
ユーザー 里旬里旬
提出日時 2019-03-17 21:21:47
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 411 bytes
コンパイル時間 1,583 ms
コンパイル使用メモリ 192,748 KB
最終ジャッジ日時 2025-01-06 22:37:04
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout.precision(12);
    cout.setf(ios_base::fixed, ios_base::floatfield);
    
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    uint64_t ans = 0;
    for(int x=a;x<=b;x++){
        if(c<=x && x<=d) ans += d-c;
        else ans += d-c+1;
    }

    cout << ans << endl;
    
    return 0;
}
0