結果

問題 No.43 野球の試合
ユーザー tookunn_1213tookunn_1213
提出日時 2015-12-13 23:58:23
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 587 bytes
コンパイル時間 66 ms
コンパイル使用メモリ 6,592 KB
実行使用メモリ 6,104 KB
最終ジャッジ日時 2023-10-13 15:03:22
合計ジャッジ時間 915 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 11 ms
5,852 KB
testcase_02 AC 11 ms
5,992 KB
testcase_03 AC 11 ms
5,876 KB
testcase_04 WA -
testcase_05 AC 11 ms
6,104 KB
testcase_06 AC 11 ms
5,884 KB
testcase_07 WA -
testcase_08 AC 11 ms
6,100 KB
testcase_09 AC 11 ms
5,872 KB
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
S = [[i,list(raw_input())] for i in range(N)]
for i in range(N):
	if S[0][1][i] == '-':
		S[0][1][i],S[i][1][0] = 'o','x'
S = sorted(S,cmp=lambda x,y:cmp(x[1].count('-') + x[1].count('o'),y[1].count('x') + y[1].count('o')))
for i in range(N):
	for j in range(N):
		if S[i][1][j] == '-':
			S[i][1][j],S[j][1][i] = 'o','x'
S = sorted(S,cmp=lambda x,y:cmp(x[1].count('o'),y[1].count('o')),reverse=True)
rank = 1
prev = S[0][1].count('o')
for i in range(1,N):
	if prev > S[i][1].count('o'):
		rank += 1
		prev = S[i][1].count('o')
	if S[i][0] == 0:
		print rank
		break
0