UVAlive 6426 Count 读入二进制文件
2016-09-11 19:05
363 查看
//题目:http://www.51isoft.com/v3/external/64/6426.pdf //参考:http://blog.csdn.net/u013007900/article/details/48090897 #include <stdio.h> #include <string> #include <cstring> #include <queue> #include <algorithm> #include <functional> #include <vector> #include <sstream> #include <iomanip> #include <math.h> #include <iostream> #include <sstream> #include <time.h> #include <stack> #include <set> #include <map> #include <time.h> #include <bitset> using namespace std; int A[10005][10005]; bool read(int *a, int n) { return fread(a,4,n,stdin); } int main() { int n, m; read(&n,1); read(&m,1); for(int i=0; i<n; i++) read(A[i],m); int l,r; while(read(&l,1)&&read(&r,1)) { int ans=0; for(int i=0; i<n; i++) { int lpos=lower_bound(A[i],A[i]+m,l)-A[i]; int rpos=upper_bound(A[i],A[i]+m,r)-A[i]; if(rpos>lpos) ans+=rpos-lpos; } printf("%d\n",ans); } return 0; }
相关文章推荐
- UVAlive 6426 Count【读入】
- UVALive 6426 Count(分治或二分)
- UVALive4886 E - Page Count 模拟
- UVA264 UVALive5373 UVALive3034 Count on Cantor【数学】
- UVALive 6663 Count the Regions (离散化,染色,dfs)
- UVALive 6663 Count the Regions --离散化+DFS染色
- UvaLive 6663 Count the Regions 离散化+DFS
- UVALive 6663 Count the Regions 离散+bfs染色_(:зゝ∠)_
- [UVALive 6663 Count the Regions] (dfs + 离散化)
- UVALive 6663 Count the Regions --离散化+DFS染色
- UVALive 4886|HDU 3777|Page Count|暴力
- Uvalive 6471 Triangle Count Sequences of Polygon Triangulations 多边形三角剖分 递归思想
- UvaLive 6663 Count the Regions 离散化+DFS
- UVALive 6426
- uvalive 6393(uva 1572) Self-Assembly 拓扑排序
- POJ1609 UVALive2815 UVA1196 ZOJ1787 Tiling Up Blocks【二维最长上升子序列+DP】
- Arrangement for Contests UVALive - 8519
- UVa 357 - Let Me Count The Ways
- UVA 11827 Maximum GCD(读入技巧,stringstream的使用)
- LA 3266 || UVALive 3266 Tian Ji -- The Horse Racing 田忌赛马(贪心)