結果
問題 | No.799 赤黒かーどげぇむ |
ユーザー |
![]() |
提出日時 | 2019-03-28 17:32:24 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 127 ms / 2,000 ms |
コード長 | 484 bytes |
コンパイル時間 | 2,489 ms |
コンパイル使用メモリ | 75,184 KB |
実行使用メモリ | 54,260 KB |
最終ジャッジ日時 | 2024-10-13 07:34:19 |
合計ジャッジ時間 | 5,886 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
import java.util.*;class Yuki799{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 aka = b-a+1;int kuro = d-c+1;int dab = 0;if((a < c && d < b)||(c < a && b < d)){if(a < c && d < b){dab = d-c+1;}else{dab = b-a+1;}}else{dab = a<c?Math.max(0,b-c+1):Math.max(0,d-a+1);}System.out.println(aka*kuro-dab);}}