結果
| 問題 | No.239 にゃんぱすー |
| コンテスト | |
| ユーザー |
しらゆき
|
| 提出日時 | 2015-11-20 10:06:28 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 20 ms / 2,000 ms |
| コード長 | 885 bytes |
| 記録 | |
| コンパイル時間 | 539 ms |
| コンパイル使用メモリ | 104,192 KB |
| 実行使用メモリ | 20,096 KB |
| 最終ジャッジ日時 | 2026-04-04 06:35:38 |
| 合計ジャッジ時間 | 2,879 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
class Program
{
static void Main()
{
int n = int.Parse(Console.ReadLine());
string[,] a = new string[n, n];
for (int i = 0; i < n; i++)
{
string[] s = Console.ReadLine().Split();
for (int j = 0; j < n; j++)
{
a[i, j] = s[j];
}
}
int renchon = -1;
int cnt = 0;
for (int j = 0; j < n; j++)
{
for (int i = 0; i < n; i++)
{
if (a[i, j] == "nyanpass") cnt++;
}
if (cnt == n - 1)
{
if (renchon != -1)
{
Console.WriteLine(-1);
return;
}
else renchon = j + 1;
}
cnt = 0;
}
Console.WriteLine(renchon);
}
}
しらゆき