https://codeforces.com/gym/580226/problem/D
#include<bits/stdc++.h>
#define lc p<<1
#define rc p<<1|1
#define INF 2e9
using namespace std;
#define endl '\n'
using ll = long long;
using pii = pair<ll, ll>;
const double PI = acos(-1);
const int N=2e5+10;
ll a[N];
void solve(){
int n;cin>>n;
for(int i=0;i<n;i++)
{
cin>>a[i];
}
ll ans=1e18;//0x3f3f3f是int类型的最大,要用1e18
int num=0;
for(int i=0;i<n;i++){
ll t=ceil((a[i]-i)*1./n);
ll sum=i+t*n;
if(sum<ans) {
ans=sum;
num=i;
}
}
cout<<num+1;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr), cout.tie(nullptr);
int T = 1;
// cin>>T;
while (T--) {
solve();
}
return 0;
}
标签:const,1e18,int,ll,循环,solve
From: https://www.cnblogs.com/laileou/p/18666948