結果
問題 | No.516 赤と青の風船 |
ユーザー | Crowea |
提出日時 | 2019-01-24 11:19:19 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 48 ms / 2,000 ms |
コード長 | 737 bytes |
コンパイル時間 | 849 ms |
コンパイル使用メモリ | 70,392 KB |
実行使用メモリ | 23,208 KB |
最終ジャッジ日時 | 2023-10-14 09:36:39 |
合計ジャッジ時間 | 2,060 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 46 ms
21,368 KB |
testcase_01 | AC | 47 ms
21,280 KB |
testcase_02 | AC | 48 ms
19,352 KB |
testcase_03 | AC | 47 ms
21,216 KB |
testcase_04 | AC | 48 ms
23,208 KB |
testcase_05 | AC | 46 ms
21,220 KB |
testcase_06 | AC | 45 ms
21,272 KB |
testcase_07 | AC | 46 ms
21,220 KB |
ソースコード
using System; using System.Collections.Generic; using System.Linq; class Program { enum Color { RED, BLUE } static void Main(string[] args) { int balCnt = 3; var bals = new List<string>(); for (int i=0; i<balCnt; i++) bals.Add(Console.ReadLine()); var redCnt = bals.Count(x => x == Enum.GetName(typeof(Color), Color.RED)); var blueCnt = bals.Count(y => y == Enum.GetName(typeof(Color), Color.BLUE)); var color = (redCnt > blueCnt) ? Enum.GetName(typeof(Color), Color.RED): Enum.GetName(typeof(Color), Color.BLUE); Console.WriteLine(color); } }