結果

問題 No.799 赤黒かーどげぇむ
ユーザー tenten
提出日時 2020-11-12 11:46:35
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 414 bytes
コンパイル時間 2,192 ms
コンパイル使用メモリ 75,224 KB
実行使用メモリ 55,908 KB
最終ジャッジ日時 2024-07-22 19:10:02
合計ジャッジ時間 6,000 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int ans = (b - a + 1) * (d - c + 1);
        ans -= Math.max(0, b - c + 1);
        ans -= Math.max(0, a - d + 1);
        System.out.println(ans);
    }
}
0