結果

問題 No.239 にゃんぱすー
ユーザー nanophoto12nanophoto12
提出日時 2015-12-17 00:15:45
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 860 bytes
コンパイル時間 2,549 ms
コンパイル使用メモリ 107,272 KB
実行使用メモリ 23,764 KB
最終ジャッジ日時 2023-10-14 11:46:00
合計ジャッジ時間 6,453 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
23,632 KB
testcase_01 AC 60 ms
21,448 KB
testcase_02 AC 61 ms
21,480 KB
testcase_03 AC 61 ms
21,628 KB
testcase_04 AC 60 ms
21,768 KB
testcase_05 AC 63 ms
21,480 KB
testcase_06 AC 61 ms
23,588 KB
testcase_07 AC 61 ms
21,572 KB
testcase_08 AC 62 ms
23,564 KB
testcase_09 AC 63 ms
21,700 KB
testcase_10 AC 62 ms
23,552 KB
testcase_11 AC 64 ms
21,728 KB
testcase_12 AC 64 ms
21,696 KB
testcase_13 AC 62 ms
21,672 KB
testcase_14 AC 64 ms
21,608 KB
testcase_15 AC 65 ms
23,520 KB
testcase_16 AC 63 ms
21,608 KB
testcase_17 AC 64 ms
23,712 KB
testcase_18 AC 64 ms
21,676 KB
testcase_19 AC 65 ms
21,472 KB
testcase_20 AC 64 ms
23,644 KB
testcase_21 AC 65 ms
19,616 KB
testcase_22 AC 64 ms
23,716 KB
testcase_23 AC 64 ms
21,708 KB
testcase_24 AC 64 ms
21,552 KB
testcase_25 AC 65 ms
21,640 KB
testcase_26 AC 66 ms
19,652 KB
testcase_27 AC 62 ms
21,700 KB
testcase_28 AC 62 ms
19,624 KB
testcase_29 AC 64 ms
21,676 KB
testcase_30 AC 62 ms
21,588 KB
testcase_31 AC 63 ms
23,764 KB
testcase_32 AC 65 ms
21,724 KB
testcase_33 AC 65 ms
23,516 KB
testcase_34 AC 63 ms
21,584 KB
testcase_35 AC 66 ms
21,688 KB
testcase_36 AC 64 ms
21,700 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

namespace No236
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			var n = Convert.ToInt32(Console.ReadLine ());

			List<bool>[] matrix = new List<bool>[n];
			for (int i = 0; i < n; i++) {
				matrix [i] = Console.ReadLine ().Split (' ').Select (v => {
					if(v == "-" || v == "nyanpass")
					{
						return true;
					}
					return false;
				}).ToList ();
			}
			List<bool> result = new List<bool> ();
			for (int x = 0; x < n; x++) {
				bool ok = true;
				for (int y = 0; y < n; y++) {
					if (!matrix [y] [x]) {
						ok = false;
						break;
					}
				}
				result.Add (ok);
			}
			if (result.Count (v => v) == 1) {
				var index = result.IndexOf (true) + 1;
				Console.WriteLine (index.ToString ());
				return;
			}
			Console.WriteLine ("-1");
		}
	}
}
0