Twenty-four
来源:互联网 发布:詹姆斯每个赛季数据 编辑:程序博客网 时间:2024/04/28 18:22
Description
There are 8 cards :1 1 2 2 3 3 4 4, you need to find out how many ways are there to choose 4 cards and these 4 cards can be used to play the game twenty-four. Attention, there is no difference between cards with the same number, 1 2 2 3 and 1’ 2 2 3 will be regarded as one solution, etc.
Hint: twenty-four is a game in which you are given 4 cards marked with numbers, and you may use +, -, * to connect all the four cards and make the result to be 24.
Input
No input in this problem.
Output
Output the result in one line.
Sample Input
Sample Output
It’s what you need to output. :)
这个题目不知道要不要贴上来。。。为了水经验还是写上来吧。太坑了。题意:有八张卡牌,任取四张通过+。-。*三种运算使结果等于24即可,问有多少种取法。任意两张相同数值卡牌视为同一种...
我最开始就直接枚举,然后一个个看能不能满足24.毕竟24=24*1=12*2=8*3=6*4。很简单能够套出答案有13种。马上输出13空行。提交。结果Wa了。为什么!!!然后我以为我理解错了,求解大神...fushihui大神马上指明一条“明路”--不能有括号?晕。反正最后答案还是出来了,是13!!!没有空行。还是太年轻了。
cout<<13<<endl;
0 0
- Twenty-four
- csu1600: Twenty-four point
- Twenty-four point CSU
- CSU1600:Twenty-four point(DFS)
- CSU 1600: Twenty-four point
- CSU 1600 Twenty-four point
- 武大网络预赛 Problem 1545 - I - Twenty-four
- 武大邀请赛网络赛 I Twenty-four
- CSUOJ 1600 Twenty-four point (判断24点,另附给出表达式版)
- Contest2079 - 湖南多校对抗赛(2015.05.03) Problem A: Twenty-four point
- four:
- four
- four
- Twenty-fourpoint
- 我的twenty five
- HOJ 1610 Twenty Questions
- UVALive 4643 Twenty Questions
- UVA 1252 Twenty Questions
- 一直在路上
- windows函数钩子实现
- throw 和 throws 的区别
- BNU10782被诅咒的代码
- hdu 1575(矩阵快速幂)
- Twenty-four
- 01背包问题2
- PowerDesigner15/16中 Inheritance、Association、Association Link无法使用的解决
- OpenGL环境配置(VS2012)
- 利用鼠标键盘钩子截获密码。
- boost库的常用组件的使用
- Ubuntu 下的环境变量
- 【CentOS笔记】CentOS在线安装Git
- Cortex A8,PWM裸机程序