吾有疑问...
查看原帖
吾有疑问...
582118
ZHR20100222楼主2022/8/11 14:58

去年在考场上写了4个小时的蒟蒻...

#include <iostream>
#include <cstdio>
using namespace std;
int k;
long long L,R;
int n;
int main(){
    cin>>n>>L>>R;
    if((n<=L<=R)&&(k<=L<=R)){
        for(int k;k>=n;k-n){
            k--;
            cout<<k<<endl;
        }
    }else if(L<=k<=R){//14=L≤k≤R=18
    cout<<R-L<<endl;
    }
    return 0;
}

不知道去年怎么想的

今年一改40分,不知道我的哪一块理解错了

#include<bits/stdc++.h>
using namespace std;
long long n,l,r,a[100000050],MAX=INT_MIN,i;
int main(){
	cin>>n>>l>>r;
	for(i=l;i<=r;i++){
		a[i]=i%n;
	}
	for(i=l;i<=r;i++){
		if(MAX<a[i]){
			MAX=a[i];
		}
	}
	cout<<MAX;
	return 0;
}
2022/8/11 14:58
加载中...