Submission #8163914


Source Code Expand

Copy
def check(mid,a,b,x,border)
  if mid <= border 
    area = a*b - a*(a*Math.tan(mid/180.0*Math::PI))/2.0
  else
    area = b*(b*Math.tan((90.0-mid)/180.0*Math::PI))/2.0
  end
  #p [mid,a,b,x,border,area,x/a]
  return x/a < area
end

def bsearch(a,b,x)
  ok,ng = 0.0, 90
  border = Math.atan2(a,b)/(Math::PI)*180.0
  #p border
  mid = 45.0
  1000.times do
    mid = (ok+ng)/2.0
    if check(mid,a,b,x,border)
      ok = mid
    else
      ng = mid
    end
  end
  return mid
end

a,b,x = gets.split.map(&:to_f)
p bsearch(a,b,x)

Submission Info

Submission Time
Task D - Water Bottle
User rinzu
Language Ruby (2.3.3)
Score 0
Code Size 552 Byte
Status WA
Exec Time 8 ms
Memory 1788 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 3
AC × 12
WA × 3
Set Name Test Cases
Sample sample00, sample01, sample02
All handmade03, handmade04, random05, random06, random07, random08, random09, random10, random11, random12, random13, random14, sample00, sample01, sample02
Case Name Status Exec Time Memory
handmade03 AC 8 ms 1788 KB
handmade04 AC 7 ms 1788 KB
random05 WA 7 ms 1788 KB
random06 WA 7 ms 1788 KB
random07 AC 7 ms 1788 KB
random08 AC 7 ms 1788 KB
random09 AC 7 ms 1788 KB
random10 WA 7 ms 1788 KB
random11 AC 7 ms 1788 KB
random12 AC 7 ms 1788 KB
random13 AC 7 ms 1788 KB
random14 AC 7 ms 1788 KB
sample00 AC 7 ms 1788 KB
sample01 AC 7 ms 1788 KB
sample02 AC 7 ms 1788 KB