博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
uva 1398 - Meteor
阅读量:4074 次
发布时间:2019-05-25

本文共 885 字,大约阅读时间需要 2 分钟。

先存代码,睡觉去了 睡觉

代码:

#include
#include
#include
#include
using namespace std;const int LCM = 2520;const int MAXN = 100010;int w, h, n, idx;inline bool getTime(int x, int y, int& a, int& b){ int tx1, tx2, ty1, ty2; if(a){ tx1 = (w-x)*LCM/a, tx2 = (-x)*LCM/a; if(tx1<0 && tx2<0) return false; } else{ if(x>=w || x<=0) return false; tx1 = 0, tx2 = 1e9; } if(b){ ty1 = (h-y)*LCM/b, ty2 = (-y)*LCM/b; if(ty1<0 && ty2<0) return false; } else{ if(y>=h || y<=0) return false; ty1 = 0, ty2 = 1e9; } if(tx1 > tx2) swap(tx1, tx2); if(ty1 > ty2) swap(ty1, ty2); if(tx1<0) tx1=0; if(ty1<0) ty1=0; a = max(tx1, ty1); b = min(tx2, ty2); return a
0) maxx = max(++cur, maxx); else --cur; } printf("%d\n", maxx); } return 0;}

你可能感兴趣的文章
2. Add Two Numbers
查看>>
17. Letter Combinations of a Phone Number (DFS, String)
查看>>
93. Restore IP Addresses (DFS, String)
查看>>
19. Remove Nth Node From End of List (双指针)
查看>>
49. Group Anagrams (String, Map)
查看>>
139. Word Break (DP)
查看>>
Tensorflow入门资料
查看>>
剑指_用两个栈实现队列
查看>>
剑指_顺时针打印矩阵
查看>>
剑指_栈的压入弹出序列
查看>>
剑指_复杂链表的复制
查看>>
服务器普通用户(非管理员账户)在自己目录下安装TensorFlow
查看>>
星环后台研发实习面经
查看>>
大数相乘不能用自带大数类型
查看>>
字节跳动后端开发一面
查看>>
CentOS Tensorflow 基础环境配置
查看>>
centOS7安装FTP
查看>>
FTP的命令
查看>>
CentOS操作系统下安装yum的方法
查看>>
ping 报name or service not known
查看>>