結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
5,860 KB
testcase_01 AC 11 ms
5,952 KB
testcase_02 AC 11 ms
5,928 KB
testcase_03 AC 11 ms
6,100 KB
testcase_04 WA -
testcase_05 AC 11 ms
5,864 KB
testcase_06 AC 10 ms
5,856 KB
testcase_07 WA -
testcase_08 AC 11 ms
5,948 KB
testcase_09 AC 11 ms
5,916 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(0,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