結果

問題 No.1446 ハンバーグと納豆ごはん
ユーザー LithopsLithops
提出日時 2021-03-26 23:34:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 1,678 ms
コンパイル使用メモリ 71,304 KB
実行使用メモリ 57,844 KB
最終ジャッジ日時 2023-08-19 10:23:35
合計ジャッジ時間 7,184 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
55,564 KB
testcase_01 AC 114 ms
56,128 KB
testcase_02 AC 120 ms
55,788 KB
testcase_03 AC 120 ms
55,772 KB
testcase_04 AC 117 ms
55,564 KB
testcase_05 AC 116 ms
55,956 KB
testcase_06 AC 111 ms
57,844 KB
testcase_07 AC 109 ms
55,572 KB
testcase_08 AC 115 ms
56,028 KB
testcase_09 AC 112 ms
56,024 KB
testcase_10 AC 110 ms
55,780 KB
testcase_11 AC 111 ms
55,520 KB
testcase_12 AC 119 ms
56,116 KB
testcase_13 AC 111 ms
56,124 KB
testcase_14 AC 110 ms
55,924 KB
testcase_15 AC 111 ms
56,112 KB
testcase_16 AC 111 ms
56,088 KB
testcase_17 AC 110 ms
55,772 KB
testcase_18 AC 109 ms
55,836 KB
testcase_19 AC 109 ms
55,788 KB
testcase_20 AC 109 ms
56,180 KB
testcase_21 AC 109 ms
56,140 KB
testcase_22 AC 108 ms
56,016 KB
testcase_23 AC 109 ms
56,284 KB
testcase_24 AC 110 ms
56,204 KB
testcase_25 AC 108 ms
56,368 KB
testcase_26 AC 109 ms
55,920 KB
testcase_27 AC 115 ms
55,784 KB
testcase_28 AC 110 ms
55,932 KB
testcase_29 AC 111 ms
55,960 KB
testcase_30 AC 108 ms
55,928 KB
testcase_31 AC 108 ms
56,292 KB
testcase_32 AC 105 ms
55,980 KB
testcase_33 AC 106 ms
55,684 KB
testcase_34 AC 107 ms
55,856 KB
testcase_35 AC 108 ms
55,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long A=sc.nextLong();
    long B=sc.nextLong();
    long N=sc.nextLong();
    long M=sc.nextLong();
    if(A>B){
      System.out.println(B+(A-B)/(N+1));
    }
    else{
      System.out.println(A+(B-A)/(M+1));
    }
  }
}
0