結果

問題 No.239 にゃんぱすー
ユーザー TDTD
提出日時 2022-06-07 11:51:29
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,240 bytes
コンパイル時間 799 ms
コンパイル使用メモリ 106,604 KB
実行使用メモリ 24,228 KB
最終ジャッジ日時 2023-10-21 03:49:05
合計ジャッジ時間 2,886 ms
ジャッジサーバーID
(参考情報)
judge10 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
24,132 KB
testcase_01 AC 25 ms
24,132 KB
testcase_02 AC 25 ms
24,184 KB
testcase_03 AC 26 ms
24,184 KB
testcase_04 AC 26 ms
24,188 KB
testcase_05 AC 25 ms
24,184 KB
testcase_06 AC 26 ms
24,132 KB
testcase_07 AC 25 ms
24,188 KB
testcase_08 AC 26 ms
24,188 KB
testcase_09 AC 25 ms
24,184 KB
testcase_10 AC 26 ms
24,192 KB
testcase_11 AC 25 ms
24,188 KB
testcase_12 AC 26 ms
24,188 KB
testcase_13 AC 25 ms
24,192 KB
testcase_14 AC 25 ms
24,192 KB
testcase_15 AC 25 ms
24,188 KB
testcase_16 WA -
testcase_17 AC 26 ms
24,188 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 26 ms
24,192 KB
testcase_21 WA -
testcase_22 AC 27 ms
24,196 KB
testcase_23 AC 27 ms
24,192 KB
testcase_24 AC 28 ms
24,196 KB
testcase_25 AC 27 ms
24,192 KB
testcase_26 WA -
testcase_27 AC 25 ms
24,188 KB
testcase_28 AC 25 ms
24,192 KB
testcase_29 AC 25 ms
24,188 KB
testcase_30 AC 26 ms
24,192 KB
testcase_31 AC 26 ms
24,192 KB
testcase_32 AC 26 ms
24,192 KB
testcase_33 AC 26 ms
24,188 KB
testcase_34 AC 27 ms
24,196 KB
testcase_35 AC 27 ms
24,192 KB
testcase_36 AC 28 ms
24,196 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            int[] b = new int[a];
            int count = 0;
            int ans=0;
            for(int i = 0; i < a; i++)
            {
                string[] s = Console.ReadLine().Split(' ');
                for(int j=0;j<a; j++)
                {
                    if(s[j]== "nyanpass")
                    {
                        b[j]++;
                    }
                }
            }
            for (int x = 0; x <a; x++)
            {
                if (ans != 0)
                {
                    if (b[x] > b[ans - 1])
                    {
                        ans = x + 1;
                    }
                    else if (b[x] == b[ans - 1])
                    {
                        count++;
                    }
                }
                else
                {
                    if (b[x] != 0)
                    {
                        ans = x + 1;
                    }
                }
            }
            if (ans == 0 || count >= 1)
                ans = -1;
            Console.WriteLine(ans);
        }
    }
}
0