結果
| 問題 |
No.43 野球の試合
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-13 18:51:24 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 74 ms / 5,000 ms |
| コード長 | 968 bytes |
| コンパイル時間 | 91 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-06-30 00:39:10 |
| 合計ジャッジ時間 | 1,035 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 7 |
ソースコード
N = int(input())
score_board = [0]*N
results = []
candidate_orders = set([])
def calc():
point = score_board[0]
sort_borad = sorted(score_board)
cnt = 1
for i in sort_borad:
if point < i:
cnt += 1
point = i
candidate_orders.add(cnt)
def check(x, y):
if x == N:
y += 1
if y == N:
return calc()
x = y
if results[y][x] == '#':
check(x + 1, y)
elif results[y][x] == 'o':
score_board[y] += 1
check(x + 1, y)
score_board[y] -= 1
elif results[y][x] == 'x':
score_board[x] += 1
check(x + 1, y)
score_board[x] -= 1
elif results[y][x] == '-':
score_board[x] += 1
check(x + 1, y)
score_board[x] -= 1
score_board[y] += 1
check(x + 1, y)
score_board[y] -= 1
for i in range(N):
row = list(input())
results.append(row)
check(0,0)
print(min(candidate_orders))