結果
問題 | No.516 赤と青の風船 |
ユーザー |
|
提出日時 | 2019-01-24 11:19:19 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 27 ms / 2,000 ms |
コード長 | 737 bytes |
コンパイル時間 | 917 ms |
コンパイル使用メモリ | 106,752 KB |
実行使用メモリ | 18,432 KB |
最終ジャッジ日時 | 2024-09-16 04:35:37 |
合計ジャッジ時間 | 1,739 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 6 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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);}}