結果

問題 No.799 赤黒かーどげぇむ
ユーザー キョウチクキョウチク
提出日時 2022-05-14 23:52:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 531 bytes
コンパイル時間 4,447 ms
コンパイル使用メモリ 72,500 KB
実行使用メモリ 56,040 KB
最終ジャッジ日時 2023-09-30 17:24:40
合計ジャッジ時間 7,463 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,572 KB
testcase_01 AC 123 ms
55,916 KB
testcase_02 AC 125 ms
55,700 KB
testcase_03 AC 124 ms
55,656 KB
testcase_04 AC 125 ms
55,448 KB
testcase_05 AC 126 ms
55,412 KB
testcase_06 AC 125 ms
55,772 KB
testcase_07 AC 123 ms
55,864 KB
testcase_08 AC 124 ms
56,040 KB
testcase_09 AC 126 ms
56,008 KB
testcase_10 AC 124 ms
55,996 KB
testcase_11 AC 125 ms
55,856 KB
testcase_12 AC 125 ms
55,816 KB
testcase_13 AC 124 ms
55,772 KB
testcase_14 AC 133 ms
55,488 KB
testcase_15 AC 133 ms
55,516 KB
testcase_16 AC 133 ms
55,796 KB
testcase_17 AC 123 ms
55,576 KB
testcase_18 AC 124 ms
53,716 KB
testcase_19 AC 125 ms
56,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Test10 {
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    String[] line;
    line=sc.nextLine().split(" ");
    int a=Integer.parseInt(line[0]);
    int a1=Integer.parseInt(line[1]);
    int b=Integer.parseInt(line[2]);
    int b1=Integer.parseInt(line[3]);
    int eq=0,tmp,tmp1;
    tmp=a;
    if(tmp<b) tmp=b;
    tmp1=a1;
    if(b1<tmp1) tmp1=b1;
    eq=tmp1-tmp+1;
    if(eq<0) eq=0;
    int combi=(a1-a+1)*(b1-b+1)-eq;
    System.out.println(combi);
  }
}
0