0%

CF-1013-D. Place of the Olympiad

思路讲解

这个还是要写的更细致一点,检查函数

1
2
3
4
5
6
7
8
9
10
11
12
13
14
inline bool check(ll x){
// ll res=ceil((M*N)*1.0l/(x+1));
// ll rem=K%x;
ll res=x*(M/(x+1));
ll usedBlock=(x+1)*(M/(x+1));
res+=max(0ll,(M-usedBlock));
// #ifdef LOCAL
// cerr << x<<" "<< res << '\n';
// #endif
if(res*N>=K){
return true;
}
return false;
}

AC代码

心路历程(WA,TLE,MLE……)