Meteor Seoul 2007
来源:互联网 发布:亿赞普大数据 编辑:程序博客网 时间:2024/05/17 18:40
#include <iostream>#include <cstdio>#include <cstdlib>#include <cmath>#include <queue>#include <algorithm>#include <vector>#include <cstring>#include <stack>#include <cctype>#include <utility>#include <map>#include <string>#include <climits> #include <set>#include <string> #include <sstream>#include <utility>#include <ctime>//#pragma comment(linker, "/STACK:1024000000,1024000000") using std::priority_queue;using std::vector;using std::swap;using std::stack;using std::sort;using std::max;using std::min;using std::pair;using std::map;using std::string;using std::cin;using std::cout;using std::set;using std::queue;using std::string;using std::istringstream;using std::getline;using std::make_pair;using std::greater; const int MAXN(100010);struct NODE{double ti;int flag;friend bool operator < (const NODE &op1, const NODE &op2){return op1.ti < op2.ti || (op1.ti == op2.ti && op1.flag < op2.flag); }};NODE node[MAXN << 1];int count;double t[4];bool comp(int op1, int op2){return t[op1] < t[op2];}void updata(int di, int v, int w, double &L, double &R){if(v == 0){if(di <= 0 || di >= w)R = L-1;}elseif(v < 0){L = max(L, -(double)(di-w)/v);R = min(R, -(double)di/v);}else{L = max(L, (double)(-di)/v);R = min(R, (double)(w-di)/v);}}int main(){int T;scanf("%d", &T);while(T--){int w, h;int n;scanf("%d%d%d", &w, &h, &n);count = 0;int x, y, vx, vy;for(int i = 0; i < n; ++i){scanf("%d%d%d%d", &x, &y, &vx, &vy);double L = 0, R = 1e20;updata(x, vx, w, L, R);updata(y, vy, h, L, R);if(L < R){node[count].ti = L;node[count++].flag = 1;node[count].ti = R;node[count++].flag = -1;}}sort(node, node+count);int ans = 0, sum = 0;for(int i = 0; i < count; ++i){sum += node[i].flag;ans = max(ans, sum);}printf("%d\n", ans);}return 0;}
- Meteor Seoul 2007
- Seoul 2007 Meteor 流星 ,LA 3905
- Seoul 2007 / UVa 1398 Meteor (排序&线性扫描)
- newwork Seoul 2007
- 3903 - PHONE Asia - Seoul - 2007/2008
- 3900 - Molar mass Asia - Seoul - 2007/2008
- 3904 - Tile Code Asia - Seoul - 2007/2008
- 3901 - Editor Asia - Seoul - 2007/2008
- Asia - Seoul - 2007/2008 UVA 3902 Network
- 网络(Network,Seoul 2007,LA 3902)
- 网络 network,Seoul 2007 LA3902 解题感想
- 分子量(Molar Counting, ACM/ICPC Seoul 2007)
- UVaLive(LA) 3902 Network,Seoul 2007
- [Molar Mass, ACM/ICPC Seoul 2007, UVA1586]
- meteor
- meteor
- Meteor
- Molar Mass, ACM/ICPC Seoul 2007, UVa 1586
- dft
- Win32输入法编程技术的分析研究
- poj 3486
- 准备看的书:整理
- 中文导入EndNote的方法
- Meteor Seoul 2007
- 求解分段函数的值
- Tomcat6配置参数详解
- 判断一个正整数是否为素数
- 获得Oracle数据库的DBID
- 规划生活
- Mysql5 默认用utf8编码却插入不了中文的解决方法(暂时)
- iOS6和Xcode4.5初体验
- Object,byte[],ByteBuffer之间的转换