結果

問題 No.920 あかあお
ユーザー NaoppyJNaoppyJ
提出日時 2019-11-08 21:24:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 2,323 ms
コンパイル使用メモリ 75,164 KB
実行使用メモリ 57,660 KB
最終ジャッジ日時 2023-10-24 11:11:45
合計ジャッジ時間 4,573 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
57,408 KB
testcase_01 AC 122 ms
57,440 KB
testcase_02 AC 122 ms
57,496 KB
testcase_03 AC 124 ms
57,660 KB
testcase_04 AC 125 ms
57,444 KB
testcase_05 AC 123 ms
57,124 KB
testcase_06 AC 122 ms
57,412 KB
testcase_07 AC 123 ms
57,408 KB
testcase_08 AC 122 ms
57,480 KB
testcase_09 AC 123 ms
57,408 KB
testcase_10 AC 122 ms
57,632 KB
testcase_11 AC 124 ms
57,440 KB
testcase_12 AC 123 ms
57,556 KB
testcase_13 AC 123 ms
57,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt(), y = sc.nextInt(), z = sc.nextInt();
        int ans = 0;
        for (int i = 0; i <= z; i++) {
            ans = Math.max(ans, Math.min(x+i, y+z-i));
        }
        System.out.println(ans);
    }
}
0