結果

問題 No.2110 012 Matching
ユーザー bluemeganebluemegane
提出日時 2022-10-29 07:33:45
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 626 ms / 2,000 ms
コード長 800 bytes
コンパイル時間 914 ms
コンパイル使用メモリ 63,336 KB
実行使用メモリ 26,944 KB
最終ジャッジ日時 2023-09-20 12:58:35
合計ジャッジ時間 7,977 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
20,780 KB
testcase_01 AC 204 ms
26,848 KB
testcase_02 AC 427 ms
24,944 KB
testcase_03 AC 301 ms
24,900 KB
testcase_04 AC 550 ms
26,892 KB
testcase_05 AC 401 ms
26,928 KB
testcase_06 AC 394 ms
22,896 KB
testcase_07 AC 626 ms
26,892 KB
testcase_08 AC 79 ms
20,780 KB
testcase_09 AC 144 ms
24,884 KB
testcase_10 AC 613 ms
26,944 KB
testcase_11 AC 59 ms
20,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using static System.Math;
using System.Collections.Generic;
using System.Linq;
using System;

public class Hello
{
    static void Main()
    {
        var t = int.Parse(Console.ReadLine().Trim());
        while (t-- > 0)
        {
            string[] line = Console.ReadLine().Trim().Split(' ');
            var a = long.Parse(line[0]);
            var b = long.Parse(line[1]);
            var c = long.Parse(line[2]);
            getAns(a, b, c);
        }
    }
    static void getAns(long a, long b, long c)
    {
        var ans = 0L;
        var acmin = Min(a, c);
        a -= acmin;
        c -= acmin;
        ans += acmin * 2L;
        ans += (b / 2) * 2L;
        b %= 2;
        var abmin = Min(a, b);
        ans += abmin;
        ans += c / 2L;
        Console.WriteLine(ans);
    }
}
0