ACM新手上路
文章平均质量分 56
Damon_C
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
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 · 568 阅读 · 0 评论 -
cin>>a做为判断语句在循环结构和条件结构中的应用
int a;while(cin>>a){ ···} 这时如果从键盘输入的为int类型的数据,则“cin>>a”这条语句返回a的地址,因为a的地址在计算机中不为0,因此,遇到判断语句时,就判断”真“。当输入的数据类型不为int型时,其返回值为0,表示“假”。 关键这种判断条件对我们造成的困扰在于,但我们想在其后继续输入数据时,却无法输入。 例如:int a;原创 2017-09-28 22:46:34 · 1014 阅读 · 0 评论 -
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 · 451 阅读 · 0 评论 -
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 · 574 阅读 · 0 评论 -
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 · 346 阅读 · 0 评论 -
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 · 459 阅读 · 0 评论 -
{A} + {B}
Question 给你两个集合,要求{A} + {B}. 注:同一个集合中不会有两个相同的元素.Input 每组输入数据分为三行,第一行有两个数字n,m(0<,n,m<=10000),分别表示集合A和集合B的元素个数.后两行分别表示集合A和集合B.每个元素为不超出int范围的整数,每个元素之间有一个空格隔开.Output 针对每组数据输出一行数据,表示合并后的集合,要求从小到原创 2017-07-28 11:06:05 · 481 阅读 · 0 评论 -
全排列函数next_permutation与prev_permutation
全排列函数next_permutation与prev_permutation原创 2017-07-26 17:04:31 · 894 阅读 · 0 评论 -
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 · 732 阅读 · 0 评论 -
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 · 421 阅读 · 0 评论 -
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 · 395 阅读 · 0 评论 -
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 · 454 阅读 · 0 评论 -
杨辉三角
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 · 10221 阅读 · 0 评论 -
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 · 679 阅读 · 0 评论 -
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 · 3324 阅读 · 0 评论 -
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 · 611 阅读 · 0 评论
分享