P7909为什么90pts?(暴力枚举)
  • 板块题目总版
  • 楼主Lzc0207
  • 当前回复1
  • 已保存回复1
  • 发布时间2024/12/14 13:25
  • 上次更新2024/12/14 16:23:04
查看原帖
P7909为什么90pts?(暴力枚举)
1387624
Lzc0207楼主2024/12/14 13:25

代码如下:

#include <bits/stdc++.h>
using namespace std;
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n,l,r,ans=-1;
	cin>>n>>l>>r;
	for (int i=r;i>=l;i--)
		ans=max(ans,i%n);
	cout<<ans;
	return 0;
}
2024/12/14 13:25
加载中...