結果
問題 |
No.799 赤黒かーどげぇむ
|
ユーザー |
![]() |
提出日時 | 2019-03-17 21:22:23 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 298 bytes |
コンパイル時間 | 1,661 ms |
コンパイル使用メモリ | 192,904 KB |
最終ジャッジ日時 | 2025-01-06 22:37:41 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; if (a > c) { swap(a, c); swap(b, d); } int ans = (b - a + 1) * (d - c + 1); if (b >= c) { ans -= min(b, d) - c + 1; } cout << ans << endl; }