結果

問題 No.202 1円玉投げ
ユーザー gigurururugigurururu
提出日時 2015-05-04 01:10:02
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 299 bytes
コンパイル時間 341 ms
コンパイル使用メモリ 11,244 KB
実行使用メモリ 110,672 KB
最終ジャッジ日時 2023-08-23 22:10:07
合計ジャッジ時間 12,941 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 3,143 ms
97,680 KB
testcase_02 AC 108 ms
28,092 KB
testcase_03 AC 107 ms
28,328 KB
testcase_04 AC 106 ms
28,244 KB
testcase_05 AC 300 ms
89,028 KB
testcase_06 AC 2,750 ms
90,240 KB
testcase_07 AC 2,702 ms
96,492 KB
testcase_08 AC 2,751 ms
96,760 KB
testcase_09 AC 1,494 ms
92,760 KB
testcase_10 AC 661 ms
89,248 KB
testcase_11 AC 1,196 ms
90,436 KB
testcase_12 AC 1,236 ms
85,656 KB
testcase_13 AC 722 ms
89,368 KB
testcase_14 AC 319 ms
89,028 KB
testcase_15 AC 1,397 ms
91,056 KB
testcase_16 TLE -
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
MAX=20000
DIV=141
l=(0..MAX/DIV+1).map{(0..MAX/DIV+1).map{[]}}
n.times{
  x,y=gets.split.map(&:to_i)
  vx,vy=x/DIV,y/DIV
  if [*vx-1..vx+1].product([*vy-1..vy+1]).flat_map{|tx,ty|l[tx][ty]}.all?{|tx,ty|(tx-x)**2+(ty-y)**2>=400}
    l[vx][vy]<<[x,y]
  end
}
p l.inject(:+).inject(:+).size
0