Codeforces 989D A Shade of Moonlight】的更多相关文章

A Shade of Moonlight 列列式子发现, 对于同一个云来说只有反向的云才能和它相交, 然后我们发现这个东西有单调性,然后二分就好啦. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PLL pair<LL, LL> #define PLI pair<LL, int> #define PI…
看这位博主的吧:https://blog.csdn.net/Steaunk/article/details/80660954…
数轴上$n \leq 100000$个不重叠的云,给坐标,长度都是$l$,有些云速度1,有些云速度-1,风速记为$w$,问在风速不大于$w_{max}$时,有几对云可能在0相遇.每一对云单独考虑. 多动一不动--相对运动.假设是原点在左右跑(当然这只是一种观点,暴力解不等式也是可以的),风速$w$时,看成原点的速度为$-w$,其他点依然像原题所述的那样飞,那么可以画出时间-坐标图象:(图片直接扒cf的) 其中蓝条表示云,橙色区域表示原点在速度不超过$w_{max}$下可能的时间-坐标轨迹的总和.…
题意: 给 nnn个长度为 lll 且互不相交的开区间 (xi,xi+l)(x_{i}, x_{i}+l)(xi​,xi​+l) ,每个区间有一个移动速度 vvv,v∈1,−1v∈1,-1v∈1,−1.你可以在某一时刻给所有区间同时增加一个速度 www,要求满足 ∣w∣<=wmax|w|<= w_{max}∣w∣<=wmax​ 求有对多少对 (i,j)(i<j)(i,j)(i<j)(i,j)(i<j) 移动的过程中能同时覆盖原点(坐标为 000 的点). 数据·范围:…
题意略. 思路: 可以看成是所有的云彩照常运动,而月亮在跑.只要两个云彩相交后,在分离前月亮能赶到,就算是符合题意的. 可以知道,两个相隔越远的相向运动地云彩是越有可能符合题意的,因为它们相遇所用时间更长,这样月亮越有可能赶到. 假设云彩1为(l1,r1) ,云彩2为(l2,r2) ,r1 < l2 ,且两个云彩相向运动,云彩长度为 l .我们令中心点p = (r1 + l2) / 2. 月亮赶到p点所需时间为runtime = p / wmax,两个云彩在相交后相离所用时间为 time = a…
http://codeforces.com/problemset/problem/148/D D. Bag of mice time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The dragon and the princess are arguing about what to do on the New Year's Eve…
题目链接: http://codeforces.com/problemset/problem/148/D D. Bag of mice time limit per test2 secondsmemory limit per test256 megabytes 问题描述 The dragon and the princess are arguing about what to do on the New Year's Eve. The dragon suggests flying to the…
D. Bag of mice http://codeforces.com/problemset/problem/148/D time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The dragon and the princess are arguing about what to do on the New Year's Eve…
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题.. 今天,我们来扒一下cf的题面! PS:本代码不是我原创 1. 必要的分析 1.1 页面的获取 一般情况CF的每一个 contest 是这样的: 对应的URL是:http://codeforces.com/contest/xxx 还有一个Complete problemset页面,它是这样的:…
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of bconsecutive cells. No cell can be part of two ships, however, the shi…