100pts,unaccept
查看原帖
100pts,unaccept
606173
LAICZ楼主2022/7/16 12:45
#include <bits/stdc++.h>
#define u unsigned
#define rr register
#define ll long long 

using namespace std;

inline long long read(){
    char ch = getchar();
    int x = 0;bool s = 1;
    while(!isdigit(ch)){if(ch == '-')s = 0;ch = getchar();}
    while(isdigit(ch)){x = x * 10 + ch - '0';ch = getchar();}
    return s?x:-x;
}//quick read

void write(long long num){
	if(num > 9){
		write(num / 10);
	}
	putchar(num % 10 + '0');
	return;
}//quick write

int main(){
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	
	int n,l,r,ans;
	cin>>n>>l>>r;
	//l<=nx<=r
	//x++ nx >= l
	//x = ceil(l / n)
	if(ceil(l * 1.0 / n) * n >= l && ceil(l * 1.0 / n) * n <= r) ans = n - 1;//#1
	else ans = r % n;//#2,#3

	cout<<ans;
	//fclose(stdin);
	//fclose(stdout);
	return 0;
}

最后一个点过不了求助

2022/7/16 12:45
加载中...