Kth number Time Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16941 Accepted Submission(s): 5190 Problem Description Give you a sequence and ask you the kth big number of a inteval. Input The…
To 洛谷.2982 慢下来Slowing down 题目描述 Every day each of Farmer John's N (1 <= N <= 100,000) cows conveniently numbered 1..N move from the barn to her private pasture. The pastures are organized as a tree, with the barn being on pasture 1. Exactly N-1 cow…
二分mid,然后用1~mid的操作在差分序列上加减,最后把差分序列前缀和起来,看是否有有超过初始r值的 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N=1e6,INF=1e9; long long n,m,a[N],d[N],x[N],y[N],s[N]; int read() { int r=…