結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1 ms
5,376 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 0 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;

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

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