結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
54,128 KB
testcase_01 AC 122 ms
54,164 KB
testcase_02 AC 124 ms
54,000 KB
testcase_03 AC 113 ms
52,984 KB
testcase_04 AC 125 ms
53,900 KB
testcase_05 AC 122 ms
54,260 KB
testcase_06 AC 123 ms
54,288 KB
testcase_07 AC 112 ms
53,148 KB
testcase_08 AC 107 ms
53,040 KB
testcase_09 AC 123 ms
54,120 KB
testcase_10 AC 121 ms
54,416 KB
testcase_11 AC 123 ms
53,988 KB
testcase_12 AC 122 ms
54,212 KB
testcase_13 AC 102 ms
52,556 KB
testcase_14 AC 119 ms
54,032 KB
testcase_15 AC 122 ms
54,128 KB
testcase_16 AC 119 ms
53,828 KB
testcase_17 AC 128 ms
53,972 KB
testcase_18 AC 125 ms
53,784 KB
testcase_19 AC 121 ms
53,952 KB
testcase_20 AC 106 ms
54,048 KB
testcase_21 AC 122 ms
54,116 KB
testcase_22 AC 121 ms
54,044 KB
testcase_23 AC 117 ms
54,136 KB
testcase_24 AC 123 ms
54,156 KB
testcase_25 AC 125 ms
53,908 KB
testcase_26 AC 119 ms
54,180 KB
testcase_27 AC 120 ms
54,120 KB
testcase_28 AC 108 ms
52,980 KB
testcase_29 AC 114 ms
53,756 KB
testcase_30 AC 108 ms
52,908 KB
testcase_31 AC 123 ms
54,216 KB
testcase_32 AC 114 ms
52,612 KB
testcase_33 AC 119 ms
54,440 KB
testcase_34 AC 122 ms
54,012 KB
testcase_35 AC 122 ms
54,100 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