結果

問題 No.202 1円玉投げ
ユーザー gigurururugigurururu
提出日時 2015-05-04 09:10:47
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,130 ms / 5,000 ms
コード長 318 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 11,552 KB
実行使用メモリ 43,884 KB
最終ジャッジ日時 2023-08-23 22:16:20
合計ジャッジ時間 22,682 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,117 ms
43,708 KB
testcase_01 AC 925 ms
39,016 KB
testcase_02 AC 164 ms
28,040 KB
testcase_03 AC 164 ms
28,140 KB
testcase_04 AC 164 ms
28,144 KB
testcase_05 AC 208 ms
33,708 KB
testcase_06 AC 784 ms
35,980 KB
testcase_07 AC 853 ms
35,984 KB
testcase_08 AC 851 ms
36,140 KB
testcase_09 AC 539 ms
35,888 KB
testcase_10 AC 322 ms
35,892 KB
testcase_11 AC 475 ms
35,884 KB
testcase_12 AC 480 ms
35,964 KB
testcase_13 AC 338 ms
35,920 KB
testcase_14 AC 215 ms
34,972 KB
testcase_15 AC 530 ms
35,920 KB
testcase_16 AC 965 ms
42,036 KB
testcase_17 AC 972 ms
41,992 KB
testcase_18 AC 975 ms
42,268 KB
testcase_19 AC 500 ms
35,884 KB
testcase_20 AC 705 ms
36,000 KB
testcase_21 AC 506 ms
36,160 KB
testcase_22 AC 175 ms
28,976 KB
testcase_23 AC 175 ms
28,944 KB
testcase_24 AC 174 ms
28,816 KB
testcase_25 AC 173 ms
28,760 KB
testcase_26 AC 172 ms
28,916 KB
testcase_27 AC 176 ms
29,012 KB
testcase_28 AC 173 ms
28,988 KB
testcase_29 AC 174 ms
28,812 KB
testcase_30 AC 176 ms
28,816 KB
testcase_31 AC 174 ms
28,772 KB
testcase_32 AC 176 ms
28,764 KB
testcase_33 AC 175 ms
28,932 KB
testcase_34 AC 179 ms
29,000 KB
testcase_35 AC 1,056 ms
43,772 KB
testcase_36 AC 1,130 ms
43,884 KB
testcase_37 AC 915 ms
35,880 KB
testcase_38 AC 1,067 ms
43,796 KB
testcase_39 AC 167 ms
28,160 KB
testcase_40 AC 165 ms
28,440 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
MAX=20000
DIV=40
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