- 博客(6)
- 收藏
- 关注
原创 计算几何ACM——一些代码整理
实数的gcddouble gcd(double x,double y){ while(fabs(x)>eps && fabs(y)>eps)//此处的eps根据需要取 { if(x>y) x-=floor(x/y)*y; else y-=floor(y/x)*x; } return x+
2017-06-27 19:55:43 1140
原创 Uva207 PGA Tour Prize Money
题目我就不放了,这是一道和师兄帮帮忙 同等恶心的难题。。。首先udebug的数据是有问题的,不符合题目描述。当然我们可以修改写法使得udebug的数据能够过。然后,udebug的数据不全,有几个重要的问题它没有显现出来,分别是:1。如果一个人是业余选手,那么在输出了总分之后就要换行,不能有多余空格。2.。如果是最后一组样例,输出完成后,不应该输出换行符。3.重要!题目的最后一句
2017-06-23 20:13:21 944
原创 C++ 求两个集合的交集和并集
看紫书看到的先学会用法吧,具体的以后看C++ Primer#includeusing namespace std;set s1{1,2,3,5};set s2{5,7,9};int main(void){ vector ANS; set_union(s1.begin(),s1.end(),s2.begin(),s2.end(),inserter(ANS,ANS.b
2017-06-18 22:23:26 25313 1
原创 Codeforces 797E Array Queries
题目a is an array of n positive integers, all of which are not greater than n.You have to process q queries to this array. Each query is represented by two numbers p and k. Several operations are perform
2017-06-18 11:53:57 289
原创 Codeforces 797C Minimal String 贪心
题目:Petya recieved a gift of a string s with length up to 105 characters for his birthday. He took two more empty strings t and u and decided to play a game. This game has two possible moves:Extract the
2017-06-17 21:12:03 455
转载 快速确定linux下long long最大值
#define INT_MAX ((int)(~0U>>1))2 #define INT_MIN (-INT_MAX - 1)3 #define UINT_MAX (~0U)4 #define LONG_MAX ((long)(~0UL>>1))5 #define LONG_MIN (-LONG_MAX - 1)6 #define ULONG_MAX (~0UL)7 #define L
2017-06-17 09:13:13 2860
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人