結果

問題 No.2110 012 Matching
ユーザー shojin_proshojin_pro
提出日時 2022-10-28 22:00:50
言語 Java19
(openjdk 21)
結果
AC  
実行時間 1,650 ms / 2,000 ms
コード長 642 bytes
コンパイル時間 3,085 ms
コンパイル使用メモリ 71,476 KB
実行使用メモリ 53,448 KB
最終ジャッジ日時 2023-09-20 04:58:47
合計ジャッジ時間 16,407 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
39,364 KB
testcase_01 AC 751 ms
49,844 KB
testcase_02 AC 1,235 ms
50,752 KB
testcase_03 AC 1,030 ms
51,064 KB
testcase_04 AC 1,511 ms
50,620 KB
testcase_05 AC 1,250 ms
53,000 KB
testcase_06 AC 1,180 ms
50,908 KB
testcase_07 AC 1,650 ms
52,932 KB
testcase_08 AC 358 ms
45,928 KB
testcase_09 AC 618 ms
45,540 KB
testcase_10 AC 1,493 ms
53,448 KB
testcase_11 AC 129 ms
39,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        for(int t = 0; t < T; t++){
            long A = sc.nextLong();
            long B = sc.nextLong();
            long C = sc.nextLong();
            long min = Math.min(A,C);
            long ans = B/2*2 + min*2;
            A -= min;
            B = B % 2;
            C -= min;
            if(A != 0){
                ans += B;
            }else if(C != 0){
                ans += C/2;
            }
            System.out.println(ans);
        }
    }
}
0