Mahmoud_Hawara

Contest #1 - Solution

Nov 14th, 2025
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.56 KB | None | 0 0
  1. ////////////////////////////////////////// PROBLEM - A //////////////////////////////////////////
  2. #include <bits/stdc++.h>
  3. #define ll long long
  4. using namespace std;
  5.  
  6. void solve()
  7. {
  8.     int n, m;
  9.     cin >> n >> m;
  10.     if (n == m) cout << "Yes";
  11.     else cout << "No";
  12. }
  13. int main()
  14. {
  15.     int t = 1;
  16.     // cin >> t;
  17.     for (int i = 1; i <= t; i++)
  18.     {
  19.         solve();
  20.     }
  21.     return 0;
  22. }
  23.  
  24.  
  25.  
  26. ////////////////////////////////////////// PROBLEM - B //////////////////////////////////////////
  27. #include <bits/stdc++.h>
  28. #define ll long long
  29. using namespace std;
  30.  
  31. void solve()
  32. {
  33.     int n, r;
  34.     cin >> n >> r;
  35.     if (n > 10) cout << r;
  36.     else cout << r + 100 * (10 - n);    
  37. }
  38. int main()
  39. {
  40.     int t = 1;
  41.     // cin >> t;
  42.     for (int i = 1; i <= t; i++)
  43.     {
  44.         solve();
  45.     }
  46.     return 0;
  47. }
  48.  
  49.  
  50.  
  51. ////////////////////////////////////////// PROBLEM - C //////////////////////////////////////////
  52. #include <bits/stdc++.h>
  53. #define ll long long
  54. using namespace std;
  55.  
  56. void solve()
  57. {
  58.     ll a, b, c, d;
  59.     cin >> a >> b >> c >> d;
  60.     if (b * log(a) > d * log(c)) cout << "YES";
  61.     else cout << "NO";
  62. }
  63. int main()
  64. {
  65.     int t = 1;
  66.     // cin >> t;
  67.     for (int i = 1; i <= t; i++)
  68.     {
  69.         solve();
  70.     }
  71.     return 0;
  72. }
  73.  
  74.  
  75.  
  76. ////////////////////////////////////////// PROBLEM - D //////////////////////////////////////////
  77. #include <bits/stdc++.h>
  78. #define ll long long
  79. using namespace std;
  80.  
  81. void solve()
  82. {
  83.     int x;
  84.     cin >> x;
  85.     if (x < -4) cout << x + 5;
  86.     else if (x <= 7) cout << x * x - 3 * x;
  87.     else cout << x * x * x + 2 * x;
  88. }
  89. int main()
  90. {
  91.     int t = 1;
  92.     // cin >> t;
  93.     for (int i = 1; i <= t; i++)
  94.     {
  95.         solve();
  96.     }
  97.     return 0;
  98. }
  99.  
  100.  
  101.  
  102. ////////////////////////////////////////// PROBLEM - E //////////////////////////////////////////
  103. #include <bits/stdc++.h>
  104. #define ll long long
  105. using namespace std;
  106.  
  107. void solve()
  108. {
  109.     int x, y, z;
  110.     cin >> x >> y >> z;
  111.     if (x + y > z && x + z > y && y + z > x) cout << "YES";
  112.     else cout << "NO";
  113. }
  114. int main()
  115. {
  116.     int t = 1;
  117.     // cin >> t;
  118.     for (int i = 1; i <= t; i++)
  119.     {
  120.         solve();
  121.     }
  122.     return 0;
  123. }
  124.  
  125.  
  126.  
  127. ////////////////////////////////////////// PROBLEM - F //////////////////////////////////////////
  128. #include <bits/stdc++.h>
  129. #define ll long long
  130. using namespace std;
  131.  
  132. void solve()
  133. {
  134.     int n;
  135.     cin >> n;
  136.     cout << n * (n + 1) / 2;
  137. }
  138. int main()
  139. {
  140.     int t = 1;
  141.     // cin >> t;
  142.     for (int i = 1; i <= t; i++)
  143.     {
  144.         solve();
  145.     }
  146.     return 0;
  147. }
Advertisement
Add Comment
Please, Sign In to add comment