結果

問題 No.709 優勝可能性
ユーザー bluemeganebluemegane
提出日時 2018-09-27 09:26:01
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 1,236 bytes
コンパイル時間 2,011 ms
コンパイル使用メモリ 110,696 KB
実行使用メモリ 63,612 KB
最終ジャッジ日時 2024-04-20 09:02:59
合計ジャッジ時間 8,315 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
63,612 KB
testcase_01 AC 30 ms
18,944 KB
testcase_02 AC 31 ms
18,944 KB
testcase_03 AC 31 ms
19,072 KB
testcase_04 AC 30 ms
19,072 KB
testcase_05 AC 31 ms
18,944 KB
testcase_06 AC 30 ms
19,072 KB
testcase_07 AC 30 ms
19,200 KB
testcase_08 AC 30 ms
19,072 KB
testcase_09 AC 31 ms
18,944 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.Collections.Generic;
using System.Linq;
using System;

public class Hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var m = int.Parse(line[1]);
        var max = new int[m];
        var a = new List<int>[m];
        for (int i = 0; i < m; i++) a[i] = new List<int>();
        line = Console.ReadLine().Trim().Split(' ');
        var b = Array.ConvertAll(line, int.Parse);
        for (int i = 0; i < m; i++)
        {
            max[i] = b[i];
            a[i].Add(0);
        }
        print(a, m);
        for (int i = 1; i < n; i++)
        {
            line = Console.ReadLine().Trim().Split(' ');
            b = Array.ConvertAll(line, int.Parse);
            for (int j = 0; j < m; j++)
            {
                if (b[j] > max[j]) { a[j].Clear(); a[j].Add(i); max[j] = b[j]; }
                else if (b[j] == max[j]) a[j].Add(i);
            }
            print(a, m);
        }
    }
    public static void print (List<int>[] a  , int m)
    {
        var ans = new List<int>();
        for (int i = 0; i < m; i++)
            ans.AddRange(a[i]);
        Console.WriteLine(ans.Distinct().Count());
    }
}
0