結果

問題 No.799 赤黒かーどげぇむ
ユーザー iris2617
提出日時 2025-03-14 01:37:15
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 391 bytes
コンパイル時間 3,771 ms
コンパイル使用メモリ 273,368 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-14 01:37:21
合計ジャッジ時間 5,048 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define int long long
#define matsuri pair<int,int>
//const int iris = 1e9+7;
const int iris = 998244353;
using namespace std;

void solve()
{
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	int l=max(a,c), r=min(b,d);
	cout<<(b-a+1)*(d-c+1)-max(0ll, r-l+1)<<'\n';
}

signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	int T=1;
	//cin>>T;
	while(T--)
		solve();

	return 0;
}
0