90分求解(非考试代码,第三个点wa了但测试莫有问题)
查看原帖
90分求解(非考试代码,第三个点wa了但测试莫有问题)
445080
猫猥兽楼主2021/10/24 11:02

测试点3 233 4567 4657 out 230


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,L,R,ans;
	cin>>n>>L>>R;
	for(int i=1;ans<=R-n;i++)
	{
		ans=n*i-1;
	}
	if(ans>=L)cout<<n-1;
	else cout<<R-ans-1;
	return 0;
}

求解求解

2021/10/24 11:02
加载中...