結果
問題 | No.2110 012 Matching |
ユーザー |
![]() |
提出日時 | 2022-10-28 22:00:50 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 1,657 ms / 2,000 ms |
コード長 | 642 bytes |
コンパイル時間 | 1,986 ms |
コンパイル使用メモリ | 73,948 KB |
実行使用メモリ | 60,060 KB |
最終ジャッジ日時 | 2024-07-06 01:10:12 |
合計ジャッジ時間 | 15,111 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 |
ソースコード
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);}}}