codeforces467-A水题
题目链接:http://codeforces.com/problemset/problem/467/A
1 second
256 megabytes
standard input
standard output
George has recently entered the BSUCP (Berland State University for Cool Programmers). George has a friend Alex who has also entered the university. Now they are moving into a dormitory.
George and Alex want to live in the same room. The dormitory has n rooms in total. At the moment the i-th room has pi people living in it and the room can accommodate qi people in total (pi ≤ qi). Your task is to count how many rooms has free place for both George and Alex.
The first line contains a single integer n (1 ≤ n ≤ 100) — the number of rooms.
The i-th of the next n lines contains two integers pi and qi (0 ≤ pi ≤ qi ≤ 100) — the number of people who already live in the i-th room and the room's capacity.
Print a single integer — the number of rooms where George and Alex can move in.
3
1 1
2 2
3 3
0
3
1 10
0 10
10 10
2
#include<iostream>
using namespace std; int main()
{
int n,p,q,num = ;
cin >> n;
while(n--)
{
cin >> p >> q;
if(q - p >= )
num++;
}
cout << num << endl;
return ;
}
codeforces467-A水题的更多相关文章
- HDOJ 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
- ACM :漫漫上学路 -DP -水题
CSU 1772 漫漫上学路 Time Limit: 1000MS Memory Limit: 131072KB 64bit IO Format: %lld & %llu Submit ...
- ytu 1050:写一个函数,使给定的一个二维数组(3×3)转置,即行列互换(水题)
1050: 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 154 Solved: 112[ ...
- [poj2247] Humble Numbers (DP水题)
DP 水题 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The se ...
- gdutcode 1195: 相信我这是水题 GDUT中有个风云人物pigofzhou,是冰点奇迹队的主代码手,
1195: 相信我这是水题 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 821 Solved: 219 Description GDUT中有个风云人 ...
- BZOJ 1303 CQOI2009 中位数图 水题
1303: [CQOI2009]中位数图 Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 2340 Solved: 1464[Submit][Statu ...
- 第十一届“蓝狐网络杯”湖南省大学生计算机程序设计竞赛 B - 大还是小? 字符串水题
B - 大还是小? Time Limit:5000MS Memory Limit:65535KB 64bit IO Format: Description 输入两个实数,判断第一个数大 ...
- ACM水题
ACM小白...非常费劲儿的学习中,我觉得目前我能做出来的都可以划分在水题的范围中...不断做,不断总结,随时更新 POJ: 1004 Financial Management 求平均值 杭电OJ: ...
- CF451C Predict Outcome of the Game 水题
Codeforces Round #258 (Div. 2) Predict Outcome of the Game C. Predict Outcome of the Game time limit ...
- CF451B Sort the Array 水题
Codeforces Round #258 (Div. 2) Sort the Array B. Sort the Array time limit per test 1 second memory ...
随机推荐
- Gitlab批量迁移项目
最近接到一个需求,要把一个Gitlab上边的项目全部导入到另外一个Gitlab,借鉴了网上的一个方法,成功实现. 参考链接:https://segmentfault.com/a/11900000159 ...
- 9-剑指offer: 二进制中1的个数
题目描述 输入一个整数,输出该数二进制表示中1的个数.其中负数用补码表示. 代码 class Solution { public: int NumberOf1(int n) { if(n==0) re ...
- 杂项-FLAG
题目 最低位隐写 50 4B 03 04 压缩格式zip的文件头 save bin 保存成zip格式 解压(WinRAR不能正常解压) 然后用vim打开(winhex也可以) hctf{dd0gf4c ...
- Mybatis-Plus Bugs
Mybatis-Plus Bugs 实体类中属性和数据库字段对应异常 Caused by: java.sql.SQLSyntaxErrorException: Unknown column 'user ...
- Nginx配置文件nginx.conf(八)
原文链接:https://www.cnblogs.com/knowledgesea/p/5175711.html 在nginx.conf的注释符号是#. 默认的nginx.conf内容为: #user ...
- zz【重磅】微软开源自动机器学习工具 - NNI
[重磅]微软开源自动机器学习工具 - NNI 在机器学习建模时,除了准备数据,最耗时耗力的就是尝试各种超参组合,找到模型最佳效果的过程了.即使是对于有经验的算法工程师和数据科学家,有时候也很难把握其中 ...
- AndroidStdio模拟器打不开报错 Guest isn't online after 7 seconds
开了好几次模拟器,始终运行不出来原来的一个项目.报错如下: 解决方案: 经过百度,可能是Android Studio 3.0升级到3.0.1,启动原来建好的模拟器废掉了. 找到你软件中的 建议选择屏幕 ...
- 【CF438D】The Child and Sequence(线段树)
点此看题面 大致题意: 给你一个序列,让你支持区间求和.区间取模.单点修改操作. 区间取模 区间求和和单点修改显然都很好维护吧,难的主要是区间取模. 取模标记无法叠加,因此似乎只能暴力搞? 实际上,我 ...
- 热情组——项目冲刺 Day3
项目相关 作业相关 具体描述 班级 班级链接 作业要求 链接地址 团队名称 热情组 作业目标 实现软件制作,以及在福大的传播 Github链接 链接地址 SCRUM部分: 成员昵称 昨日目标 开始时间 ...
- What programming language is best for a bioinformatics beginner?
probably Unix Shell scripts, Perl, or Python and R can be the best options. ---------- 1-python 2-R ...