09 2017 档案

摘要:刷题时意外找到了一个好题单,记录一下 POJ 1031 Fence 计算视角,要注意角度覆盖大于2*PI的情况POJ 1039 Pipe 用叉积判断方向的经典题。枚举两凸点,先计算过这两点能否出左口,若可以再计算最右能到到多远。POJ 1066 Treasure Hunt 正方形区域中有n条线段,求 阅读全文
posted @ 2017-09-24 19:57 Styx-ferryman 阅读(375) 评论(0) 推荐(0) 编辑
摘要:今天学了大根堆,第一次从头到尾个人手打,虽说有些STL能代替堆但效率很低,算了算300000的数据甚至要跑500ms。。。。 也算记录一下吧。 自己的:83ms(300000) 老师的:71ms(300000) 每天刷题身体棒棒! 阅读全文
posted @ 2017-09-08 22:25 Styx-ferryman 阅读(467) 评论(0) 推荐(0) 编辑
摘要:You are given an array a consisting of n positive integers. You pick two integer numbers l and r from 1 to n, inclusive (numbers are picked randomly, 阅读全文
posted @ 2017-09-07 21:00 Styx-ferryman 阅读(350) 评论(0) 推荐(0) 编辑
摘要:Helen works in Metropolis airport. She is responsible for creating a departure schedule. There are n flights that must depart today, the i-th of them 阅读全文
posted @ 2017-09-07 11:43 Styx-ferryman 阅读(1690) 评论(0) 推荐(1) 编辑
摘要:最近做题经常会遇到大佬出题为了避免精度问题要求将答案模一个大质数.然后我就一脸懵逼的连续爆了好几场零.终于下定决心来学一下什么是乘法逆元.其实又感觉不是很难(但为啥比赛就写不出来qwq) 铺垫知识: 费马小定理: 反正就当会证了,开始推导: 首先易知: 这个不管在正常意义下还是模算术意义下都是正确的 阅读全文
posted @ 2017-09-06 16:24 Styx-ferryman 阅读(630) 评论(0) 推荐(1) 编辑
摘要:最近几场比赛经常会犯一些很简单很诡异的错误,总结一下,以后注意 1. if(a[i]==b)不要写成if(a[i]=b) 2. scanf("%lld",&n)不要写成scanf("%lld",n) 3. 不要太相信int,能开long long,尽量long long 4. sort必须要有usi 阅读全文
posted @ 2017-09-05 22:43 Styx-ferryman 阅读(1315) 评论(0) 推荐(2) 编辑
摘要:感觉过去学了假的邻接表,今天终于学会了真的,记录一下. 代码如下: 每日刷题身体棒棒! 阅读全文
posted @ 2017-09-05 16:38 Styx-ferryman 阅读(271) 评论(0) 推荐(0) 编辑
摘要:As we all know, machine scheduling is a very classical problem in computer science and has been studied for a very long history. Scheduling problems d 阅读全文
posted @ 2017-09-04 22:19 Styx-ferryman 阅读(215) 评论(0) 推荐(0) 编辑
摘要:>如何用cmd编译c++?-m32究竟是什么操作?这究竟是道德的沦丧还是人性的泯灭,请收看今日的c++奇技淫巧 咳咳,扯远了(正经脸)主要是今天学了c++的一些编译技巧以及cmd的一些操作,总结一下。 >c++的编译 >>环境变量 首先将编译文件g++.exe放到环境变量里: 接着找到c++编译文件 阅读全文
posted @ 2017-09-04 19:48 Styx-ferryman 阅读(309) 评论(0) 推荐(0) 编辑
摘要:Recently, the bear started studying data structures and faced the following problem. You are given a sequence of integers x1, x2, ..., xn of length n  阅读全文
posted @ 2017-09-04 15:38 Styx-ferryman 阅读(294) 评论(0) 推荐(0) 编辑
摘要:The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. For e 阅读全文
posted @ 2017-09-03 20:14 Styx-ferryman 阅读(188) 评论(0) 推荐(0) 编辑
摘要:A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to calculate the v 阅读全文
posted @ 2017-09-03 19:24 Styx-ferryman 阅读(184) 评论(0) 推荐(0) 编辑
摘要:有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。 Input输入有 阅读全文
posted @ 2017-09-02 15:10 Styx-ferryman 阅读(231) 评论(0) 推荐(0) 编辑