結果

問題 No.239 にゃんぱすー
コンテスト
ユーザー 大谷祐翔
提出日時 2025-11-28 17:39:51
言語 C#
(.NET 8.0.404)
結果
MLE  
実行時間 -
コード長 1,051 bytes
コンパイル時間 8,872 ms
コンパイル使用メモリ 170,076 KB
実行使用メモリ 189,924 KB
最終ジャッジ日時 2025-11-28 17:40:15
合計ジャッジ時間 12,335 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 32 MLE * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (128 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #
raw source code

class Program
{
    static void Main(string[] args)
    {
        int total = int.Parse(Console.ReadLine()!);
        string[,] wordArray = new string[total, total]; 

        for (int i = 0; i < total; i++)
        {
            string[] input = Console.ReadLine()!.Split(' ');
            for (int j = 0; j < input.Length; j++)
            {
                wordArray[i, j] = input[j];
            }
        }

        int ans = 0;
        int count = 0;
        for (int i = 0;i < total; i++)
        {
            int wordCount = 0;
            for (int j = 0; j < total; j++)
            {
                if (wordArray[j, i] == "nyanpass" || wordArray[j, i] == "-")
                {
                    wordCount++;
                }
            }
            if (wordCount == total)
            {
                count++;
                ans = i + 1;
            }
        }

        if (count == 1 && ans != 0)
        {
            Console.WriteLine(ans);
        }
        else
        {
            Console.WriteLine(-1);
        }
    }
}
0