- 分糖果
为什么???
- @ 2025-4-21 19:41:52
#include<bits/stdc++.h>
using namespace std;
int main(){
int n, l, r;
int ans = 0;
cin >> n >> l >> r;
for(int i = l; i <= r; ++i){
int tmp = 0;
tmp = i%n;
ans = max(ans, tmp);
}
cout << ans;
return 0;
}
tle为甚么?
1 comments
-
周琳轩 LV 7 @ 2025-4-23 12:18:24因为r-l最大1e9,也就是说你需要循环1e9次,开o2最大也就能跑1e8
- 1
Information
- ID
- 298
- Time
- ms
- Memory
- MiB
- Difficulty
- 2
- Tags
- # Submissions
- 9182
- Accepted
- 5396
- Uploaded By