摘要:参考博客 https://www.cnblogs.com/xiaoniu-666/p/9701347.html rand方法 rand()不需要参数,它会返回一个从0到最大随机数的任意整数,最大随机数的大小通常是固定的一个大整数。 这样,如果你要产生0~10的10个整数,可以表达为: int N =
阅读全文
摘要:原题:http://cxsjsx.openjudge.cn/2021finalpractise/G/ 描述 小C在一个排水系统不太好的学校上学。又是一个下雨天,学校里高低不平积了很多水。小C突发奇想:如果大雨一直下,多久以后我可以在学校里游泳呢? 学校是 N x N 的坐标方格 grid 中,每一个
阅读全文
摘要:原题:http://cxsjsx.openjudge.cn/2021finalpractise/C/ 描述 北大信息学院的同学小明毕业之后打算创业开餐馆.现在共有n 个地点可供选择。小明打算从中选择合适的位置开设一些餐馆。这 n 个地点排列在同一条直线上。我们用一个整数序列m1, m2, ... m
阅读全文
摘要:原题:http://cxsjsx.openjudge.cn/2021finalpractise/A/ 描述 小 A 修了 n 门课程, 第 i 门课程是从第 ai 天一直上到第 bi 天。 定义两门课程的冲突程度为 : 有几天是这两门课程都要上的。 例如 a1=1,b1=3,a2=2,b2=4 时,
阅读全文
摘要:原题:http://bailian.openjudge.cn/practice/2456/ 描述 Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located alon
阅读全文
摘要:原题:http://bailian.openjudge.cn/practice/1042/ 描述 John is going on a fishing trip. He has h hours available (1 <= h <= 16), and there are n lakes in th
阅读全文
摘要:原题:http://bailian.openjudge.cn/practice/1328/ 描述 Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other.
阅读全文
摘要:原题:http://poj.org/problem?id=3190 描述 Oh those picky N (1 <= N <= 50,000) cows! They are so picky that each one will only be milked over some precise t
阅读全文