結果

問題 No.475 最終日 - Writerの怠慢
ユーザー suppy193suppy193
提出日時 2017-02-10 16:00:36
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 900 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 11,312 KB
実行使用メモリ 22,156 KB
最終ジャッジ日時 2023-08-27 06:52:18
合計ジャッジ時間 3,548 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,148 KB
testcase_01 AC 84 ms
15,236 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 316 ms
21,652 KB
testcase_14 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n, s, w_id = gets.strip.split(' ').map(&:to_i)
a = gets.strip.split(' ').map(&:to_i)
scores = []
(1..n - 1).each do |i|
	scores << (50 * s + 50 * s / (0.8 + 0.2 * i)).floor	
end
score_writer = a[w_id] + 100 * s
pro = 1
(0...n).each do |id|
	next if id == w_id
=begin
	count = 0
	scores.each do |score|
		if a[id] + score > score_writer
			count += 1
		else
			break
		end
	end
	p count
=end
	idx_min = 0
	idx_max = n - 2
	idx = 0
	# 3.times do
	if a[id] + scores[0] < score_writer
		count = 0
	else
		loop do
			idx = (idx_max + idx_min) / 2
			# print "id:#{id} #{idx_min} #{idx_max} #{a[id] + scores[idx]} #{score_writer} #{scores}\n"
			if a[id] + scores[idx] >= score_writer
				idx_min = idx
			else
				idx_max = idx
			end
			# print "id:#{id} #{idx_min} #{idx_max}\n"
			break if idx_max - idx_min <= 1
		end
		count = idx_max
	end
	# p count
	pro *= (n - 1 - count).to_f / (n - 1)
end

p pro
0