acm-其他
兮兮落落_
编程小白
展开
-
Kattis - doors Doors
题目: Alex is a circle of radius RR. Well, life as a circle is not easy. If he were a point, moving around and passing through doors would be effortless. But now he has to carefully inspect the surro原创 2017-08-17 19:02:01 · 571 阅读 · 2 评论 -
HDU 6152 Friend-Graph
题意: 有一个队伍,如果队伍里有三个或三个以上的人互相认识 或者队伍里有三个或三个以上的人互相不认识,那么这个队伍为bad team, 否则为great team。 分析: 题目给出的时间充足,直接暴力一遍,复杂度O(n3)。 代码: #include #include #include #include using namespace std; bool a[3005][3005原创 2017-08-19 20:10:09 · 433 阅读 · 0 评论 -
HDU_6154 CaoHaha's staff
找规律。 先找到小于等于n的最大的菱形的面积,然后按规律慢慢扩展。没增加一条斜边,面积增大1.5 代码: #include #include #include #include #include using namespace std; const int maxn = 1e5; double s[maxn]; int main() { double x1 = 1.5,原创 2017-08-19 20:19:05 · 404 阅读 · 0 评论 -
HDU 5835 Danganronpa
题意:给你有n种礼物,第i种有ai个。现在要把这些礼物分给一排同学,要求每个人发普通礼物和神秘礼物各一个,要求相邻两人的普通礼物不能为同一种,神秘礼物没有限制,普通礼物和神秘礼物都从这n个礼物中选取。问最多能发给多少人。 贪心。(注意神秘礼物和普通礼物可以一样) 代码: #include #include #include #include #include #include原创 2017-08-15 19:48:07 · 183 阅读 · 0 评论 -
Gym 100741G Yet Another Median Task
题意: 给出一个n*n的矩阵。然后有很多操作,每次给你两个点(x1,y1)和(x2,y2),求出这两个点作为新矩阵的左上角和有下角,求出新矩阵所有值的中点。 直接暴力,用scanf输入,然后就爆过了,用cin cout会超时。 用nth_element函数。 使用方法:nth_element(start, start+n, end) 使第n大元素处于第n位置(从0开始,其原创 2017-08-24 11:03:19 · 216 阅读 · 0 评论 -
Gym 101190H Hard Refactoring
题意: 给你一些x的区间范围,有规定的输入格式,如果在(-32768 ~ 32767)范围之间的任意整数都能在x的这些区间中,则输出 “true”,如果这些范围中的部分数在x的这些区间中,则输出并合并这些区间,如果都不在,则输出“false”; 暴力。这道题注意的细节太多,wa了太多次才发现其中的坑, 注意 x >= 5 && x = 5; 还有 x >= 1 && x x原创 2017-08-29 20:15:18 · 497 阅读 · 0 评论