Advertisement
Guest User

ニシキヘビ

a guest
Dec 20th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. ans = []
  2.  
  3. 0.step(10, 0.1) do |x|
  4. -10.step(0, 0.1) do |y|
  5. -10.step(10, 0.1) do |z|
  6. a= x+y-z-2
  7. b= 3*x+4*y+z-6
  8. c = 5-(x-2*y+3*z).abs
  9.  
  10. if a >0 and b >0 and c >0 then
  11. ans << 7*x-y+z-4
  12. end
  13. end
  14. end
  15. end
  16.  
  17. print ans.min
  18.  
  19. ------------------------
  20. 答え:10.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement