注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
两题 两小时 8/5投简历 当天收到oa 8/13完成
还是之前地里的原题 并不难,就是比较繁琐 这里把题目的英文化简复述一遍
1. A robot wants to travel from source(x1,y1) to destination(x2,y2), but can only make 3 moves: (x,x+y),(x+y,x), (x+c,y+c) for given input c
It cannot travel to squares where the sum of x and y coordinate(x+y) is a perfect square.
Print "Yes" if robot ue存每条道路上的车和他的到达时间,一个counter记录当前时间,还有一个prev_car记录之前的车在哪条街上。判断两条街的哪辆车来的更早,如果同时来就用题里的规则就行,然后如果当前时间大于到达时间,则需要把queue里第一辆车的时间更新为到达时间。记得时间
和prev car规则不要出错。
imc说test case过了之后会有人看code style 所以写的时候多注意一下style lz在写的时候加了comment,尤其第二题,这样防止自己脑子乱。
求米 |