結果

問題 No.239 にゃんぱすー
ユーザー mban
提出日時 2016-11-05 11:34:55
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 1,098 bytes
コンパイル時間 819 ms
コンパイル使用メモリ 111,804 KB
実行使用メモリ 26,132 KB
最終ジャッジ日時 2024-11-25 03:03:44
合計ジャッジ時間 3,179 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Text;
using System.Threading.Tasks;

class Magatro
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        string[][] A = new string[N][];
        int nyanpass = -1;
        for(int i = 0; i < N; i++)
        {
            string[] a = Console.ReadLine().Split(' ');
            A[i] = a;
        }
        for(int i = 0; i < N; i++)
        {
            bool nyanpath = true;
            for(int j = 0; j < N; j++)
            {
                if (i == j)
                {
                    continue;
                }
                if(A[j][i]!= "nyanpass")
                {
                    nyanpath = false;
                }
            }
            if (nyanpath) {
                if (nyanpass == -1)
                {
                    nyanpass = i + 1;
                }
                else
                {
                    Console.WriteLine(-1);
                    return;
                }
            }
        }
        Console.WriteLine(nyanpass);
    }
}
0