結果

問題 No.239 にゃんぱすー
ユーザー CroweaCrowea
提出日時 2019-01-25 14:15:52
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 954 bytes
コンパイル時間 824 ms
コンパイル使用メモリ 65,572 KB
実行使用メモリ 24,740 KB
最終ジャッジ日時 2023-10-14 09:48:31
合計ジャッジ時間 4,841 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
24,384 KB
testcase_01 AC 61 ms
24,740 KB
testcase_02 AC 61 ms
22,328 KB
testcase_03 AC 62 ms
22,384 KB
testcase_04 AC 61 ms
22,396 KB
testcase_05 AC 62 ms
22,472 KB
testcase_06 AC 61 ms
24,616 KB
testcase_07 AC 61 ms
22,600 KB
testcase_08 AC 63 ms
20,516 KB
testcase_09 AC 62 ms
22,396 KB
testcase_10 AC 62 ms
22,580 KB
testcase_11 AC 64 ms
24,324 KB
testcase_12 AC 65 ms
24,516 KB
testcase_13 AC 66 ms
22,304 KB
testcase_14 AC 66 ms
24,424 KB
testcase_15 AC 64 ms
22,328 KB
testcase_16 AC 64 ms
22,464 KB
testcase_17 AC 64 ms
22,456 KB
testcase_18 AC 66 ms
22,260 KB
testcase_19 AC 65 ms
24,436 KB
testcase_20 AC 66 ms
24,444 KB
testcase_21 AC 66 ms
24,504 KB
testcase_22 AC 65 ms
22,388 KB
testcase_23 AC 66 ms
22,396 KB
testcase_24 AC 66 ms
24,388 KB
testcase_25 AC 68 ms
24,452 KB
testcase_26 AC 68 ms
22,392 KB
testcase_27 AC 62 ms
22,508 KB
testcase_28 AC 63 ms
24,476 KB
testcase_29 AC 64 ms
22,452 KB
testcase_30 AC 64 ms
24,332 KB
testcase_31 AC 63 ms
22,500 KB
testcase_32 AC 65 ms
24,716 KB
testcase_33 AC 65 ms
22,652 KB
testcase_34 AC 64 ms
22,396 KB
testcase_35 AC 66 ms
20,620 KB
testcase_36 AC 65 ms
22,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public static class Program
{
    const string NYANPASS = "nyanpass";
    static void Main(string[] args)
    {
        int N = int.Parse(Console.ReadLine());
        var matrix = new string[N, N];

        // 行列生成
        string[] line;
        for (int i=0; i<N; i++)
        {
            line = Console.ReadLine().Split(' ');
            for (int j=0; j<N; j++)
            {
                matrix[i,j] = line[j]; 
            }
        }

        // 検知
        var set = new HashSet<int>();
        int counter = 0;

        for (int i = 0; i < N; i++)
        {
            counter = 0;
            for (int j = 0; j < N; j++)
            {
                if (matrix[j, i] == NYANPASS) counter++;
            }
            if (counter == N - 1) set.Add(i);
        }

        Console.WriteLine( (set.Count() == 1 ) ? set.First() + 1 : -1);
    }
} // class Program
0