結果

問題 No.1446 ハンバーグと納豆ごはん
ユーザー LithopsLithops
提出日時 2021-03-26 23:33:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 4,221 ms
コンパイル使用メモリ 72,088 KB
実行使用メモリ 57,540 KB
最終ジャッジ日時 2023-08-19 10:22:57
合計ジャッジ時間 9,507 ms
ジャッジサーバーID
(参考情報)
judge9 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,780 KB
testcase_01 AC 120 ms
55,872 KB
testcase_02 AC 120 ms
55,816 KB
testcase_03 AC 120 ms
55,792 KB
testcase_04 AC 119 ms
55,804 KB
testcase_05 AC 120 ms
53,600 KB
testcase_06 AC 124 ms
55,624 KB
testcase_07 AC 120 ms
55,680 KB
testcase_08 AC 122 ms
55,808 KB
testcase_09 AC 122 ms
55,756 KB
testcase_10 AC 120 ms
56,108 KB
testcase_11 AC 121 ms
55,508 KB
testcase_12 AC 120 ms
55,524 KB
testcase_13 AC 121 ms
56,100 KB
testcase_14 AC 123 ms
55,444 KB
testcase_15 AC 119 ms
55,856 KB
testcase_16 AC 118 ms
55,976 KB
testcase_17 AC 119 ms
55,960 KB
testcase_18 AC 123 ms
56,312 KB
testcase_19 AC 119 ms
56,076 KB
testcase_20 AC 120 ms
55,880 KB
testcase_21 AC 118 ms
55,444 KB
testcase_22 AC 120 ms
57,540 KB
testcase_23 AC 118 ms
55,648 KB
testcase_24 AC 118 ms
55,968 KB
testcase_25 AC 119 ms
55,600 KB
testcase_26 AC 119 ms
56,252 KB
testcase_27 AC 120 ms
56,048 KB
testcase_28 AC 118 ms
56,096 KB
testcase_29 AC 119 ms
55,788 KB
testcase_30 AC 118 ms
55,884 KB
testcase_31 AC 118 ms
55,764 KB
testcase_32 AC 120 ms
55,496 KB
testcase_33 AC 120 ms
56,000 KB
testcase_34 AC 119 ms
55,556 KB
testcase_35 AC 120 ms
55,772 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