結果
| 問題 | No.799 赤黒かーどげぇむ |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2019-03-21 16:42:29 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 716 bytes |
| 記録 | |
| コンパイル時間 | 716 ms |
| コンパイル使用メモリ | 102,936 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-07 05:59:13 |
| 合計ジャッジ時間 | 1,734 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 799.cc: No.799 赤黒かーどげぇむ - yukicoder
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
/* constant */
/* typedef */
/* global variables */
/* subroutines */
/* main */
int main() {
int a, b, c, d;
scanf("%d%d%d%d", &a, &b, &c, &d);
int cnt = (b - a + 1) * (d - c + 1);
if (a <= d && c <= b)
cnt -= min(b, d) - max(a, c) + 1;
printf("%d\n", cnt);
return 0;
}
tnakao0123