90分TLE求助
查看原帖
90分TLE求助
735252
ordoki楼主2023/3/12 00:05

评测纪录

#include<iostream>
using namespace std;
int n,L,R;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>L>>R;
	if(R-L>=n)
		cout<<n-1;
	else{
		int maxi=-1;
		for(int i=L;i<=R;i++)
			maxi=max(i%n,maxi);
		cout<<maxi;
	}
	return 0;
}

看题里给的数据范围是没有问题的,测试点9满足RLnR-L\ge n,但超时了 最奇怪的是本地竟然还能通过

2023/3/12 00:05
加载中...