Submission #20013918
Source Code Expand
Copy
U = 10000X,Y,R,RR = gets.split.map{|_|i,f = _.split ?.(i+"#{f}0000"[0,4]).to_i}.then{|x,y,r|x -= (x-r)/U*U if x<ry -= (y-r)/U*U if y<rnext x,y,r,r*r}p ((R-X)/U*-U).step(X+R,U).sum{|x|y = Integer.sqrt(RR-(x-X)**2)(y-Y)/U+(Y+y)/U+1}
U = 10000 X,Y,R,RR = gets.split.map{|_| i,f = _.split ?. (i+"#{f}0000"[0,4]).to_i }.then{|x,y,r| x -= (x-r)/U*U if x<r y -= (y-r)/U*U if y<r next x,y,r,r*r } p ((R-X)/U*-U).step(X+R,U).sum{|x| y = Integer.sqrt(RR-(x-X)**2) (y-Y)/U+(Y+y)/U+1 }
Submission Info
Submission Time | |
---|---|
Task | D - Circle Lattice Points |
User | ds14050 |
Language | Ruby (2.7.1) |
Score | 400 |
Code Size | 265 Byte |
Status | AC |
Exec Time | 125 ms |
Memory | 14404 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | extreme_00.txt, extreme_01.txt, extreme_02.txt, extreme_03.txt, handmade_00.txt, handmade_01.txt, handmade_02.txt, handmade_marginal_00.txt, handmade_marginal_01.txt, handmade_marginal_02.txt, handmade_marginal_03.txt, handmade_marginal_04.txt, handmade_marginal_05.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_integer_00.txt, random_integer_01.txt, random_integer_02.txt, random_integer_03.txt, random_integer_04.txt, random_integer_05.txt, random_integer_06.txt, random_integer_07.txt, random_integer_08.txt, random_integer_09.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
extreme_00.txt | AC | 122 ms | 14088 KB |
extreme_01.txt | AC | 124 ms | 14360 KB |
extreme_02.txt | AC | 119 ms | 14180 KB |
extreme_03.txt | AC | 125 ms | 13976 KB |
handmade_00.txt | AC | 70 ms | 14056 KB |
handmade_01.txt | AC | 69 ms | 13972 KB |
handmade_02.txt | AC | 70 ms | 14224 KB |
handmade_marginal_00.txt | AC | 122 ms | 14164 KB |
handmade_marginal_01.txt | AC | 121 ms | 14348 KB |
handmade_marginal_02.txt | AC | 125 ms | 14312 KB |
handmade_marginal_03.txt | AC | 122 ms | 14396 KB |
handmade_marginal_04.txt | AC | 121 ms | 14100 KB |
handmade_marginal_05.txt | AC | 122 ms | 14300 KB |
random_00.txt | AC | 108 ms | 14076 KB |
random_01.txt | AC | 75 ms | 14084 KB |
random_02.txt | AC | 117 ms | 14148 KB |
random_03.txt | AC | 90 ms | 14200 KB |
random_04.txt | AC | 105 ms | 14340 KB |
random_05.txt | AC | 68 ms | 14192 KB |
random_06.txt | AC | 116 ms | 14164 KB |
random_07.txt | AC | 81 ms | 14236 KB |
random_08.txt | AC | 98 ms | 14308 KB |
random_09.txt | AC | 123 ms | 14092 KB |
random_10.txt | AC | 118 ms | 14080 KB |
random_11.txt | AC | 87 ms | 14212 KB |
random_12.txt | AC | 94 ms | 14236 KB |
random_13.txt | AC | 117 ms | 14260 KB |
random_14.txt | AC | 105 ms | 14064 KB |
random_15.txt | AC | 85 ms | 14192 KB |
random_16.txt | AC | 85 ms | 14324 KB |
random_17.txt | AC | 114 ms | 14216 KB |
random_18.txt | AC | 103 ms | 14144 KB |
random_19.txt | AC | 73 ms | 14364 KB |
random_integer_00.txt | AC | 95 ms | 14404 KB |
random_integer_01.txt | AC | 82 ms | 14056 KB |
random_integer_02.txt | AC | 112 ms | 13988 KB |
random_integer_03.txt | AC | 97 ms | 14164 KB |
random_integer_04.txt | AC | 87 ms | 14152 KB |
random_integer_05.txt | AC | 75 ms | 14324 KB |
random_integer_06.txt | AC | 98 ms | 14144 KB |
random_integer_07.txt | AC | 91 ms | 14032 KB |
random_integer_08.txt | AC | 79 ms | 14104 KB |
random_integer_09.txt | AC | 122 ms | 14052 KB |
sample_01.txt | AC | 67 ms | 14232 KB |
sample_02.txt | AC | 68 ms | 14156 KB |
sample_03.txt | AC | 123 ms | 14212 KB |