結果
問題 | No.2110 012 Matching |
ユーザー | 👑 kakel-san |
提出日時 | 2022-10-28 22:47:11 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 305 ms / 2,000 ms |
コード長 | 1,160 bytes |
コンパイル時間 | 1,565 ms |
コンパイル使用メモリ | 65,620 KB |
実行使用メモリ | 35,872 KB |
最終ジャッジ日時 | 2023-09-20 05:56:08 |
合計ジャッジ時間 | 5,373 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 65 ms
23,640 KB |
testcase_01 | AC | 126 ms
27,476 KB |
testcase_02 | AC | 222 ms
30,928 KB |
testcase_03 | AC | 172 ms
31,116 KB |
testcase_04 | AC | 277 ms
32,812 KB |
testcase_05 | AC | 214 ms
32,628 KB |
testcase_06 | AC | 209 ms
34,472 KB |
testcase_07 | AC | 305 ms
35,872 KB |
testcase_08 | AC | 73 ms
21,648 KB |
testcase_09 | AC | 100 ms
28,556 KB |
testcase_10 | AC | 304 ms
33,940 KB |
testcase_11 | AC | 63 ms
21,536 KB |
ソースコード
using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static long NN => long.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); static void Main() { Solve(); } static void Solve() { var t = NN; var res = new long[t]; for (var u = 0; u < t; ++u) { var c = NList; if (c[0] > 0 && c[2] > 0) { var eat = Math.Min(c[0], c[2]); res[u] += eat * 2; c[0] -= eat; c[2] -= eat; } if (c[2] > 1) { var eat = c[2] / 2; res[u] += eat; c[2] -= eat * 2; } if (c[1] > 0) { var eat = c[1] / 2; res[u] += eat * 2; c[1] -= eat * 2; } if (c[0] > 0 && c[1] > 0) { ++res[u]; } } WriteLine(string.Join("\n", res)); } }