- 博客(16)
- 收藏
- 关注
原创 Number Sequence
Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n).InputT...
2018-04-05 14:42:37 517
原创 cin>>a做为判断语句在循环结构和条件结构中的应用
int a;while(cin>>a){ ···} 这时如果从键盘输入的为int类型的数据,则“cin>>a”这条语句返回a的地址,因为a的地址在计算机中不为0,因此,遇到判断语句时,就判断”真“。当输入的数据类型不为int型时,其返回值为0,表示“假”。 关键这种判断条件对我们造成的困扰在于,但我们想在其后继续输入数据时,却无法输入。 例如:int a;
2017-09-28 22:46:34 811
原创 Battle City(bfs)
Question Many of us had played the game “Battle city” in our childhood, and some people (like me) even often play it on computer now. What we are discussing is a simple edition of this game. Give
2017-08-16 19:43:40 332
原创 Pots (bfs)
Question You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: 1.FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap; 2
2017-08-15 17:07:21 369
原创 Open the Lock(bfs)
Question Now an emergent task for you is to open a password lock. The password is consisted of four digits. Each digit is numbered from 1 to 9. Each time, you can add or minus 1 to any digit. Whe
2017-08-14 17:08:16 482
原创 Catch That Cow(bfs)
Question 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 ≤
2017-08-10 15:03:43 313
原创 The Meeting Place Cannot Be Changed
Question The main road in Bytecity is a straight line from south to north. Conveniently, there are coordinates measured in meters from the southernmost building in north direction. At some points
2017-08-03 16:02:26 356
原创 UmBasketella(三分算法解决单峰问题)
Question In recent days, people always design new things with multifunction. For instance, you can not only use cell phone to call your friends, but you can also use your cell phone take photographs
2017-08-02 14:15:57 561
原创 Pie(用acos(-1)来求pi,精度较高)
Question My birthday is coming up and traditionally I’m serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party an
2017-08-01 14:25:25 3174
原创 upper_bound(a,a+n,k)函数求出的值就表示的是指向满足ai>k的ai的最小指针
Question You are given two arrays of integers a and b. For each element of the second array bj you should find the number of elements in array a that are less than or equal to the value bj.Input T
2017-07-31 19:46:08 481
原创 Misha and Changing Handles
Question Misha hacked the Codeforces site. Then he decided to let all the users change their handles. A user can now change his handle any number of times. But each new handle must not be equal to an
2017-07-29 00:22:13 284
原创 Summary
Question Small W is playing a summary game. Firstly, He takes N numbers. Secondly he takes out every pair of them and add this two numbers, thus he can get N*(N - 1)/2 new numbers. Thirdly he deletes
2017-07-29 00:06:07 313
原创 {A} + {B}
Question 给你两个集合,要求{A} + {B}. 注:同一个集合中不会有两个相同的元素.Input 每组输入数据分为三行,第一行有两个数字n,m(0<,n,m<=10000),分别表示集合A和集合B的元素个数.后两行分别表示集合A和集合B.每个元素为不超出int范围的整数,每个元素之间有一个空格隔开.Output 针对每组数据输出一行数据,表示合并后的集合,要求从小到
2017-07-28 11:06:05 390
原创 全排列函数next_permutation与prev_permutation
全排列函数next_permutation与prev_permutation
2017-07-26 17:04:31 737
原创 Code obfuscation
Question Kostya likes Codeforces contests very much. However, he is very disappointed that his solutions are frequently hacked. That’s why he decided to obfuscate (intentionally make less readable) h
2017-07-26 15:57:17 623
原创 杨辉三角
Question 还记得中学时候学过的杨辉三角吗?具体的定义这里不再描述,你可以参考以下的图形: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 Input 输入数据包含多个测试实例,每个测试实例的输入只包含一个正整数n(1Output 对应于每一个输入,请输出相应层数的杨辉
2017-07-25 15:22:50 9984
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人