Description Math Olympiad is called “Aoshu” in China. Aoshu is very popular in elementary schools. Nowadays, Aoshu is getting more and more difficult. Here is a classic Aoshu problem: ABBDE __ ABCCC = BDBDEIn the equation above, a letter stands for a…
题意:题意:给你3个字符串s1,s2,s3;要求对三个字符串中的字符赋值(同样的字符串进行同样的数字替换), 替换后的三个数进行四则运算要满足左边等于右边.求有几种解法. Sample Input 2 A A A BCD BCD B   Sample Output 5 72 eg:ABBDE   ABCCC   BDBDE :令 A = 1, B = 2, C = 0, D = 4, E = 5 12245 + 12000 = 24245: 注意没有前导零! ! #include<stdio.h…
题目链接:pid=3131">HDU 3131 One-Two-Five! (暴力搜索) 题意:给出一串数字,要求用加,减,乘,除(5/2=2)连接(计算无优先级:5+3*6=8*6=48),求全部结果中,含有'3'且该数字出现频率最大.若频率相等,输出数字最大的. 暴力解决之 AC代码: #include <stdio.h> #include <map> #include <string.h> #include <algorithm> #d…
Description Math Olympiad is called “Aoshu” in China. Aoshu is very popular in elementary schools. Nowadays, Aoshu is getting more and more difficult. Here is a classic Aoshu problem: ABBDE __ ABCCC = BDBDE In the equation above, a letter stands for…
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=4740 [题意]: 森林里有一只驴和一只老虎,驴和老虎互相从来都没有见过,各自自己走过的地方不能走第二次,都会朝着一个方向走,直到这个方向不能走,然后转向,驴只会右转,老虎只会左转,当转过一次之后还是不能往前走,那么它就停下来不再移动了...问驴和老虎是否能相遇在一个坐标点... [题解]: 暴力搜索,模拟过程就能过,不存在超时问题 [code]: /* JudgeStatus:Accepted ti…
速算24点 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Problem Description 速算24点相信绝大多数人都玩过.就是随机给你四张牌,包括A(1),2,3,4,5,6,7,8,9,10,J(11),Q(12),K(13).要求只用'+','-','*','/'运算符以及括号改变运算顺序,使得最终运算结果为24(每个数必须且仅能用一次).游戏很简单,但遇到无解的…
A very hard Aoshu problem Problem Description Aoshu is very popular among primary school students. It is mathematics, but much harder than ordinary mathematics for primary school students. Teacher Liu is an Aoshu teacher. He just comes out with a pro…
枚举等号的位置,然后暴力搜索一波 这个题本身不难,但它是我第一次使用对拍程序来查找错误,值得纪念. #include<cstdio> #include<string.h> #include<map> #include<algorithm> #define inf 0x3f3f3f3f ; using namespace std; typedef pair<int,int> P; int len,d,b,c,ans; ]; map<P,int…
UVa 129 Krypton Factor 注意输出格式,比较坑爹. 每次要进行处理去掉容易的串,统计困难串的个数. #include<iostream> #include<vector> #include<cmath> #include<map> #include<algorithm> #include<cstring> #include<cstdio> #include<cstdlib> #include…
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=4403 A very hard Aoshu problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1080    Accepted Submission(s): 742 Problem Description Aoshu is ver…