結果

問題 No.202 1円玉投げ
ユーザー gigurururugigurururu
提出日時 2015-05-04 08:51:09
言語 Ruby
(3.3.0)
結果
AC  
実行時間 3,897 ms / 5,000 ms
コード長 319 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 11,528 KB
実行使用メモリ 24,992 KB
最終ジャッジ日時 2023-08-23 22:13:50
合計ジャッジ時間 42,831 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3,884 ms
22,948 KB
testcase_01 AC 1,283 ms
24,992 KB
testcase_02 AC 89 ms
15,984 KB
testcase_03 AC 89 ms
15,872 KB
testcase_04 AC 88 ms
15,888 KB
testcase_05 AC 131 ms
16,984 KB
testcase_06 AC 983 ms
21,648 KB
testcase_07 AC 1,122 ms
23,816 KB
testcase_08 AC 1,141 ms
23,984 KB
testcase_09 AC 562 ms
19,368 KB
testcase_10 AC 260 ms
17,688 KB
testcase_11 AC 452 ms
18,984 KB
testcase_12 AC 464 ms
18,900 KB
testcase_13 AC 270 ms
17,428 KB
testcase_14 AC 138 ms
16,800 KB
testcase_15 AC 537 ms
19,120 KB
testcase_16 AC 2,967 ms
22,868 KB
testcase_17 AC 2,981 ms
23,012 KB
testcase_18 AC 2,974 ms
22,904 KB
testcase_19 AC 498 ms
19,044 KB
testcase_20 AC 860 ms
21,492 KB
testcase_21 AC 506 ms
18,836 KB
testcase_22 AC 103 ms
16,816 KB
testcase_23 AC 103 ms
16,644 KB
testcase_24 AC 101 ms
16,844 KB
testcase_25 AC 101 ms
16,700 KB
testcase_26 AC 103 ms
16,668 KB
testcase_27 AC 103 ms
16,764 KB
testcase_28 AC 99 ms
16,804 KB
testcase_29 AC 101 ms
16,640 KB
testcase_30 AC 101 ms
16,744 KB
testcase_31 AC 98 ms
16,852 KB
testcase_32 AC 100 ms
16,748 KB
testcase_33 AC 106 ms
16,776 KB
testcase_34 AC 124 ms
16,804 KB
testcase_35 AC 3,864 ms
22,940 KB
testcase_36 AC 3,897 ms
23,172 KB
testcase_37 AC 1,218 ms
23,924 KB
testcase_38 AC 3,827 ms
23,164 KB
testcase_39 AC 94 ms
16,040 KB
testcase_40 AC 95 ms
16,168 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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
  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