分糖果正确满分解法(复杂度O(1))
查看原帖
分糖果正确满分解法(复杂度O(1))
574745
littlesnake楼主2023/10/30 19:35
#include <bits/stdc++.h>
using namespace std;
int n,l,r;
int main(){
    scanf("%d %d %d",&n,&l,&r);
    if(r/n>l/n){
        printf("%d",n-1);
    }else{
        printf("%d",r%n);
    }
    return 0;
}

2023/10/30 19:35
加载中...