HDU-1037(水水水题)

Keep on Truckin‘

Problem Description

Boudreaux and Thibodeaux are on the road again . . .

"Boudreaux, we have to get this shipment of mudbugs to Baton Rouge by tonight!"

"Don‘t worry, Thibodeaux, I already checked ahead. There are three underpasses and our 18-wheeler will fit through all of them, so just keep that motor running!"

"We‘re not going to make it, I say!"

So, which is it: will there be a very messy accident on Interstate 10, or is Thibodeaux just letting the sound of his own wheels drive him crazy?

Input

Input to this problem will consist of a single data set. The data set will be formatted according to the following description.

The data set will consist of a single line containing 3 numbers, separated by single spaces. Each number represents the height of a single underpass in inches. Each number will be between 0 and 300 inclusive.

Output

There will be exactly one line of output. This line will be:

NO CRASH

if the height of the 18-wheeler is less than the height of each of the underpasses, or:

CRASH X

otherwise, where X is the height of the first underpass in the data set that the 18-wheeler is unable to go under (which means its height is less than or equal to the height of the 18-wheeler). 
The height of the 18-wheeler is 168 inches.

Sample Input

180 160 170

Sample Output

CRASH 160

分析:无脑判断。

 1 #include<cstdio>
 2 #include<cstring>
 3 #include<cstdlib>
 4 #include<iostream>
 5 using namespace std;
 6 int main()
 7 {
 8     int a,b,c;
 9     scanf("%d%d%d",&a,&b,&c);
10     if(a<=168) printf("CRASH %d\n",a);
11     else if(b<=168) printf("CRASH %d\n",b);
12     else if(c<=168) printf("CRASH %d\n",c);
13     else printf("NO CRASH\n");
14     return 0;
15 }
时间: 2024-08-09 21:58:28

HDU-1037(水水水题)的相关文章

HDU-1037-Keep on Truckin&#39;(HDU最水的题没有之一,为了练英语就来吧)

Keep on Truckin' Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 10324    Accepted Submission(s): 7147 Problem Description Boudreaux and Thibodeaux are on the road again . . . "Boudreaux, we ha

hdu 4416 水题 浙大计算机研究生复试上机考试-2005年 可是发现自己写代码有问题

Spring3与Hibernate4整合时出现了nested exception is java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider. hibernate3的时候,用spring来控制sessionfactory用的可以是org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean,因为用的是hibernate4所以照猫画

HDU-1042-N!(Java大法好 &amp;&amp; HDU大数水题)

N! Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 64256    Accepted Submission(s): 18286 Problem Description Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N! Input One N in o

Dijkstra算法---HDU 2544 水题(模板)

/* 对于只会弗洛伊德的我,迪杰斯特拉有点不是很理解,后来发现这主要用于单源最短路,稍稍明白了点,不过还是很菜,这里只是用了邻接矩阵 套模板,对于邻接表暂时还,,,没做题,后续再更新.现将这题贴上,应该是迪杰斯特拉最水的题没有之一.纯模板 */ 题目大意: 搬东西很累,想省力,给你几个点和点之间的距离:标准题型: #include<stdio.h> #include <iostream> #include<string.h> using namespace std; #

hdu 4932 /bestcoder B题 #4 /思维题

题意:给一个数列(整数),用一些不相交的区间去覆盖(只能是用端点去覆盖,端点可以交).而且区间出度相等.求最大区间长度. 开始一下就敲了,枚举每个区间长度,判断合法,更新最大.但是后来一看小数,感觉不行,改为二分,后来还是挂了... 赛后才知道,二分的时候,答案必需要满足单调性啊,这里小的数据不行,大的数据可以行!如 0 1 5 6 10, 3不行,4行. 后来才知道,枚举时,每个差值的一半也是可以的:仔细想想很容易证明.(水,坑) #include<iostream> #include<

HDU 4968 (水dp 其他?)

1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 #include <vector> 5 #include <map> 6 using namespace std; 7 const int inf = 0x3f3f3f3f; 8 const int MAX = 200+10; 9 double GPA[10],dp1[20][30000],dp2[20][30000

Saving Princess claire_(hdu 4308 bfs模板题)

http://acm.hdu.edu.cn/showproblem.php?pid=4308 Saving Princess claire_ Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2305    Accepted Submission(s): 822 Problem Description Princess claire_ wa

HDU 4279 Number 规律题

题意: 定义函数F(x) : 区间[1,x]上的y是满足:GCD(x,y)>1 && x%y>0的 y的个数. 问:对于任意区间[l,r] 上的F(l···r) 有几个函数值是奇数的. 打表找规律. 打的是[1,x]区间的结果 把所有结果不相同的值打出来(因为结果是递增的,所以只观察不相同的结果) 发现:ans = x/2-2 || x/2-1 再把所有结果不同 && x/2-1的值打出来 发现 sqrt(x) &1 == 1 得到:ans = x/2-

hdu 4961 数学杂题

http://acm.hdu.edu.cn/showproblem.php?pid=4961 先贴个O(nsqrtn)求1-n所有数的所有约数的代码: vector<int>divs[MAXN]; void caldivs() { for(int i=1;i<MAXN;i++) for(int j=i;j<MAXN;j+=i) divs[j].push_back(i); } 有了这个当时理下思路就可写了,但是重复数处理注意: 1.用一个数组vis[]  vis[i]=1表示i存在