結果

問題 No.1446 ハンバーグと納豆ごはん
ユーザー LithopsLithops
提出日時 2021-03-26 23:34:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 2,373 ms
コンパイル使用メモリ 77,280 KB
実行使用メモリ 54,336 KB
最終ジャッジ日時 2024-05-06 17:34:49
合計ジャッジ時間 7,447 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
54,048 KB
testcase_01 AC 129 ms
54,320 KB
testcase_02 AC 122 ms
53,968 KB
testcase_03 AC 121 ms
54,088 KB
testcase_04 AC 109 ms
52,976 KB
testcase_05 AC 121 ms
54,036 KB
testcase_06 AC 125 ms
54,004 KB
testcase_07 AC 122 ms
54,060 KB
testcase_08 AC 103 ms
52,772 KB
testcase_09 AC 123 ms
54,072 KB
testcase_10 AC 113 ms
54,292 KB
testcase_11 AC 129 ms
54,016 KB
testcase_12 AC 118 ms
53,888 KB
testcase_13 AC 123 ms
54,144 KB
testcase_14 AC 121 ms
54,076 KB
testcase_15 AC 119 ms
54,264 KB
testcase_16 AC 123 ms
54,060 KB
testcase_17 AC 123 ms
54,160 KB
testcase_18 AC 120 ms
54,268 KB
testcase_19 AC 122 ms
54,032 KB
testcase_20 AC 122 ms
53,872 KB
testcase_21 AC 125 ms
53,904 KB
testcase_22 AC 122 ms
53,808 KB
testcase_23 AC 126 ms
54,048 KB
testcase_24 AC 122 ms
54,044 KB
testcase_25 AC 115 ms
53,824 KB
testcase_26 AC 120 ms
54,000 KB
testcase_27 AC 120 ms
54,048 KB
testcase_28 AC 115 ms
54,036 KB
testcase_29 AC 122 ms
54,212 KB
testcase_30 AC 126 ms
54,228 KB
testcase_31 AC 123 ms
54,336 KB
testcase_32 AC 122 ms
54,016 KB
testcase_33 AC 118 ms
54,276 KB
testcase_34 AC 101 ms
53,028 KB
testcase_35 AC 110 ms
53,492 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