第九届山东理工大学ACM网络编程擂台赛 正式赛 sdut4080 UMR's dress
2017-11-21 22:18
363 查看
题目链接
Time Limit: 1000MS Memory
Limit: 65536KB
UMR worries if she should wear her dress today, so that she decided to throw dice to decide whether to wear her dress or not. UMR has three dices and she will throw dice twice. Because she has three dices, she makes
an unusual rule of the dice point.
1、if there are two dice points which are the same, the point of these three dice is the point of the third dice
2、if there are three dice points are the same, it is a miraculous point. The point of these three dice equals the point of each dice. Miraculous point is bigger than the point of two dices which are the same.
3、if all dices are diffirent, the point of these three dice is 0.
If the first throw more points than the second, she will put on her dress. If the second throw more point than than the first, she will not put on her dress. If the points of twice throw are the same, she will try
again.
There are several cases of input, ending up with EOF.
For each case there is one line of input with six integers x1, x2, x3, y1, y2, y3
(1<= x1,x2,x3,y1,y2,y3 <= 6), x1, x2, x3 means the point of first throw, y1,y2,y3 means the point of second throw.
There are one line of output. If UMR will put on her dress, print"Put on my dress.". If not, print“What a pity.”. If she will try again, print“Let me try again.”
玄黄
思路:签到题,看懂题就没什么大难度,3个骰子点数都不同时点数为0,2个点数相同时点数为第三个,3个点数都相同时点数比2个点数相同时要大,可以把他多加6(或更大的数)或乘7(或更大的数)来处理
Time Limit: 1000MS Memory
Limit: 65536KB
Problem Description
UMR worries if she should wear her dress today, so that she decided to throw dice to decide whether to wear her dress or not. UMR has three dices and she will throw dice twice. Because she has three dices, she makesan unusual rule of the dice point.
1、if there are two dice points which are the same, the point of these three dice is the point of the third dice
2、if there are three dice points are the same, it is a miraculous point. The point of these three dice equals the point of each dice. Miraculous point is bigger than the point of two dices which are the same.
3、if all dices are diffirent, the point of these three dice is 0.
If the first throw more points than the second, she will put on her dress. If the second throw more point than than the first, she will not put on her dress. If the points of twice throw are the same, she will try
again.
Input
There are several cases of input, ending up with EOF.For each case there is one line of input with six integers x1, x2, x3, y1, y2, y3
(1<= x1,x2,x3,y1,y2,y3 <= 6), x1, x2, x3 means the point of first throw, y1,y2,y3 means the point of second throw.
Output
There are one line of output. If UMR will put on her dress, print"Put on my dress.". If not, print“What a pity.”. If she will try again, print“Let me try again.”
Example Input
4 5 6 2 2 1 1 1 1 6 5 5 3 1 1 5 3 5
Example Output
What a pity. Put on my dress. Let me try again.
Author
玄黄思路:签到题,看懂题就没什么大难度,3个骰子点数都不同时点数为0,2个点数相同时点数为第三个,3个点数都相同时点数比2个点数相同时要大,可以把他多加6(或更大的数)或乘7(或更大的数)来处理
#include <stdio.h> int f(int a,int b,int c) { if(a!=b&&a!=c&&b!=c) return -1; if(a==b&&a==c&&b==c) return 10*a; if(a==b&&a!=c) return c; if(a==c&&a!=b) return b; if(b==c&&b!=a) return a; } int main() { int x1,x2,x3,y1,y2,y3; while(~scanf("%d%d%d%d%d%d",&x1,&x2,&x3,&y1,&y2,&y3)) { int u1 = f(x1,x2,x3); int u2 = f(y1,y2,y3); if(u1>u2) printf("Put on my dress.\n"); else if(u1==u2) printf("Let me try again.\n"); else printf("What a pity.\n"); } return 0; }
相关文章推荐
- 第九届山东理工大学ACM网络编程擂台赛 正式赛 sdut4082 帮“绝艺”数气II
- 第九届山东理工大学ACM网络编程擂台赛 正式赛 sdut4075GCD - ldq的黑心啤酒厂
- 第九届山东理工大学ACM网络编程擂台赛 F题题解
- 第五届山东理工大学ACM网络编程擂台赛
- “师创杯”山东理工大学第九届ACM程序设计竞赛 正式赛 G.打字【Dp+贪心】水题
- “师创杯”山东理工大学第九届ACM程序设计竞赛 正式赛 F.校赛~校赛~【思维+规律题】
- “师创杯”SDUT-ACM校赛正式赛-从零开始的异世界生活
- “师创杯”山东理工大学第九届ACM程序设计竞赛 正式赛 I.皮卡丘的梦想2【树状数组】水题
- 『NYIST』第九届河南省ACM竞赛队伍选拔赛[正式赛二]--Codeforces -35D. Animals
- “师创杯”山东理工大学第九届ACM程序设计竞赛 正式赛【9/10】
- 『NYIST』第九届河南省ACM竞赛队伍选拔赛[正式赛二]- Nearly Lucky Number(Codeforces Beta Round #84 (Div. 2 Only)A. Nearly)
- 第九届ACM趣味程序设计竞赛第二场(正式赛) B - 绿帽自动机【思维】
- ACM学习历程—NPU 2015年陕西省程序设计竞赛网络预赛(正式赛)A题 小女警的异世界之战(dfs && 分治)
- ACM学习历程—NPU1086 随机数 2015年陕西省程序设计竞赛网络预赛(正式赛)C题 (计数排序 || set容器)
- ACM学习历程—NPU 2015年陕西省程序设计竞赛网络预赛(正式赛)E题 简单题(同余 && 快速幂)
- ACM学习历程—NPU 2015年陕西省程序设计竞赛网络预赛(正式赛)F题 和谐的比赛(递推)
- 『NYIST』第九届河南省ACM竞赛队伍选拔赛[正式赛二]-最小内积(第八届北京师范大学程序设计竞赛决赛)
- 师创杯”山东理工大学第九届ACM程序设计竞赛(网络同步赛)--I皮卡丘的梦想2
- “师创杯”SDUT-ACM校赛正式赛-C~K玩游戏
- sdut 第三届ACM/ICPC程序设计知识竞赛网络赛 字符串拓展