题解 | #碰撞的蚂蚁#
碰撞的蚂蚁
http://www.nowcoder.com/practice/83073edaa76b4d179ee0366518a58dba
# -*- coding:utf-8 -*-
import math
class Ants:
def antsCollision(self, n):
# write code here
return 1 - math.pow(0.5, n-1)
碰撞的蚂蚁
http://www.nowcoder.com/practice/83073edaa76b4d179ee0366518a58dba
# -*- coding:utf-8 -*-
import math
class Ants:
def antsCollision(self, n):
# write code here
return 1 - math.pow(0.5, n-1)
相关推荐