結果

問題 No.239 にゃんぱすー
ユーザー eitaho
提出日時 2015-07-10 22:23:57
言語 C#
(csc 3.100.19.26603)
結果
AC  
実行時間 47 ms
コード長 2,343 Byte
コンパイル時間 1,359 ms
使用メモリ 18,876 KB
最終ジャッジ日時 2019-09-18 13:41:45

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
challenge01.txt AC 37 ms
16,748 KB
challenge02.txt AC 37 ms
16,748 KB
challenge03.txt AC 37 ms
16,788 KB
sample1.txt AC 37 ms
16,792 KB
sample2.txt AC 37 ms
16,760 KB
sample3.txt AC 39 ms
14,756 KB
sample4.txt AC 39 ms
16,748 KB
test1.txt AC 37 ms
16,760 KB
test2.txt AC 38 ms
18,816 KB
test3.txt AC 37 ms
12,732 KB
test4.txt AC 37 ms
16,792 KB
test5.txt AC 39 ms
18,864 KB
test6.txt AC 38 ms
14,772 KB
test7.txt AC 38 ms
16,788 KB
test8.txt AC 40 ms
18,876 KB
test9.txt AC 38 ms
14,780 KB
test10.txt AC 39 ms
16,828 KB
test11.txt AC 39 ms
14,792 KB
test12.txt AC 40 ms
14,796 KB
test13.txt AC 39 ms
16,820 KB
test14.txt AC 39 ms
14,756 KB
test15.txt AC 40 ms
16,828 KB
test16.txt AC 40 ms
16,796 KB
test17.txt AC 40 ms
16,796 KB
test18.txt AC 41 ms
16,800 KB
test19.txt AC 42 ms
16,828 KB
test20.txt AC 44 ms
18,868 KB
test21.txt AC 36 ms
16,772 KB
test22.txt AC 38 ms
18,824 KB
test23.txt AC 38 ms
14,776 KB
test24.txt AC 39 ms
18,848 KB
test25.txt AC 39 ms
14,752 KB
test26.txt AC 39 ms
14,796 KB
test27.txt AC 47 ms
14,776 KB
test28.txt AC 39 ms
18,848 KB
test29.txt AC 43 ms
14,788 KB
test30.txt AC 42 ms
18,844 KB
テストケース一括ダウンロード
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.100.19.26603 (9d80dea7)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using Enu = System.Linq.Enumerable;

class Program
{
    public void Solve()
    {
        int N = Reader.Int();
        var S = new string[N][];
        for (int i = 0; i < N; i++) S[i] = Enu.Range(0, N).Select(_ => Reader.String()).ToArray();
        var who = Enu.Range(0, N).Where(w => Enu.Range(0, N).All(a => a == w || S[a][w] == "nyanpass"));
        if (who.Count() == 1) Console.WriteLine(who.First() + 1);
        else Console.WriteLine(-1);
    }
}



class Entry { static void Main() { new Program().Solve(); } }
class Reader
{
    private static TextReader reader = Console.In;
    private static readonly char[] separator = { ' ' };
    private static readonly StringSplitOptions op = StringSplitOptions.RemoveEmptyEntries;
    private static string[] A = new string[0];
    private static int i;
    private static void Init() { A = new string[0]; }
    public static void Set(TextReader r) { reader = r; Init(); }
    public static void Set(string file) { reader = new StreamReader(file); Init(); }
    public static bool HasNext() { return CheckNext(); }
    public static string String() { return Next(); }
    public static int Int() { return int.Parse(Next()); }
    public static long Long() { return long.Parse(Next()); }
    public static double Double() { return double.Parse(Next()); }
    public static int[] IntLine() { return Array.ConvertAll(Split(Line()), int.Parse); }
    public static int[] IntArray(int N) { return Enu.Range(0, N).Select(i => Int()).ToArray(); }
    public static int[][] IntTable(int H) { return Enu.Range(0, H).Select(i => IntLine()).ToArray(); }
    public static string[] StringArray(int N) { return Enu.Range(0, N).Select(i => Line()).ToArray(); }
    public static string Line() { return reader.ReadLine().Trim(); }
    private static string[] Split(string s) { return s.Split(separator, op); }
    private static string Next() { CheckNext(); return A[i++]; }
    private static bool CheckNext()
    {
        if (i < A.Length) return true;
        string line = reader.ReadLine();
        if (line == null) return false;
        if (line == "") return CheckNext();
        A = Split(line);
        i = 0;
        return true;
    }
}
0