fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define fi first
  4. #define se second
  5. #define all(x) (x).begin(), (x).end()
  6. #define MASK(i) (1LL << (i))
  7. #define BIT(i,n) (((n) >> (i)) & 1LL)
  8.  
  9. typedef long long ll;
  10. typedef pair<int, int> pii;
  11.  
  12. template <class X, class Y> bool mini(X& x, const Y& y) {
  13. if(x > y){ x = y; return 1; }
  14. return 0;
  15. }
  16.  
  17. template <class X, class Y> bool maxi(X& x, const Y& y) {
  18. if(x < y){ x = y; return 1; }
  19. return 0;
  20. }
  21.  
  22. const ll MOD = 1e9 + 7;
  23. const int N = 1e7 + 5;
  24.  
  25. int n, f[N], cnt[N];
  26. ll ans = 1;
  27.  
  28. ll bpw(ll x, ll m)
  29. {
  30. ll res = 1;
  31. x %= MOD;
  32. while(m){
  33. if(m & 1) res = res * x % MOD;
  34. x = x * x % MOD, m >>= 1;
  35. }
  36. return res;
  37. }
  38.  
  39. void sieve()
  40. {
  41. for(int i = 1; i < N; ++i) f[i] = i;
  42. for(int i = 4; i < N; ++i)
  43. while(f[i] % 4 == 0) f[i] /= 4;
  44. for(int i = 3; i * i < N; i += 2){
  45. if(f[i] != i) continue;
  46. for(int j = i * i, i2 = j; j < N; j += i << 1)
  47. while(f[j] % i2 == 0) f[j] /= i2;
  48. }
  49. }
  50.  
  51. int main()
  52. {
  53. ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
  54.  
  55. sieve();
  56.  
  57. cin >> n;
  58. for(int i = 1; i <= n; ++i){
  59. ++cnt[f[i]];
  60. }
  61.  
  62. for(int i = 1; i <= n; ++i) if(cnt[i])
  63. ans = (ans * (cnt[i] + 1)) % MOD;
  64.  
  65. cout << ans << "\n";
  66.  
  67. return 0;
  68. }
  69.  
Success #stdin #stdout 0.16s 43944KB
stdin
Standard input is empty
stdout
1