結果
| 問題 | No.24 数当てゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-10 07:33:52 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 5,000 ms |
| コード長 | 1,075 bytes |
| コンパイル時間 | 5,398 ms |
| コンパイル使用メモリ | 104,576 KB |
| 実行使用メモリ | 18,944 KB |
| 最終ジャッジ日時 | 2024-11-24 01:07:56 |
| 合計ジャッジ時間 | 3,927 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
namespace No024_数当てゲーム
{
class Program
{
static void Main(string[] args)
{
int[] yes = Enumerable.Repeat(1, 10).ToArray();
int[] no = Enumerable.Repeat(0, 10).ToArray();
int max = 0, pos = 0;
int n = int.Parse(Console.ReadLine());
for (int i = 0; i < n; i++)
{
string[] input = Console.ReadLine().Split(' ');
if (input[4] == "YES")
for (int j = 0; j < 4; j++)
yes[int.Parse(input[j])]++;
else
for (int j = 0; j < 4; j++)
no[int.Parse(input[j])]++;
}
for (int i = 0; i < 10; i++)
{
if (no[i] > 0)
yes[i] = 0;
if (max < yes[i])
{
max = yes[i];
pos = i;
}
}
Console.WriteLine(pos.ToString());
}
}
}