結果

問題 No.202 1円玉投げ
ユーザー gigurururugigurururu
提出日時 2015-05-04 08:53:04
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,143 ms / 5,000 ms
コード長 318 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 11,440 KB
実行使用メモリ 82,560 KB
最終ジャッジ日時 2023-08-23 22:15:25
合計ジャッジ時間 30,070 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,088 ms
82,460 KB
testcase_01 AC 1,121 ms
82,436 KB
testcase_02 AC 404 ms
67,544 KB
testcase_03 AC 392 ms
67,584 KB
testcase_04 AC 401 ms
67,448 KB
testcase_05 AC 436 ms
74,164 KB
testcase_06 AC 977 ms
81,700 KB
testcase_07 AC 1,045 ms
81,888 KB
testcase_08 AC 1,059 ms
82,072 KB
testcase_09 AC 762 ms
80,732 KB
testcase_10 AC 553 ms
79,608 KB
testcase_11 AC 698 ms
80,480 KB
testcase_12 AC 701 ms
80,412 KB
testcase_13 AC 563 ms
79,484 KB
testcase_14 AC 436 ms
75,640 KB
testcase_15 AC 745 ms
80,400 KB
testcase_16 AC 980 ms
82,552 KB
testcase_17 AC 984 ms
82,432 KB
testcase_18 AC 989 ms
82,560 KB
testcase_19 AC 738 ms
80,340 KB
testcase_20 AC 948 ms
81,444 KB
testcase_21 AC 741 ms
80,412 KB
testcase_22 AC 404 ms
68,616 KB
testcase_23 AC 401 ms
68,628 KB
testcase_24 AC 403 ms
68,540 KB
testcase_25 AC 403 ms
68,688 KB
testcase_26 AC 405 ms
68,696 KB
testcase_27 AC 397 ms
68,524 KB
testcase_28 AC 399 ms
68,516 KB
testcase_29 AC 401 ms
68,552 KB
testcase_30 AC 400 ms
68,440 KB
testcase_31 AC 395 ms
68,560 KB
testcase_32 AC 405 ms
68,684 KB
testcase_33 AC 403 ms
68,444 KB
testcase_34 AC 405 ms
68,468 KB
testcase_35 AC 1,034 ms
82,524 KB
testcase_36 AC 1,143 ms
82,484 KB
testcase_37 AC 1,121 ms
82,124 KB
testcase_38 AC 1,029 ms
82,436 KB
testcase_39 AC 393 ms
67,832 KB
testcase_40 AC 395 ms
67,836 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
MAX=20000
DIV=20
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
  d=[*vx-1..vx+1].product([*vy-1..vy+1])
  if d.all?{|ux,uy|l[ux][uy].all?{|tx,ty|(tx-x)**2+(ty-y)**2>=400}}
    l[vx][vy]<<[x,y]
  end
}
p l.inject(0){|s,i|s+i.inject(0){|t,j|t+j.size}}
0