Language: C++

#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <iostream>
using namespace std;

#define rp(i,t) for(int i=0;i<(t);i++)
#define rep(i,s,t) for(int i=(s);i<=(t);i++)
#define rsp(i,s,t) for(int i=(s);i<(t);i++)
#define rrp(i,t,s) for(int i=(t);i>=(s);i--)
#define rcp(i,s,b,d) for(int i=(s);b;d)
#define mst(a,x) memset(a,x,sizeof(a))
#define INF 0x3f3f3f3f
#define N 1002
#define MOD 1000000007

#define Dp puts("")
#define Dw printf
#define Ds printf("#")

typedef long long ll;
bool itp[N];
char ch;
int n,P[N],num,next[N];
ll c[N],ans;

inline void read(int &x){x=0;do{ch=getchar();}while(ch<'0'||'9'<ch);do{x=x*10+ch-'0';ch=getchar();}while('0'<=ch&&ch<='9');}

inline void PrimeBuild(void)
{
	itp[1]=true;
	rep(i,2,1001)
	{
		if(!itp[i])P[++num]=i;
		rcp(j,1,j<=num&&i*P[j]<=1001,j++)
		{
			itp[i*P[j]]=true;
			if(i%P[j]==0)break;
		}
	}
	rep(i,1,1001)if(itp[i-1])next[i]=next[i-1];else next[i]=i-1;
}

inline void slv(int x)
{
	for(int i=next[x+1];i;i=next[i])
		while(x%i==0)x/=i,c[i]++;
}

int main(void)
{
	PrimeBuild();
	read(n);
	ans=1;
	rep(i,1,n)slv(i);
	rep(i,1,n)ans=ans*(c[i]+1)%MOD;
	printf("%lld",ans);
	return 0;
}


Compiler output:
a.cc: In function 'void PrimeBuild()':
a.cc:42:34: error: reference to 'next' is ambiguous
   42 |         rep(i,1,1001)if(itp[i-1])next[i]=next[i-1];else next[i]=i-1;
      |                                  ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
                 from /usr/include/c++/14/bits/specfun.h:43,
                 from /usr/include/c++/14/cmath:3906,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:25:16: note:                 'int next [1002]'
   25 | int n,P[N],num,next[N];
      |                ^~~~
a.cc:42:42: error: reference to 'next' is ambiguous
   42 |         rep(i,1,1001)if(itp[i-1])next[i]=next[i-1];else next[i]=i-1;
      |                                          ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:25:16: note:                 'int next [1002]'
   25 | int n,P[N],num,next[N];
      |                ^~~~
a.cc:42:57: error: reference to 'next' is ambiguous
   42 |         rep(i,1,1001)if(itp[i-1])next[i]=next[i-1];else next[i]=i-1;
      |                                                         ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:25:16: note:                 'int next [1002]'
   25 | int n,P[N],num,next[N];
      |                ^~~~
a.cc: In function 'void slv(int)':
a.cc:47:19: error: reference to 'next' is ambiguous
   47 |         for(int i=next[x+1];i;i=next[i])
      |                   ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:25:16: note:                 'int next [1002]'
   25 | int n,P[N],num,next[N];
      |                ^~~~
a.cc:47:33: error: reference to 'next' is ambiguous
   47 |         for(int i=next[x+1];i;i=next[i])
      |                                 ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:25:16: note:                 'int next [1002]'
   25 | int n,P[N],num,next[N];
      |                ^~~~