結果

問題 No.709 優勝可能性
ユーザー GrayCoderGrayCoder
提出日時 2018-07-28 14:11:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 531 ms / 3,500 ms
コード長 805 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 10,940 KB
実行使用メモリ 34,692 KB
最終ジャッジ日時 2023-09-19 06:11:04
合計ジャッジ時間 8,502 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,668 KB
testcase_01 AC 19 ms
8,556 KB
testcase_02 AC 19 ms
8,612 KB
testcase_03 AC 20 ms
8,520 KB
testcase_04 AC 19 ms
8,612 KB
testcase_05 AC 20 ms
8,508 KB
testcase_06 AC 19 ms
8,636 KB
testcase_07 AC 19 ms
8,556 KB
testcase_08 AC 19 ms
8,604 KB
testcase_09 AC 19 ms
8,568 KB
testcase_10 AC 233 ms
19,972 KB
testcase_11 AC 169 ms
16,396 KB
testcase_12 AC 351 ms
28,540 KB
testcase_13 AC 465 ms
23,732 KB
testcase_14 AC 423 ms
21,804 KB
testcase_15 AC 414 ms
19,704 KB
testcase_16 AC 470 ms
22,252 KB
testcase_17 AC 531 ms
33,624 KB
testcase_18 AC 20 ms
8,636 KB
testcase_19 AC 20 ms
8,516 KB
testcase_20 AC 431 ms
34,628 KB
testcase_21 AC 432 ms
34,692 KB
testcase_22 AC 20 ms
8,520 KB
testcase_23 AC 20 ms
8,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
from sys import stdin, stdout
input = lambda: stdin.readline().rstrip()
write = stdout.write

def main():
    N, M = map(int, input().split())
    R = stdin.read().splitlines()

    winner = [[] for _ in [0] * M]
    point = [0] * M
    player = defaultdict(int)
    for i, n in enumerate(R):
        m = list(map(int, n.split()))
        for j in range(M):
            if m[j] > point[j]:
                for k in winner[j]:
                    player[k] -= 1
                    if not player[k]:
                        player.pop(k)
                player[i] += 1
                point[j] = m[j]
                winner[j] = [i]
            elif m[j] == point[j]:
                winner[j].append(i)
                player[i] += 1
        print(len(player))

main()
0