結果

問題 No.43 野球の試合
ユーザー nbisconbisco
提出日時 2016-05-01 20:55:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 860 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-04-15 08:31:20
合計ジャッジ時間 1,338 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,752 KB
testcase_01 AC 31 ms
10,880 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 31 ms
10,880 KB
testcase_04 AC 31 ms
10,752 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 30 ms
10,752 KB
testcase_09 AC 30 ms
10,752 KB
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
#fileencoding: utf-8

N = int(input())
table = [list(input()) for i in range(N)]
win_count = [[0,i] for i in range(N)]

for i in range(N):
    if table[0][i] == "-":
        table[0][i] = "o"
        table[i][0] = "x"
        win_count[0][0] += 1
    elif table[0][i] == "o":
        win_count[0][0] += 1

for i in range(1,N):
    for j in range(N):
        if table[i][j] == "o":
            win_count[i][0] += 1
        elif table[i][j] == "-":
            win_count[i][0] += 1
            table[i][j] = "o"
            table[j][i] = "x"

win_count = sorted(win_count, key=lambda val:val[0])
cur_rank = 1
cur_score = win_count[0][0]
for i in range(1,N):
    if win_count[i][1] == 0:
        break
    if cur_score == win_count[i][0]:
        continue
    else:
        cur_score = win_count[i][0]
        cur_rank += 1
print(cur_rank)
0