結果
問題 | No.799 赤黒かーどげぇむ |
ユーザー |
|
提出日時 | 2019-03-18 23:17:44 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 347 bytes |
コンパイル時間 | 456 ms |
コンパイル使用メモリ | 56,156 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 07:34:09 |
合計ジャッジ時間 | 1,215 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <iostream>#include <algorithm>using namespace std;int main() {int a, b, c, d;cin >> a >> b >> c >> d;int s = b - a + 1;int t = d - c + 1;int n1 = max(a, c);int n2 = min(b, d);int n = n1 - n2;if(n > 0) {cout << s * t << endl;} else {cout << (s * t + n - 1) << endl;}}