90分,TLE求助
查看原帖
90分,TLE求助
521302
landernal楼主2022/2/3 12:29
#include <iostream>

using namespace std;

int main(){
    int n, l, r;
    cin >> n >> l >> r;
    int max = 0;
    if(r - l >= n) {
        cout << n - 1 << endl;
    }else{
        while(l <= r) {
            if(l % n > max) {
                max = l % n;
            }
            l++;
        }
        cout << max << endl;
    }
    return 0;
}

2022/2/3 12:29
加载中...