結果

問題 No.202 1円玉投げ
ユーザー gigurururugigurururu
提出日時 2015-05-04 09:13:12
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,047 ms / 5,000 ms
コード長 318 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 11,268 KB
実行使用メモリ 53,932 KB
最終ジャッジ日時 2023-08-23 22:16:45
合計ジャッジ時間 24,091 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,007 ms
53,932 KB
testcase_01 AC 948 ms
52,220 KB
testcase_02 AC 215 ms
38,624 KB
testcase_03 AC 215 ms
38,728 KB
testcase_04 AC 218 ms
38,808 KB
testcase_05 AC 288 ms
43,796 KB
testcase_06 AC 833 ms
52,180 KB
testcase_07 AC 924 ms
52,316 KB
testcase_08 AC 944 ms
52,408 KB
testcase_09 AC 613 ms
51,408 KB
testcase_10 AC 406 ms
50,700 KB
testcase_11 AC 554 ms
51,548 KB
testcase_12 AC 587 ms
51,468 KB
testcase_13 AC 425 ms
50,760 KB
testcase_14 AC 300 ms
45,108 KB
testcase_15 AC 599 ms
51,692 KB
testcase_16 AC 910 ms
52,132 KB
testcase_17 AC 937 ms
52,456 KB
testcase_18 AC 927 ms
52,128 KB
testcase_19 AC 624 ms
51,700 KB
testcase_20 AC 795 ms
52,124 KB
testcase_21 AC 584 ms
51,540 KB
testcase_22 AC 234 ms
39,336 KB
testcase_23 AC 232 ms
39,380 KB
testcase_24 AC 232 ms
39,316 KB
testcase_25 AC 231 ms
39,196 KB
testcase_26 AC 233 ms
39,236 KB
testcase_27 AC 231 ms
39,144 KB
testcase_28 AC 230 ms
39,304 KB
testcase_29 AC 231 ms
39,388 KB
testcase_30 AC 231 ms
39,396 KB
testcase_31 AC 231 ms
39,200 KB
testcase_32 AC 232 ms
39,200 KB
testcase_33 AC 231 ms
39,176 KB
testcase_34 AC 236 ms
39,372 KB
testcase_35 AC 963 ms
53,744 KB
testcase_36 AC 1,047 ms
53,812 KB
testcase_37 AC 977 ms
52,408 KB
testcase_38 AC 971 ms
53,768 KB
testcase_39 AC 221 ms
38,780 KB
testcase_40 AC 218 ms
38,764 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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