Korotkodul

физтех 4

Jan 29th, 2022 (edited)
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <vector>
  4. #include <queue>
  5. #include <algorithm>
  6. #include <string>
  7. #include <stack>
  8. #include <set>
  9. #include <map>
  10. #define pii pair <int,int>
  11. #define vec vector
  12. using namespace std;
  13. using ll = long long;
  14. using ld = long double;
  15. using db = double;
  16. void cv(vector <int> &v){
  17. for (auto x: v) cout<<x<<' ';
  18. cout<<"\n";
  19. }
  20.  
  21. void cvl(vector <ll> &v){
  22. for (auto x: v) cout<<x<<' ';
  23. cout<<"\n";
  24. }
  25.  
  26.  
  27. void cvv(vector <vector <int> > &v){
  28. for (auto x: v) cv(x);
  29. cout<<"\n";
  30. }
  31.  
  32. void cvb(vector <bool> v){
  33. for (bool x: v) cout<<x<<' ';
  34. cout<<"\n";
  35. }
  36.  
  37. ll div(ll x){
  38. ll res=0;
  39. for (ll k = 1; k <= x;++k){
  40. if (x%k==0) res++;
  41. }
  42. return res;
  43. }
  44.  
  45. bool ok(ll n){
  46. if (div(n) != 14) return 0;
  47. ll m = 11584 - n;
  48. if (div(m) != 14) return 0;
  49. if (m*m*m % n == 0) return 1;
  50. return 0;
  51. }
  52.  
  53. void sh(ll n){
  54. ll m = 11584 - n;
  55. cout<<"n m = "<<n<<' '<<m<<"\n";
  56. cout<<"n\n";
  57. for (ll k = 1; k <= n; ++k){
  58. if (n%k==0)cout<<k<<' ';
  59. }cout<<"\n";
  60. cout<<"m\n";
  61. for (ll k = 1; k <= m;++k){
  62. if (m%k==0)cout<<k<<' ';
  63. }cout<<"\n";
  64. cout<<"m^3 = "<<m*m*m<<"\n";
  65. cout<<"m^3 / n = "<<(m*m*m / n)<<"\n";
  66. cout<<"(m^3 / n) * n = " <<(m*m*m / n) * n<<"\n";
  67. }
  68.  
  69. int main()
  70. {
  71. ios::sync_with_stdio(0);
  72. cin.tie(0);
  73. cout.tie(0);
  74. vector<ll>ans;
  75. for (ll i = 0; i <= 12e3;++i){
  76. if (ok(i)){
  77. ans.push_back(i);
  78. }
  79. }
  80. cout<<"ans\n";
  81. cvl(ans);
  82. sh(ans[0]);
  83. }
  84.  
Add Comment
Please, Sign In to add comment