結果
| 問題 |
No.799 赤黒かーどげぇむ
|
| コンテスト | |
| ユーザー |
yukinon0808
|
| 提出日時 | 2019-03-17 21:28:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,183 bytes |
| コンパイル時間 | 1,628 ms |
| コンパイル使用メモリ | 165,644 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-07 20:33:25 |
| 合計ジャッジ時間 | 2,253 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
#define int long long int
using namespace std;
template<typename T,typename U> using P=pair<T,U>;
template<typename T> using V=vector<T>;
template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<typename T>auto&operator<<(ostream&s,const vector<T>&v){s<<"[";bool a=1;for(auto e:v){s<<(a?"":" ")<<e;a=0;}s<<"]";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const pair<T,U>&p){s<<"("<<p.first<<","<<p.second<<")";return s;}
template<typename T>auto&operator<<(ostream&s,const set<T>&st){s<<"{";bool a=1;for(auto e:st){s<<(a?"":" ")<<e;a=0;}s<<"}";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const map<T,U>&m){s<<"{";bool a=1;for(auto e:m){s<<(a?"":" ")<<e.first<<":"<<e.second;a=0;}s<<"}";return s;}
#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl;
struct edge { int to, cost; };
const int INF = 1e18;
const int MOD = 1e9+7;
signed main()
{
int a, b, c, d; cin >> a >> b >> c >> d;
int ans = (b - a + 1) * (d - c + 1) - max(min(b,d) - max(a,c) + 1, 0LL);
cout << ans << endl;
return 0;
}
yukinon0808