tj
2025-09-14 10:14:32
发布于:福建
4阅读
0回复
0点赞
1.考场上的写法
#include <bits/stdc++.h>
using namespace std;
long long n , l , r;
int main( ) {
freopen("candy.in" , "r" , stdin);
freopen("candy.out" , "w" , stdout);
cin >> n >> l >> r;
if (l / n == r / n) {
cout << r % n << endl;
} else {
cout << n - 1 << endl;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long n , l , r;
int main( ) {
cin >> n >> l >> r;
if (l / n == r / n) {
cout << r % n << endl;
} else {
cout << n - 1 << endl;
}
return 0;
}
2.ACGO解法
这里空空如也
有帮助,赞一个