結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2018-09-25 20:51:52 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 27 ms / 2,000 ms |
コード長 | 616 bytes |
コンパイル時間 | 794 ms |
コンパイル使用メモリ | 111,900 KB |
実行使用メモリ | 27,028 KB |
最終ジャッジ日時 | 2024-10-05 18:50:54 |
合計ジャッジ時間 | 2,992 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.Linq;using System;public class Hello{public static void Main(){var n = int.Parse(Console.ReadLine().Trim());var a = new int[n];for (int i = 0; i < n; i++){string[] line = Console.ReadLine().Trim().Split(' ');for (int j = 0; j < n; j++)if (line[j] == "nyanpass") a[j]++;}var b = a.Count(x => x == n - 1);if (b == 0 | b >= 2) Console.WriteLine(-1);elsefor (int i = 0; i < n; i++)if (a[i] == n - 1) { Console.WriteLine(i + 1); break; }}}