题意:给定四个数代表长宽高和重,问你是不是满足下面条件,长不高于56,宽不宽于45,高不高于25,或者总和不大于125,并且重量不高于7.

析:判断输出就好,注意这个题是或,不要想错了。

代码如下:

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <cstdio>
#include <string>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cstring>
#include <set>
#include <queue>
#include <algorithm>
#include <vector>
#include <map>
#include <cctype>
#include <cmath>
#include <stack>
#include <sstream>
#define frer freopen("in.txt", "r", stdin)
#define frew freopen("out.txt", "w", stdout)
using namespace std; typedef long long LL;
typedef pair<int, int> P;
const int INF = 0x3f3f3f3f;
const double inf = 0x3f3f3f3f3f3f;
const double PI = acos(-1.0);
const double eps = 1e-8;
const int maxn = 1e3 + 5;
const int mod = 1e9 + 7;
const char *mark = "+-*";
const int dr[] = {1, 0, -1, 0};
const int dc[] = {0, 1, 0, -1};
const char *de[] = {"0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111", "1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111"};
int n, m;
const int mon[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int monn[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
inline int Min(int a, int b){ return a < b ? a : b; }
inline int Max(int a, int b){ return a > b ? a : b; }
inline LL Min(LL a, LL b){ return a < b ? a : b; }
inline LL Max(LL a, LL b){ return a > b ? a : b; }
inline bool is_in(int r, int c){
return r >= 0 && r < n && c >= 0 && c < m;
} int main(){
int T; cin >> T;
int ans = 0;
while(T--){
double a, b, c, d;
cin >> a >> b >> c >> d;
double e = a + b + c;
if(d <= 7.0 && (e <= 125.0 || a <= 56 && b <= 45 && c <= 25)) { printf("1\n"); ++ans; }
else printf("0\n");
}
printf("%d\n", ans);
return 0;
}

UVaLive 6608 Cabin Baggage (水题)的更多相关文章

  1. UVALive 4764 简单dp水题(也可以暴力求解)

    B - Bing it Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit Status ...

  2. UVaLive 6802 Turtle Graphics (水题,模拟)

    题意:给定一个坐标,和一行命令,按照命令走,问你有多少点会被访问超过一次. 析:很简单么,按命令模拟就好,注意有的点可能走了多次,只能记作一次. 代码如下: #pragma comment(linke ...

  3. UVaLive 6858 Frame (水题)

    题意:给定一个矩形框架,给定一个小矩形,问你能不能正好拼起来. 析:很简单么,就三种情况,如果是1*1的矩形,或者是1*2的一定可以,然后就是上面和下面正好能是小矩形的整数倍,左右是少一,两个就是整数 ...

  4. Argus UVALive - 3135(优先队列 水题一道)

    有一系列的事件,它每Period秒钟就会产生编号为qNum的事件,你的任务是模拟出前k个事件,如果多个事件同时发生,先处理qNum小的事件 今天再看看数据结构.. #include <iostr ...

  5. UVa 12709 && UVaLive 6650 Falling Ants (水题)

    题意:给定 n 个长方体的长,宽,高,让你求高最大的时候体积最大是多少. 析:排序,用高和体积排序就好. 代码如下: #pragma comment(linker, "/STACK:1024 ...

  6. UVALive 6858——分类讨论&&水题

    题目 链接 题意:对于一个$n \times m$的矩阵的最外一圈,问是否能用$k \times 1$的方块填满 分析 考虑左右两边的情况,分类讨论,切记考虑所有可能的情形. #include< ...

  7. UVALive 6862——结论题&&水题

    题目 链接 题意:求满足$0 \leq x \leq y \leq z \leq m$且$x^j + y^j = z^j, \ j=2 \cdots n$的三元组的对数 分析 由费马大定理:整数$n ...

  8. UVALive 2318 水题

    给出c 个竞争者.v 个投票人.每个投票人的投票顺序.问你谁会胜出.在第几轮.完全是个水题.比赛的时候debug接近两个点没过.因此差点放弃了整场比赛.猜测是错在找最大和第二大的序号哪里错的.因为我换 ...

  9. UVaLive 6591 && Gym 100299L Bus (水题)

    题意:略. 析:不解释,水题. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include < ...

随机推荐

  1. POJ 2069 Super Star

    模拟退火. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm& ...

  2. hihoCoder #1182 欧拉路·三 (变形)

    题意: 写出一个环,环上有2^n个格子,每个格子中的数字是0或1,相连着的n个格子可以组成一个数的二进制,要求给出这2^n个数字的序列,使得组成的2^n个数字全是不同的.(即从0到2^n-1) 思路: ...

  3. operator重载的使用

    C++的大多数运算符都可以通过operator来实现重载. 简单的operator+ #include <iostream> using namespace std; class A { ...

  4. 【英语】Bingo口语笔记(69) - 脏话的表达

  5. 【英语】Bingo口语笔记(77) - 临时改变计划的表达

  6. mysql 优化analyze table

    Analyze Table MySQL 的Optimizer(优化元件)在优化SQL语句时,首先需要收集一些相关信息,其中就包括表的cardinality(可以翻译为“散列程度”),它表示某个索引对应 ...

  7. 构建 XCache 的基本步骤

    构建 XCache 的基本步骤 在开始之前,首先确保 PHP 正常安装并核实 phpize 是否位于 shell 的 PATH 下.同时,还需要一个 C 编译器,例如 GNU Compiler Col ...

  8. 可以用google了

    半年都上不了google,现在可以了, 哈哈,支持自动更新, 有时候用google还是很不错的,尤其是英文搜索.

  9. XSS 前端防火墙(3):无懈可击的钩子

    昨天尝试了一系列的可疑模块拦截试验,尽管最终的方案还存在着一些兼容性问题,但大体思路已经明确了: 静态模块:使用 MutationObserver 扫描. 动态模块:通过 API 钩子来拦截路径属性. ...

  10. 使用Drush管理Drupal站点

    Drush(Drush = Drupal + Shell)就是使用命令行命令来操作Drupal站点,它的命令格式与git类似,都是双字命令(drush + 实际的命令).既然是命令行命令,也就可以使用 ...