結果
問題 | No.239 にゃんぱすー |
ユーザー |
|
提出日時 | 2015-07-10 22:41:21 |
言語 | C# (csc 3.6.0) |
結果 |
AC
|
実行時間 | 36 ms / 2,000 ms |
コード長 | 3,445 Byte |
コンパイル時間 | 882 ms |
使用メモリ | 29,360 KB |
最終ジャッジ日時 | 2020-10-02 09:37:23 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 32 ms
27,120 KB |
testcase_01 | AC | 32 ms
27,120 KB |
testcase_02 | AC | 32 ms
27,348 KB |
testcase_03 | AC | 32 ms
27,176 KB |
testcase_04 | AC | 33 ms
29,360 KB |
testcase_05 | AC | 32 ms
27,420 KB |
testcase_06 | AC | 33 ms
27,196 KB |
testcase_07 | AC | 32 ms
27,312 KB |
testcase_08 | AC | 32 ms
25,260 KB |
testcase_09 | AC | 32 ms
27,336 KB |
testcase_10 | AC | 35 ms
27,112 KB |
testcase_11 | AC | 34 ms
25,272 KB |
testcase_12 | AC | 33 ms
27,192 KB |
testcase_13 | AC | 33 ms
29,224 KB |
testcase_14 | AC | 35 ms
27,412 KB |
testcase_15 | AC | 33 ms
27,400 KB |
testcase_16 | AC | 32 ms
27,320 KB |
testcase_17 | AC | 33 ms
27,324 KB |
testcase_18 | AC | 33 ms
25,220 KB |
testcase_19 | AC | 36 ms
27,256 KB |
testcase_20 | AC | 34 ms
25,208 KB |
testcase_21 | AC | 33 ms
23,224 KB |
testcase_22 | AC | 34 ms
27,120 KB |
testcase_23 | AC | 36 ms
29,164 KB |
testcase_24 | AC | 36 ms
29,224 KB |
testcase_25 | AC | 35 ms
25,200 KB |
testcase_26 | AC | 36 ms
27,280 KB |
testcase_27 | AC | 33 ms
29,228 KB |
testcase_28 | AC | 32 ms
27,080 KB |
testcase_29 | AC | 33 ms
27,124 KB |
testcase_30 | AC | 33 ms
25,244 KB |
testcase_31 | AC | 33 ms
25,208 KB |
testcase_32 | AC | 35 ms
27,192 KB |
testcase_33 | AC | 35 ms
25,192 KB |
testcase_34 | AC | 36 ms
27,252 KB |
testcase_35 | AC | 35 ms
25,240 KB |
testcase_36 | AC | 36 ms
25,192 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.6.0-4.20224.5 (ec77c100) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Linq; namespace YukiCoderNo239 { class Program { static void Main() { int length = LIB.IO.R<int>(); int output = -1; string[][] greeding = LIB.IO.R<string>(length, ' '); int okcount = 0; for (int i = 0; i < length; i++) { bool flag = true; for (int j = 0; j < length; j++) { if (!((greeding[i][j] == "nyanpass") || (i == j))) { flag = false; break; } } if (flag == true) { output = i + 1; if (okcount >= 1) { LIB.IO.W(-1); LIB.IO.WFLUSH(); return; } okcount++; } } for (int i = 0; i < length; i++) { bool flag = true; for (int j = 0; j < length; j++) { if (!((greeding[j][i] == "nyanpass") || (i == j))) { flag = false; break; } } if (flag == true) { if (okcount >= 1) { if (output != i + 1) { LIB.IO.W(-1); LIB.IO.WFLUSH(); return; } } output = i + 1; okcount++; } } LIB.IO.W(output); LIB.IO.WFLUSH(); } } } namespace LIB { public class IO { private const int WMAX = 1000; private static string WSTRING = ""; public static T R<T>() { return (T)(Convert.ChangeType(R(), typeof(T))); } public static T[] R<T>(char splitter = ' ') { return R().Split(splitter).Select(v => UTILITY.PARSE<T>(v)).ToArray(); } public static T[] R<T>(int length) { T[] ret = new T[length]; for (int i = 0; i < length; i++) { ret[i] = R<T>(); } return ret; } public static T[][] R<T>(int length, char splitter = ' ') { T[][] ret = new T[length][]; for (int i = 0; i < length; i++) { ret[i] = R<T>(splitter); } return ret; } private static string R() { return Console.ReadLine(); } public static void W(object value, bool addLineFeed = true) { WSTRING += UTILITY.PARSE<string>(value); if (addLineFeed == true) { WSTRING += "\n"; } if (WSTRING.Count() >= WMAX) { WFLUSH(); } } public static void WFLUSH() { Console.Write(WSTRING); WSTRING = ""; } } public class UTILITY { public static T PARSE<T>(object value) { return (T)(Convert.ChangeType(value, typeof(T))); } } }