結果

問題 No.709 優勝可能性
ユーザー neko_the_shadowneko_the_shadow
提出日時 2018-06-29 23:35:20
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 1,294 bytes
コンパイル時間 4,559 ms
コンパイル使用メモリ 105,628 KB
実行使用メモリ 23,844 KB
最終ジャッジ日時 2023-09-13 15:45:00
合計ジャッジ時間 10,382 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
21,844 KB
testcase_01 AC 67 ms
21,936 KB
testcase_02 AC 66 ms
21,932 KB
testcase_03 AC 66 ms
21,756 KB
testcase_04 AC 66 ms
21,752 KB
testcase_05 AC 66 ms
19,756 KB
testcase_06 AC 66 ms
21,748 KB
testcase_07 AC 67 ms
23,844 KB
testcase_08 AC 66 ms
21,772 KB
testcase_09 AC 66 ms
21,756 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

namespace _709
{
    class Program
    {
        static void Main(string[] args)
        {
            var first = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
            var n = first[0];
            var m = first[1];

            // members[j]=能力jの最大値を有するメンバーの一覧
            // parameters[j]=能力jの最大値
            var members = Enumerable.Range(0, m).Select(_ => new List<int>()).ToList(); 
            var parameters = Enumerable.Repeat(0, m).ToList(); 
            for (int i = 0; i < n; i++)
            {
                var row = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
                for (int j = 0; j < m; j++)
                {
                    if (parameters[j] < row[j])
                    {
                        parameters[j] = row[j];
                        members[j] = new List<int> { i };
                    }

                    if (parameters[j] == row[j])
                    {
                        members[j].Add(i);
                    }
                }

                var answer = members.SelectMany(list => list).Distinct().Count();
                Console.WriteLine(answer);
            }
        }
    }
}
0