結果

問題 No.799 赤黒かーどげぇむ
ユーザー phsplsphspls
提出日時 2020-01-08 16:31:01
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 500 bytes
コンパイル時間 13,254 ms
コンパイル使用メモリ 377,832 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-02 12:52:17
合計ジャッジ時間 12,036 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
5,248 KB
testcase_01 AC 1 ms
5,248 KB
testcase_02 AC 1 ms
5,248 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 WA -
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 WA -
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 0 ms
5,376 KB
testcase_17 AC 0 ms
5,376 KB
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::Read;
use std::cmp::{min, max};

fn solve(abcd: Vec<i16>) {
    let dup = min(abcd[1] - abcd[2] + 1, min(abcd[3] - abcd[2] + 1, abcd[1] - abcd[0] + 1));
    println!("{}", (abcd[1]-abcd[0]+1) * (abcd[3]-abcd[2]+1) - max(0, dup));
}

fn main() {
    let mut abcd = String::new();
    std::io::stdin().read_to_string(&mut abcd).ok();
    let abcd: Vec<i16> = abcd.trim().split('\n').next().unwrap().trim().split_whitespace().map(|s| s.parse::<i16>().unwrap()).collect();
    solve(abcd);
}
0