結果

問題 No.709 優勝可能性
ユーザー cielciel
提出日時 2018-07-08 00:32:47
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,171 ms / 3,500 ms
コード長 315 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 11,296 KB
実行使用メモリ 41,440 KB
最終ジャッジ日時 2023-09-19 08:52:10
合計ジャッジ時間 13,915 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,036 KB
testcase_01 AC 83 ms
15,300 KB
testcase_02 AC 82 ms
15,176 KB
testcase_03 AC 82 ms
15,164 KB
testcase_04 AC 81 ms
15,300 KB
testcase_05 AC 81 ms
15,136 KB
testcase_06 AC 81 ms
15,080 KB
testcase_07 AC 82 ms
15,080 KB
testcase_08 AC 82 ms
15,088 KB
testcase_09 AC 83 ms
15,220 KB
testcase_10 AC 653 ms
25,956 KB
testcase_11 AC 567 ms
26,400 KB
testcase_12 AC 836 ms
26,668 KB
testcase_13 AC 1,162 ms
34,224 KB
testcase_14 AC 1,079 ms
34,304 KB
testcase_15 AC 1,062 ms
34,544 KB
testcase_16 AC 1,124 ms
36,712 KB
testcase_17 AC 1,171 ms
41,440 KB
testcase_18 AC 85 ms
15,284 KB
testcase_19 AC 85 ms
15,032 KB
testcase_20 AC 1,151 ms
34,984 KB
testcase_21 AC 1,164 ms
34,832 KB
testcase_22 AC 86 ms
15,152 KB
testcase_23 AC 85 ms
15,176 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

(n,m),*a=$<.map{|e|e.split.map &:to_i}
deg=[r=0]*n
ma=[-1]*m
people=m.times.map{[]}
n.times{|i|
	m.times{|j|
		if ma[j]<a[i][j]
			people[j].each{|e|
				deg[e]-=1
				r-=1 if deg[e]==0
			}
			people[j]=[]
			ma[j]=a[i][j]
		end
		if ma[j]==a[i][j]
			deg[i]+=1
			r+=1 if deg[i]==1
			people[j]<<i
		end
	}
	p r
}
0