Piles-With-Stones
Codeforces Round #500 (Div. 2)
题目链接:Piles With Stones
Codeforces Round #500 (Div. 2)
题目链接:Piles With Stones
在线算法是指它可以以序列化的方式一个个的处理输入,也就是说在开始时并不需要已经知道所有的输入。
大家一定觉的运动以后喝可乐是一件很惬意的事情,但是 seeyou 却不这么认为。因为每次当 seeyou 买了可乐以后,阿牛就要求和 seeyou 一起分享这一瓶可乐,而且一定要喝的和 seeyou 一样多。但 seeyou 的手中只有两个杯子,它们的容量分别是 N 毫升和 M 毫升 可乐的体积为 S(S<101)毫升(正好装满一瓶) ,它们三个之间可以相互倒可乐(都是没有刻度的,且 S==N+M,101 > S > 0,N > 0,M > 0) 。聪明的 ACMER 你们说他们能平分吗?如果能请输出倒可乐的最少的次数,如果不能输出"NO"。
圣诞节要到了,坤神和瑞瑞这对基佬想一起去召唤师大峡谷开开车。百度地图一下,发现周围的召唤师大峡谷还不少,这对基佬纠结着,该去哪一个。坤神:我要去左边的这个(因为离自己比较近 哈哈~)。瑞瑞:我要去右边的这个(因为离自己比较近 嘿嘿~) …….. 这对基佬闹矛盾了,开车有危险了!为了不让他们去召唤师大峡谷坑人,riot 决定让他们去 X 召唤师大峡谷,保证他俩所走的路程和最短。每走一个点需要花费 11 分钟,输出他们一共花费多少时间(最短时间噢)
Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,000) on the same number line. Farmer John has two modes of transportation: walking and teleporting.
If the cow, unaware of its pursuit, does not move at all, how long does it take for Farmer John to retrieve it?
Line 1: Two space-separated integers: N and K
Time Limit: 1000MS Memory Limit: 10000K
Total Submissions: 40713 Accepted: 17088 Special Judge
Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there is a corresponding m containing no more than 100 decimal digits.