結果

問題 No.920 あかあお
ユーザー mattyan0502mattyan0502
提出日時 2019-11-12 15:06:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 669 bytes
コンパイル時間 4,419 ms
コンパイル使用メモリ 74,396 KB
実行使用メモリ 57,724 KB
最終ジャッジ日時 2023-10-24 11:39:39
合計ジャッジ時間 4,434 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
57,464 KB
testcase_01 AC 124 ms
57,560 KB
testcase_02 AC 126 ms
57,104 KB
testcase_03 AC 123 ms
57,348 KB
testcase_04 AC 124 ms
57,384 KB
testcase_05 AC 124 ms
57,652 KB
testcase_06 AC 125 ms
57,696 KB
testcase_07 AC 125 ms
57,440 KB
testcase_08 AC 123 ms
57,416 KB
testcase_09 AC 127 ms
55,524 KB
testcase_10 AC 125 ms
57,724 KB
testcase_11 AC 125 ms
57,008 KB
testcase_12 AC 123 ms
57,468 KB
testcase_13 AC 127 ms
57,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int Z = sc.nextInt();
        int ZZ = Z;
        int ans = 0;
        for(int i=0;i<Z;i++)
        {
            if(X>Y)
            {
                Y++;
            }
            else if(X<=Y)
            {
                X++;
            }
            ZZ--;
        }
        if(X>Y)
        {
            ans = Y;
        }
        else
        {
            ans = X;
        }
        System.out.println(ans);
    }
}
0