結果
| 問題 |
No.24 数当てゲーム
|
| コンテスト | |
| ユーザー |
funakoshi
|
| 提出日時 | 2019-06-20 15:47:15 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 5,000 ms |
| コード長 | 1,805 bytes |
| コンパイル時間 | 806 ms |
| コンパイル使用メモリ | 112,904 KB |
| 実行使用メモリ | 24,208 KB |
| 最終ジャッジ日時 | 2024-12-17 18:05:37 |
| 合計ジャッジ時間 | 1,628 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace yukicoderTest
{
class Program
{
static void Main(string[] args)
{
string num = "0123456789";
string n = Console.ReadLine();
int loop = int.Parse(n);
int[] cnt = new int[10];
for (int i = 0; i < cnt.Length; i++)
{
cnt[i] = 0;
}
for(int i=0;i<loop;i++)
{
string str = Console.ReadLine();
string[] jiro = str.Split(' ');
if(jiro[4]=="YES")
{
int a = int.Parse(jiro[0]);
int b = int.Parse(jiro[1]);
int c = int.Parse(jiro[2]);
int d = int.Parse(jiro[3]);
cnt[a] = cnt[a] + 1;
cnt[b] = cnt[b] + 1;
cnt[c] = cnt[c] + 1;
cnt[d] = cnt[d] + 1;
}
else
{
int a = int.Parse(jiro[0]);
int b = int.Parse(jiro[1]);
int c = int.Parse(jiro[2]);
int d = int.Parse(jiro[3]);
cnt[a] = cnt[a] - 1;
cnt[b] = cnt[b] - 1;
cnt[c] = cnt[c] - 1;
cnt[d] = cnt[d] - 1;
}
}
string max = "";
int m = -100;
for (int i=0;i<cnt.Length;i++)
{
if (m < cnt[i])
{
max = num.Substring(i, 1);
m = cnt[i];
}
}
Console.WriteLine(max);
}
}
}
funakoshi