尤文替
查看原帖
尤文替
1053122
shy_lihui楼主2024/10/11 14:37

数据给出 RL109R−L \le 10^9 所以这个 O(RL)O(R-L) 的代码应该是能过的吧。


#include<bits/stdc++.h>
using namespace std;
int n,l,r;
int maxx=0;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin>>n>>l>>r;
	for(int i=l;i<=r;i++)
	{
		maxx=max(maxx,i%n);
	}
	cout<<maxx;
	return 0;
}
2024/10/11 14:37
加载中...