【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) = ...
随机推荐
- ZOJ 2315 New Year Bonus Grant
New Year Bonus Grant Time Limit: 5000ms Memory Limit: 32768KB This problem will be judged on ZJU. Or ...
- Android学习之——优化篇(1)
一.优化的品质 1.简练.2.可读性强.3.模块化:4.层次性:5.设计良好.6.高效.7.优雅:8.清晰. 二.常见的编程规范 1. 基本要求 · 结构清晰,简单易懂.单个函数不超过100行 ...
- godoc工具使用
golang除了语言有一定的规范外,对于文档的生成也是非常不错的.仅仅要按go的格式来写的程序,都能够非常easy的生成文档. godoc命令介绍: http://golang.org/cmd/god ...
- HDU1237 简单计算器 【栈】+【逆波兰式】
简单计算器 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Subm ...
- win32 Service memory leak
https://stackoverflow.com/questions/2728578/how-to-get-phyiscal-path-of-windows-service-using-net ht ...
- 【转】详述iOS国际化
原文网址:http://www.cocoachina.com/ios/20151120/14258.html 在真正将国际化实践前,只知道通过NSLocalizedString方法将相应语言的字符串加 ...
- USACO 1.5 Number Triangles
Number Triangles Consider the number triangle shown below. Write a program that calculates the highe ...
- 锋利Jquery 第一天
之前一直学习,现在终于有时间来整理一下文档了. 以下文章都是自己学习Jquery 的笔记, 希望能留下痕迹,也希望能帮助到您. 好了开始我的Jquery第一天. 我也是从Hello wrod!开始的 ...
- Activity、Fragment、ViewPage
1.新建super //super提供统一的FragmentActivity入口.public abstract class SuperFragmentActivity extends Fragmen ...
- SSH 项目中 用Hibernate底层 简单的封装DAO层
废话不多少了,主要是使用hibernate的查询方法,自己封装了DAO层,供service来方便使用. 首先:必须要继承的 public class CommonDao extends Hiberna ...