fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define int long long
  4. #define fi first
  5. #define se second
  6. #define siz(x) (int)(x.size())
  7. #define all(x) x.begin(), x.end()
  8. #define debug_arr(x,len) for(int _=1; _<=len; _++) cout<<x[_]<<" "; cout<<'\n';
  9. #define debug(x) cout<<'\n'<<#x<<": "<<x<<'\n';
  10. const int maxN=1e4+5;
  11.  
  12. int n, a[maxN], good[maxN], dp[maxN];
  13. vector<int>snt, uoc_nt[maxN], uoc_bt[maxN];
  14. int mp[maxN], cnt[maxN];
  15.  
  16. void sieve()
  17. {
  18. for(int i=2; i<=1e4; i+=1) good[i]=1;
  19. for(int i=2; i<=1e4; i+=1)
  20. {
  21. if(good[i])
  22. {
  23. for(int j=i*2; j<=1e4; j+=i) good[j]=0;
  24. }
  25. }
  26. for(int i=2; i<=1e4; i+=1)
  27. {
  28. if(good[i]) snt.push_back(i);
  29. }
  30. }
  31.  
  32. int C2(int x)
  33. {
  34. if(x<2) return 0;
  35. int res=1ll*x*(x-1)/2ll;
  36. return res;
  37. }
  38.  
  39. int C4(int x)
  40. {
  41. if(x<4) return 0;
  42. int res=1ll*x;
  43. res=1ll*res*(x-1);
  44. res=1ll*res*(x-2);
  45. res=1ll*res*(x-3);
  46. res=res/24;
  47. return res;
  48. }
  49.  
  50. void solve()
  51. {
  52.  
  53. }
  54.  
  55. int32_t main()
  56. {
  57. ios_base::sync_with_stdio(0); cin.tie(0);
  58. // sieve();
  59. while(cin>>n);
  60. {
  61. cout<<n<<'\n';
  62. // for(int i=1; i<=1e4; i+=1)
  63. // {
  64. // mp[i]=cnt[i]=dp[i]=0;
  65. // }
  66. // for(int i=1; i<=n; i+=1) cin>>a[i], cnt[a[i]]++, cout<<a[i]<<'\n';
  67. // for(int i=1; i<=1e4; i+=1)
  68. // {
  69. // for(int j=i; j<=1e4; j+=i)
  70. // {
  71. // mp[i]+=cnt[j];
  72. // }
  73. // }
  74. // // cout<<C4(mp[1])<<'\n';
  75. // for(int i=1e4; i>=1; i-=1)
  76. // {
  77. // int maxJ=1e4/i*i;
  78. // int tmp=0;
  79. // for(int j=maxJ; j>=i; j-=i)
  80. // {
  81. // dp[i]=max(0ll, C4(mp[j])-tmp);
  82. // tmp+=dp[j];
  83. // // cout<<j<<" "<<dp[j]<<'\n';
  84. // }
  85. // }
  86. // cout<<dp[1];
  87. }
  88. }
  89.  
  90. // dp[i] la so cap co gcd = 1
Success #stdin #stdout 0.01s 5284KB
stdin
4  
2 3 4 5 
4 
2 4 6 8 
7 
2 3 4 5 7 6 8 
stdout
8