ural 2012 About Grisha N.(水)】的更多相关文章

2012. About Grisha N. Time limit: 1.0 secondMemory limit: 64 MB Grisha N. told his two teammates that he was going to solve all given problems at the subregional contest, even if the teammates wouldn’t show up at the competition. The teammates didn’t…
Problem Grisha N. told his two teammates that he was going to solve all given problems at the subregional contest, even if the teammates wouldn't show up at the competition. The teammates didn't believe Grisha so he told them the plan how he was goin…
The problem is so easy, that the authors were lazy to write a statement for it! Input The input stream contains a set of integer numbers Ai (0 ≤ Ai ≤ 10^18). The numbers are separated by any number of spaces and line breaks. A size of the input strea…
题目传送门 /* 题意:一个圈,每个点有怪兽,每一次射击能消灭它左右和自己,剩余的每只怪兽攻击 搜索水题:sum记录剩余的攻击总和,tot记录承受的伤害,当伤害超过ans时,结束,算是剪枝吧 回溯写挫了,程序死循环,跑不出来.等回溯原理搞清楚了,下次自己重写一遍:) */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> #include <iostre…
水题一个,代码挫了一下: 题意不好理解. 你去一个洞窟内探险,洞窟内有许多宝石,但都有魔法守护,你需要用魔法将它们打下来. 每个宝石都有自己的防御等级,当你的魔法超过它的防御等级时它就会被你打下来. 但是,当它被你打下来的时候,它会反弹你的魔法.如果反弹的魔法过强,你就会被自己的魔法杀死. 很不幸的是,你的魔法是群体性的,你不能选择攻击谁,只要防御等级低于你魔法水平的宝石都会被你打下来.并且每个都会反弹你的魔法. 你可以假设你的魔法水平无限大,但你躲避反弹的魔法的能力却并不是很强. 输入: 第一…
About Grisha N. 题目链接: http://acm.hust.edu.cn/vjudge/contest/126546#problem/A Description Grisha N. told his two teammates that he was going to solve all given problems at the quarter-finals, even if all his teammates wouldn't show up at the competiti…
ScholarshipTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=86686#problem/D Description At last the first term at the University came to its finish. Android Vasya has already passed all the exams and…
二叉树水题,特别是昨天刚做完二叉树用中序后序建树,现在来做这个很快的. 跟昨天那题差不多,BST后序遍历的特型,找到最后那个数就是根,向前找,比它小的那块就是他的左儿子,比它大的那块就是右儿子,然后递归儿子继续建树. 代码: #include <cstdio> #include <cstdlib> const int maxn = 70000; struct Node { int v; Node *l; Node *r; }; int arr[maxn]; bool flag =…
ural 2032  Conspiracy Theory and Rebranding 链接:http://acm.timus.ru/problem.aspx?space=1&num=2032 题意:给定一个三角形的三条边 (a, b, c),问是否可放在二维坐标,使得3个顶点都是整数点.若可以,输出任意一组解,否则,输出 -1. 思路:暴力枚举:以 a 为半径做第一象限的 1/4 圆, 以 b 为半径做 一.四 象限的半圆,存储整数点的解,暴力枚举 a 整数点与 b 整数点是否构成长度为 c…
HDU 2012 素数判定 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 72727    Accepted Submission(s): 25323 Problem Description 对于表达式n^2+n+41,当n在(x,y)范围内取整数值时(包括x,y)(-39<=x<y<=50),判定该表达式的值是否都为素数.…