結果
| 問題 |
No.239 にゃんぱすー
|
| コンテスト | |
| ユーザー |
funakoshi
|
| 提出日時 | 2019-06-27 12:01:05 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,242 bytes |
| コンパイル時間 | 825 ms |
| コンパイル使用メモリ | 110,844 KB |
| 実行使用メモリ | 26,136 KB |
| 最終ジャッジ日時 | 2024-06-27 14:39:01 |
| 合計ジャッジ時間 | 2,935 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 31 WA * 2 |
コンパイルメッセージ
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;
using System.Text;
using System.Threading.Tasks;
namespace yukicoderTest
{
class Program
{
static void Main(string[] args)
{
string input = Console.ReadLine();
int n = int.Parse(input);
int[] cnt = new int[n];
for (int i = 0; i < n; i++)
{
string[] aisatu = Console.ReadLine().Split(' ');
for (int j = 0; j < n; j++)
{
if (aisatu[j] == "nyanpass")
{
cnt[j]++;
}
}
}
int max = -100;
int ren = -1;
for (int i = 0; i < n; i++)
{
if (cnt[i] > max)
{
max = cnt[i];
ren = i;
}
else if (cnt[i] == max)
{
ren = -1;
}
}
if (ren != -1)
{
Console.WriteLine(ren + 1);
}
else
{
Console.WriteLine(ren);
}
}
}
}
funakoshi