結果
| 問題 |
No.349 干支の置き物
|
| コンテスト | |
| ユーザー |
mencotton
|
| 提出日時 | 2018-02-18 12:23:36 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 633 bytes |
| コンパイル時間 | 831 ms |
| コンパイル使用メモリ | 110,664 KB |
| 実行使用メモリ | 28,068 KB |
| 最終ジャッジ日時 | 2024-06-24 12:42:37 |
| 合計ジャッジ時間 | 2,675 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 WA * 7 |
コンパイルメッセージ
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;
namespace _349
{
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
Dictionary<string,int> dic = new Dictionary<string,int>();
for (int i = 0; i < n; i++)
{
string s = Console.ReadLine();
if (!dic.ContainsKey(s)) dic[s] = 0;
dic[s]++;
}
int max = 0;
foreach (var item in dic) max = Math.Max(max,item.Value);
Console.WriteLine(max < (n + 1) / 2 ? "YES" : "NO");
}
}
}
mencotton