URAL 1777 D - Anindilyakwa 暴力】的更多相关文章

D - AnindilyakwaTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87643#problem/D Description The language of Australian aborigines anindilyakwa has no numerals. No anindilyakwa can say: “I've hooked e…
Wrong Answer 思路: 1.先枚举4的全排列,即球赛的所有可能结果,一共4!=24种情况 2.对于每种情况,DFS 未确定的比赛 的结果,判断这种情况是否可达. 剪枝: 1.对于每种全排列,只需要找到一种满足这个全排列的情况即可,如果有一种情况满足,则不必再枚举其他可能. 2.因为在每种情况下,球队之间的排名已经确定了,所以在DFS的过程中,凡是不满足此排名的情况统统可以剪掉. 这样就可以少很多情况,即使在n=0的情况下也跑出了不错的效率,但是它Wrong Answer on test…
链接:  http://acm.timus.ru/problem.aspx?space=1&num=1010 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=26732#problem/E E - Discrete Function Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status Practice …
The language of Australian aborigines anindilyakwa has no numerals. No anindilyakwa can say: "I've hooked eight fishes". Instead, he says: "I've hooked as many fishes as many stones are in this pile". Professor Brian Butterworth found…
题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1104 题目大意:输入一个字符串(数字与大写字母组成),输出n,n满足此字符串为n进制时,其n进位制数能被n-1整除(n不存在时输出"No solution"(不包括双引号)). 题目好多坑点,我也是WA了好几次才A的.算法是暴力的. 1,刚开始,我怎么都想不清楚,答案就是2啊,任何数都可以被1整除啊,其实,不是这样的,比如说,123就不是2进制数,所以说,这里要找到字符串中最…
题意:给定三个数,让你放上+-*三种符号,使得他们的值最小. 析:没什么好说的,全算一下就好.肯定用不到加,因为是非负数. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #include <iostream>…
原题链接:http://acm.timus.ru/problem.aspx?space=1&num=1780 1780. Gray Code Time limit: 0.5 secondMemory limit: 64 MB Denis, Vanya and Fedya gathered at their first team training. Fedya told them that he knew the algorithm for constructing aGray code. Cre…
http://acm.timus.ru/problem.aspx?space=1&num=2064 题意:有n只虫子在爬树,每个虫子往上爬ti距离后会往下掉落ti距离,每爬一个单位距离耗费一个单位时间,然后重新往上爬.有q个询问,询问当前的x时刻,爬的最高的虫子所在的最高位置. 思路:画个以时间为x轴,距离为y轴的图,可以清楚知道整个图是类似于一座座山峰的.我们只要处理每个时刻的最高点. 只考虑最高点所在的位置,处理出虫子能达到的最高点的时刻的最高点arrive[]. 考虑每个时刻要得到最优的两…
2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and each orders a juice cocktail. It could be from 1 to 3 different juices in each cocktail. There are three juices in the bar: apple, banana and pineappl…
2062. Ambitious Experiment Time limit: 3.0 secondMemory limit: 128 MB During several decades, scientists from planet Nibiru are working to create an engine that would allow spacecrafts to fall into hyperspace and move there with superluminal velocity…