結果
| 問題 |
No.202 1円玉投げ
|
| コンテスト | |
| ユーザー |
TANIGUCHI Kousuke
|
| 提出日時 | 2015-08-19 13:05:49 |
| 言語 | Ruby (3.4.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 553 bytes |
| コンパイル時間 | 299 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 42,240 KB |
| 最終ジャッジ日時 | 2024-12-22 09:56:21 |
| 合計ジャッジ時間 | 98,824 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 TLE * 11 |
コンパイルメッセージ
Syntax OK
ソースコード
# Here your code !
def d2(a,b)
2.times.inject(0) do |s, i|
s + (a[i] - b[i]) ** 2
end
end
n = gets.to_i
coins = n.times.map {gets.split.map(&:to_i)}
areas = 200.times.map { Array.new(200) }
s = coins.inject(0) {|s,c|
i,j = c.map {|v| v.div(200) + 1}
insec = (i-1..i+1).each.all? { |di|
(j-1..j+1).each.all? { |dj|
areas[di][dj] ||= []
areas[di][dj].all? {|put| d2(put,c) >= 400}
}
}
if insec
areas[i][j].push(c)
s+1
else
s
end
}
puts s
TANIGUCHI Kousuke