結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2015-12-17 00:15:45 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 34 ms / 2,000 ms |
コード長 | 860 bytes |
コンパイル時間 | 896 ms |
コンパイル使用メモリ | 114,448 KB |
実行使用メモリ | 27,624 KB |
最終ジャッジ日時 | 2024-09-16 06:35:57 |
合計ジャッジ時間 | 3,298 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.
ソースコード
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");}}}