chonqYeah I have also tried binsearch but the non-monotonicity of the function didn't help. The exercise ...
chonqlong long n,k; cin>>n>>k; vector<long long>arr(n); for(int i=0;i<n;i++) cin>>arr[i]; for(int i=0;i<n...
chonqof course for simple test cases just brute force,but i am getting TLE for other cases. Any hints?
chonqhow to solve it optimally? n<=100000
chonqChef went to the store and saw a long queue. There are N people in the queue (numbered 1 through N f...