ural 2023 Donald is a postman(水)】的更多相关文章

2023. Donald is a postman Time limit: 1.0 secondMemory limit: 64 MB Donald Duck works as a postman for the Walt Disney Studios. He delivers children’s letters from all over the world to his friends, which are cartoon characters. The Studios has three…
Donald is a postman 题目链接: http://acm.hust.edu.cn/vjudge/contest/126546#problem/L Description Donald Duck works as a postman for the Walt Disney Studios. He delivers children's letters from all over the world to his friends, which are cartoon characte…
水题一个,代码挫了一下: 题意不好理解. 你去一个洞窟内探险,洞窟内有许多宝石,但都有魔法守护,你需要用魔法将它们打下来. 每个宝石都有自己的防御等级,当你的魔法超过它的防御等级时它就会被你打下来. 但是,当它被你打下来的时候,它会反弹你的魔法.如果反弹的魔法过强,你就会被自己的魔法杀死. 很不幸的是,你的魔法是群体性的,你不能选择攻击谁,只要防御等级低于你魔法水平的宝石都会被你打下来.并且每个都会反弹你的魔法. 你可以假设你的魔法水平无限大,但你躲避反弹的魔法的能力却并不是很强. 输入: 第一…
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…
题目传送门 /* 题意:一个圈,每个点有怪兽,每一次射击能消灭它左右和自己,剩余的每只怪兽攻击 搜索水题:sum记录剩余的攻击总和,tot记录承受的伤害,当伤害超过ans时,结束,算是剪枝吧 回溯写挫了,程序死循环,跑不出来.等回溯原理搞清楚了,下次自己重写一遍:) */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> #include <iostre…
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…
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…
题意:给定三个数,让你放上+-*三种符号,使得他们的值最小. 析:没什么好说的,全算一下就好.肯定用不到加,因为是非负数. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #include <iostream>…