虽然不是正确解法,但是就超时那么点,有没有办法卡过去呢?求帮助,code:
#include <iostream>
int main(){
#ifndef ONLINE_JUDGE
freopen("P7909.in","r",stdin);
#endif
std::cin.tie(0)->sync_with_stdio(0);
int n,l,r,ans = 0;
std::cin >> n >> l >> r;
for (int k = l;k <= r;k++) ans = std::max(ans,k % n);
std::cout << ans << '\n';
return 0;
}
ps:洛谷超时0.2s才会停止记时