CodeForces 501A Contest
2016-07-20 17:09
363 查看
F - Contest
Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d
& %I64u
Submit Status Practice CodeForces
501A
Appoint description:
System Crawler (Jul 17, 2016 1:03:54 PM)
Description
Misha and Vasya participated in a Codeforces contest. Unfortunately, each of them solved only one problem, though successfully submitted it at the first attempt. Misha solved the problem that costs a points
and Vasya solved the problem that costs b points. Besides, Misha submitted the problem c minutes after the contest started and
Vasya submitted the problem d minutes after the contest started. As you know, on Codeforces the cost of a problem reduces as a round continues. That is, if you submit a problem that costs p points tminutes
after the contest started, you get
points.
Misha and Vasya are having an argument trying to find out who got more points. Help them to find out the truth.
Input
The first line contains four integers a, b, c, d (250 ≤ a, b ≤ 3500, 0 ≤ c, d ≤ 180).
It is guaranteed that numbers a and b are divisible by 250 (just like
on any real Codeforces round).
Output
Output on a single line:
"Misha" (without the quotes), if Misha got more points than Vasya.
"Vasya" (without the quotes), if Vasya got more points than Misha.
"Tie" (without the quotes), if both of them got the same number of points.
Sample Input
Input
Output
Input
Output
Input
Output
Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d
& %I64u
Submit Status Practice CodeForces
501A
Appoint description:
System Crawler (Jul 17, 2016 1:03:54 PM)
Description
Misha and Vasya participated in a Codeforces contest. Unfortunately, each of them solved only one problem, though successfully submitted it at the first attempt. Misha solved the problem that costs a points
and Vasya solved the problem that costs b points. Besides, Misha submitted the problem c minutes after the contest started and
Vasya submitted the problem d minutes after the contest started. As you know, on Codeforces the cost of a problem reduces as a round continues. That is, if you submit a problem that costs p points tminutes
after the contest started, you get
points.
Misha and Vasya are having an argument trying to find out who got more points. Help them to find out the truth.
Input
The first line contains four integers a, b, c, d (250 ≤ a, b ≤ 3500, 0 ≤ c, d ≤ 180).
It is guaranteed that numbers a and b are divisible by 250 (just like
on any real Codeforces round).
Output
Output on a single line:
"Misha" (without the quotes), if Misha got more points than Vasya.
"Vasya" (without the quotes), if Vasya got more points than Misha.
"Tie" (without the quotes), if both of them got the same number of points.
Sample Input
Input
500 1000 20 30
Output
Vasya
Input
1000 1000 1 1
Output
Tie
Input
1500 1000 176 177
Output
Misha
比较水,题意也比较好理解
#include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int main() { int a,b,c,d; while(scanf("%d%d%d%d",&a,&b,&c,&d)!=EOF) { int a1=max(3*a/10,a-a/250*c); int a2=max(3*b/10,b-b/250*d); if(a1>a2) printf("Misha\n"); else if(a1<a2) printf("Vasya\n"); else printf("Tie\n"); } return 0; }
相关文章推荐
- 移植apache-1.3.39到arm平台
- 冒泡和选择排序的递归算法
- python脚本自动生成需要文件
- python反射(自省)
- js局部打印
- 今天给大家展示一下点击按钮然后切换场景这个代码
- Python学习之私有函数、私有变量
- 密码 hd 2043
- 手把手教你OA选型
- 快速排序
- HDU - 3555 Bomb(数位dp)
- Hbase Architecture[上]
- HDU 1232 畅通工程
- STOMP协议规范
- hdu1253 胜利大逃亡--BFS & BFS的总结
- Snapcraft操作演示--教你如何snap一个应用
- 李洪强iOS开发之自定义cell的使用
- I/O复用:select和poll函数
- hdoj2054又见GCD(GCD最大公约数)
- Sql Server的执行计划