CSP-J T1
  • 板块学术版
  • 楼主wangzl
  • 当前回复4
  • 已保存回复4
  • 发布时间2021/10/23 15:31
  • 上次更新2023/11/4 02:41:19
查看原帖
CSP-J T1
222039
wangzl楼主2021/10/23 15:31

这代码能满分吗?

#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdlib>
#include<stack>
#include<queue>
#include<set>
#include<iomanip>
#include<vector>
#include<algorithm>
using namespace std;
int n, l, r; 
inline int read() {
	int s = 0;
	char ch = getchar();
	while(ch < '0' || ch > '9') ch = getchar();
	while(ch >= '0' && ch <= '9') {
		s = (s << 3) + (s << 1) + (ch ^ 48);
		ch = getchar();
	}
	return s;
}
int main()
{
	n = read(), l = read(), r = read();
	if(l / n == r / n) 
	    printf("%d", r % n);
	else
	    printf("%d", n - 1);
	return 0;
}

2021/10/23 15:31
加载中...