結果

問題 No.349 干支の置き物
ユーザー TaK7907TaK7907
提出日時 2017-10-29 11:14:48
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 814 bytes
コンパイル時間 2,067 ms
コンパイル使用メモリ 100,888 KB
実行使用メモリ 24,812 KB
最終ジャッジ日時 2023-08-14 09:29:22
合計ジャッジ時間 5,758 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
20,632 KB
testcase_01 AC 58 ms
18,648 KB
testcase_02 AC 58 ms
22,612 KB
testcase_03 AC 59 ms
22,680 KB
testcase_04 AC 60 ms
20,644 KB
testcase_05 AC 59 ms
20,688 KB
testcase_06 AC 59 ms
20,668 KB
testcase_07 AC 59 ms
20,688 KB
testcase_08 AC 60 ms
22,620 KB
testcase_09 AC 60 ms
20,768 KB
testcase_10 AC 59 ms
20,628 KB
testcase_11 AC 60 ms
20,632 KB
testcase_12 AC 60 ms
20,668 KB
testcase_13 AC 61 ms
20,568 KB
testcase_14 AC 60 ms
20,652 KB
testcase_15 AC 59 ms
22,776 KB
testcase_16 AC 59 ms
20,700 KB
testcase_17 AC 60 ms
22,544 KB
testcase_18 AC 58 ms
20,712 KB
testcase_19 AC 60 ms
20,716 KB
testcase_20 AC 59 ms
20,696 KB
testcase_21 AC 59 ms
24,812 KB
testcase_22 AC 58 ms
20,736 KB
testcase_23 AC 60 ms
20,648 KB
testcase_24 AC 59 ms
22,656 KB
testcase_25 AC 60 ms
22,624 KB
testcase_26 AC 60 ms
20,716 KB
testcase_27 AC 59 ms
18,648 KB
testcase_28 AC 58 ms
20,664 KB
testcase_29 AC 59 ms
20,620 KB
testcase_30 AC 58 ms
18,660 KB
testcase_31 AC 58 ms
18,508 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

namespace yukicodeX {
    public class ProgramX {
        public static string Solver(System.IO.TextReader reader) {
            var n = int.Parse( reader.ReadLine() );
            var x = 0;
            var figures = new Dictionary<string, int>();
            for (var i = 0; i != n; ++i) {
                var buf = reader.ReadLine().Split();
                if (figures.ContainsKey( buf[ 0 ] )) figures[ buf[ 0 ] ] += 1;
                else figures.Add( buf[ 0 ], 1 );
                if (figures[ buf[ 0 ] ] > x) ++x;
            }
            return n % 2 == 0 ? x > n / 2 ? "NO" : "YES" : x > n / 2 + 1 ? "NO" : "YES";
        }

        private static void Main() {
            Console.WriteLine( Solver( Console.In ) );
        }
    }
}
0