Language: C++

# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iostream>
# include <vector>
# include <queue>
# include <stack>
# include <map>
# include <set>
# include <cmath>
# include <algorithm>
using namespace std;
# define lowbit(x) ((x)&(-x))
# define pi acos(-1.0)
# define eps 1e-3
# define MOD 1000000007
# define INF 1000000000
# define mem(a,b) memset(a,b,sizeof(a))
# define FOR(i,a,n) for(int i=a; i<=n; ++i)
# define FO(i,a,n) for(int i=a; i<n; ++i)
# define bug puts("H");
# define lch p<<1,l,mid
# define rch p<<1|1,mid+1,r
# define mp make_pair
# define pb push_back
typedef pair<int,int> PII;
typedef vector<int> VI;
# pragma comment(linker, "/STACK:1024000000,1024000000")
typedef long long LL;
int Scan() {
    int res=0, flag=0;
    char ch;
    if((ch=getchar())=='-') flag=1;
    else if(ch>='0'&&ch<='9') res=ch-'0';
    while((ch=getchar())>='0'&&ch<='9')  res=res*10+(ch-'0');
    return flag?-res:res;
}
void Out(int a) {
    if(a<0) {putchar('-'); a=-a;}
    if(a>=10) Out(a/10);
    putchar(a%10+'0');
}
const int N=100005;
//Code begin...

int a[N], b[N];

int main ()
{
    int n, mii=INF, lll=INF;
    LL sum=0;
    scanf("%d",&n);
    LL yin=(LL)n*(n+1)/2;
    FOR(i,1,n) scanf("%d",a+i), lll=min(lll,a[i]/yin);
    FOR(i,1,n) a[i]-=lll*yin, sum+=a[i], mii=min(mii,a[i]);
    if (n==1) {puts("YES"); return 0;}
    int mi=INF;
    FOR(i,1,n) {
        if (i==1) b[1]=a[1]-a[n];
        else b[i]=a[i]-a[i-1];
        mi=min(mi,b[i]);
    }
    if (sum%yin || -mi/(1-n)>mii) {puts("NO"); return 0;}
    int flag=1;
    FOR(i,1,n) {
        b[i]-=mi;
        if (b[i]%n) {flag=0; break;}
    }
    puts(flag?"YES":"NO");
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:40: error: no matching function for call to 'min(int&, LL)'
   54 |     FOR(i,1,n) scanf("%d",a+i), lll=min(lll,a[i]/yin);
      |                                     ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:54:40: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'LL' {aka 'long long int'})
   54 |     FOR(i,1,n) scanf("%d",a+i), lll=min(lll,a[i]/yin);
      |                                     ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:11:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:54:40: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   54 |     FOR(i,1,n) scanf("%d",a+i), lll=min(lll,a[i]/yin);
      |                                     ~~~^~~~~~~~~~~~~~