結果

問題 No.202 1円玉投げ
ユーザー gigurururugigurururu
提出日時 2015-05-04 09:08:06
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,756 ms / 5,000 ms
コード長 303 bytes
コンパイル時間 383 ms
コンパイル使用メモリ 11,260 KB
実行使用メモリ 46,600 KB
最終ジャッジ日時 2023-08-23 22:15:56
合計ジャッジ時間 30,467 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,502 ms
29,712 KB
testcase_01 AC 1,621 ms
46,600 KB
testcase_02 AC 83 ms
15,320 KB
testcase_03 AC 85 ms
15,120 KB
testcase_04 AC 85 ms
15,080 KB
testcase_05 AC 179 ms
30,972 KB
testcase_06 AC 1,393 ms
43,484 KB
testcase_07 AC 1,556 ms
43,260 KB
testcase_08 AC 1,579 ms
43,224 KB
testcase_09 AC 872 ms
40,924 KB
testcase_10 AC 409 ms
37,216 KB
testcase_11 AC 742 ms
40,500 KB
testcase_12 AC 776 ms
40,832 KB
testcase_13 AC 441 ms
37,616 KB
testcase_14 AC 195 ms
32,120 KB
testcase_15 AC 856 ms
41,200 KB
testcase_16 AC 1,126 ms
24,492 KB
testcase_17 AC 1,356 ms
26,364 KB
testcase_18 AC 1,341 ms
26,276 KB
testcase_19 AC 799 ms
41,044 KB
testcase_20 AC 1,252 ms
42,896 KB
testcase_21 AC 795 ms
40,980 KB
testcase_22 AC 94 ms
15,580 KB
testcase_23 AC 110 ms
26,552 KB
testcase_24 AC 94 ms
16,068 KB
testcase_25 AC 95 ms
16,216 KB
testcase_26 AC 94 ms
15,468 KB
testcase_27 AC 95 ms
15,596 KB
testcase_28 AC 95 ms
15,528 KB
testcase_29 AC 94 ms
15,704 KB
testcase_30 AC 102 ms
21,028 KB
testcase_31 AC 94 ms
15,488 KB
testcase_32 AC 102 ms
20,244 KB
testcase_33 AC 95 ms
15,944 KB
testcase_34 AC 95 ms
15,420 KB
testcase_35 AC 1,325 ms
24,640 KB
testcase_36 AC 1,756 ms
34,956 KB
testcase_37 AC 1,687 ms
45,564 KB
testcase_38 AC 1,323 ms
24,968 KB
testcase_39 AC 87 ms
15,368 KB
testcase_40 AC 88 ms
15,572 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
MAX=20000
DIV=14
l=(0..MAX/DIV+2).map{[]}
n.times{
  x,y=gets.split.map(&:to_i)
  vx,vy=x/DIV,y/DIV
  d=[*vx-2..vx+2].product([*vy-2..vy+2])
  if d.select{|ux,uy|l[ux][uy]}.all?{|ux,uy|tx,ty=l[ux][uy];(tx-x)**2+(ty-y)**2>=400}
    l[vx][vy]=[x,y]
  end
}
p l.inject(0){|s,i|s+i.compact.size}
0