#2091. 「2021 CSP-J」分糖果(candy)哪里错了啊?

ykj04 Hi 2022-05-17 21:17:16 0
#include<bits/stdc++.h>
using namespace std;
int a[1000000];
int main(){
	freopen("candy.in","r",stdin);
	freopen("candy.out","w",stdout);
	long long int n,l,r;
	cin >> n >> l >> r;
	for (int i=l;i<=r;i++)
	{
		a[i]=i%n;
	}
	sort(a+1,a+1+r);
	cout << a[r];
}
{{ vote && vote.total.up }}

共 1 条回复

ykj04 Hi

有Runtime Error