結果
| 問題 | No.2110 012 Matching |
| コンテスト | |
| ユーザー |
bluemegane
|
| 提出日時 | 2022-10-29 07:33:45 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 383 ms / 2,000 ms |
| コード長 | 800 bytes |
| 記録 | |
| コンパイル時間 | 522 ms |
| コンパイル使用メモリ | 108,060 KB |
| 実行使用メモリ | 22,912 KB |
| 最終ジャッジ日時 | 2026-03-27 20:01:29 |
| 合計ジャッジ時間 | 4,508 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 11 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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);
}
}
bluemegane