A. Buses Between Cities 题目连接: http://www.codeforces.com/contest/665/problem/A Description Buses run between the cities A and B, the first one is at 05:00 AM and the last one departs not later than at 11:59 PM. A bus from the city A departs every a mi…
题意: 从A到B的汽车每隔 a 分钟发车一次,从A到B要ta分钟. 从B到A汽车每隔b分钟发车一次,从B到A要ta分钟. Simion从A出发,问他在A->B的途中共遇到了多少辆车. 汽车都是从上午5.00出发,最晚到晚上11.59. 思路: 这种CF题模拟模拟!!!讲道理模拟题的能力好弱啊!!! 直接就是从5:00到11:59模拟一发,然后中间只会有两种可能,一个是那个人还没出去之前,一个是那个人出去了以后,车子在路上. 然后就是纯模拟就可以了,但是模拟的条件,还是靠感觉写的好啊 #inclu…
A. Fashion in Berland 题目连接: http://www.codeforces.com/contest/691/problem/A Description According to rules of the Berland fashion, a jacket should be fastened by all the buttons except only one, but not necessarily it should be the last one. Also if…
C. Joty and Chocolate 题目连接: http://www.codeforces.com/contest/678/problem/C Description Little Joty has got a task to do. She has a line of n tiles indexed from 1 to n. She has to paint them in a strange pattern. An unpainted tile should be painted R…
A. The Text Splitting 题目连接: http://www.codeforces.com/contest/612/problem/A Description You are given the string s of length n and the numbers p, q. Split the string s to pieces of length p and q. For example, the string "Hello" for p = 2, q = 3…
B. The Best Gift 题目连接: http://www.codeforces.com/contest/609/problem/B Description Emily's birthday is next week and Jack has decided to buy a present for her. He knows she loves books so he goes to the local bookshop, where there are n books on sale…
A. USB Flash Drives 题目连接: http://www.codeforces.com/contest/609/problem/A Description Sean is trying to save a large file to a USB flash drive. He has n USB flash drives with capacities equal to a1, a2, ..., an megabytes. The file size is equal to m…
D. Iterated Linear Function 题目连接: http://www.codeforces.com/contest/678/problem/D Description Consider a linear function f(x) = Ax + B. Let's define g(0)(x) = x and g(n)(x) = f(g(n - 1)(x)) for n > 0. For the given integer values A, B, n and x find t…
B. The Same Calendar 题目连接: http://www.codeforces.com/contest/678/problem/B Description The girl Taylor has a beautiful calendar for the year y. In the calendar all days are given with their days of week: Monday, Tuesday, Wednesday, Thursday, Friday,…
A. Johny Likes Numbers 题目连接: http://www.codeforces.com/contest/678/problem/A Description Johny likes numbers n and k very much. Now Johny wants to find the smallest integer x greater than n, so it is divisible by the number k. Input The only line con…