【codeforces 794A】Bank Robbery
【题目链接】:http://codeforces.com/contest/794/problem/A
【题意】
每个位置上可能有物品(>=1)或是没物品
你一开始在某一个位置b;
然后你最左可以往左走到a(a< b)
最右可以往右走到c(b< c);
然后问你a..c这区间里面有多少个物品;
【题解】
傻逼题
【Number Of WA】
0
【完整代码】
#include <bits/stdc++.h>
using namespace std;
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define rep1(i,a,b) for (int i = a;i <= b;i++)
#define rep2(i,a,b) for (int i = a;i >= b;i--)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define ms(x,y) memset(x,y,sizeof x)
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;
const int dx[9] = {0,1,-1,0,0,-1,-1,1,1};
const int dy[9] = {0,0,0,-1,1,-1,1,-1,1};
const double pi = acos(-1.0);
const int N = 110;
int a,b,c;
int n;
int main()
{
//freopen("F:\\rush.txt","r",stdin);
ios::sync_with_stdio(false),cin.tie(0);//scanf,puts,printf not use
//init??????
cin >> a >> b >> c;
cin >> n;
int ans = 0;
rep1(i,1,n)
{
int x;
cin >> x;
if (x>b && x<c)
ans++;
}
cout << ans << endl;
return 0;
}
【codeforces 794A】Bank Robbery的更多相关文章
- 【codeforces 796C】Bank Hacking(用一些技巧来代替multiset)
[题目链接]:http://codeforces.com/contest/796/problem/C [题意] 给你n个节点,你一开始选择一个节点,然后打掉它,然后与被打掉过的节点相连的节点才能被 打 ...
- 【codeforces 796C】Bank Hacking
[题目链接]:http://codeforces.com/contest/796/problem/C [题意] 给你n个节点,你一开始选择一个节点,然后打掉它,然后与被打掉过的节点相连的节点才能被 打 ...
- 【codeforces 415D】Mashmokh and ACM(普通dp)
[codeforces 415D]Mashmokh and ACM 题意:美丽数列定义:对于数列中的每一个i都满足:arr[i+1]%arr[i]==0 输入n,k(1<=n,k<=200 ...
- 【codeforces 707E】Garlands
[题目链接]:http://codeforces.com/contest/707/problem/E [题意] 给你一个n*m的方阵; 里面有k个联通块; 这k个联通块,每个连通块里面都是灯; 给你q ...
- 【codeforces 707C】Pythagorean Triples
[题目链接]:http://codeforces.com/contest/707/problem/C [题意] 给你一个数字n; 问你这个数字是不是某个三角形的一条边; 如果是让你输出另外两条边的大小 ...
- 【codeforces 709D】Recover the String
[题目链接]:http://codeforces.com/problemset/problem/709/D [题意] 给你一个序列; 给出01子列和10子列和00子列以及11子列的个数; 然后让你输出 ...
- 【codeforces 709B】Checkpoints
[题目链接]:http://codeforces.com/contest/709/problem/B [题意] 让你从起点开始走过n-1个点(至少n-1个) 问你最少走多远; [题解] 肯定不多走啊; ...
- 【codeforces 709C】Letters Cyclic Shift
[题目链接]:http://codeforces.com/contest/709/problem/C [题意] 让你改变一个字符串的子集(连续的一段); ->这一段的每个字符的字母都变成之前的一 ...
- 【Codeforces 429D】 Tricky Function
[题目链接] http://codeforces.com/problemset/problem/429/D [算法] 令Si = A1 + A2 + ... + Ai(A的前缀和) 则g(i,j) = ...
随机推荐
- weblogic11g 密码忘记肿么办?
今天小编在用 weblogic 时,把密码忘记了,肿么办呢!很是着急,还不想重新建空间.那就跟我做下面的操作吧! %DOMAIN_HOME%为你 weblogic base_domain 安装目录:我 ...
- php输出网页源代码莫名奇妙的多了一堆方框,导致ajax验证失败.
今天在用一个ajax验证用户名的功能,返回值报错,抓包看了下,多出来一堆点,源代码里显示方框和6个空行 这堆东西导致ajax判断返回值会错误,度娘了一下午(皇天不负游戏人啊),原来是一个坑爹的BOM头 ...
- Core Dataeasy出现的错误
1.2015-08-24 15:52:17.674 Tasks[3189:144763] CoreData: error: -addPersistentStoreWithType:SQLite con ...
- js面向对象编程: js类定义函数时prototype和this差别?
在面向对象编写js脚本时,定义实例方法主要有两种 例如以下: function ListCommon2(afirst) { var first=afirst; this.do1=function () ...
- cocos2D(六)----CCLayer
一个游戏中能够有非常多个场景,每一个场景里面又可能包括有多个图层,这里的图层一般就是CCLayer对象.CCLayer本身差点儿没什么功能.对照CCNode,CCLayer可用于接收触摸和加速计输入. ...
- BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第10章节--SP2013中OAuth概览 SP2013中的OAuth
BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第10章节--SP2013中OAuth概览 SP2013中的OAuth SP apps使用OAuth授权 ...
- js如何计算浮点数
js中浮点型是如何运算的呢? 例如:var a=0.69; 我想得到6.9 直接这样写 var c=a*10; alert(c); 得到结果是:6.8999999999999995 到网上一搜,有 ...
- oracle RAC 11g sqlload 生产表导入数据(ORA-12899)
背景:由于即将来临的双十一,业务部门(我司是做京东,天猫的短信服务),短信入库慢,需要DBA把数据库sqlload进数据库. 表结构如下: MRS VARCHAR2(100), STATUS VARC ...
- nginx令牌限制并发
http{ limit_req_zone $binary_remote_addr zone=req_one:10m rate=100r/s; server { listen 8080; server_ ...
- 获取sqlserver数据字典的完整sql
SELECTsysobjects.name AS 表名称 , --------------as 的作用:为字段起一个别名 --sysproperties.[value] AS 表说明 , ------ ...