fork download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <vector>
  4. #include <string.h>
  5. #include <bits/stdc++.h>
  6. #include <cstdlib>
  7. #include <time.h>
  8. #include <fstream>
  9. #include <iterator>
  10. #include <utility>
  11. #include <algorithm>
  12. #include <set>
  13. #include <map>
  14. #include <bitset>
  15.  
  16.  
  17. using namespace std;
  18.  
  19. #define ll long long
  20. #define ull unsigned ll
  21. #define ld long double
  22. typedef vector<int> vi;
  23. typedef multiset<int> mi;
  24. typedef multiset<ll> mll;
  25. typedef vector<ll> vll;
  26. typedef vector<bool> vb;
  27. typedef vector<string> vs;
  28. typedef vector<vector<int>> _2vi;
  29. typedef vector<vector<ll>> _2vll;
  30. #define all(v) ((v).begin()), ((v).end())
  31. #define sz(v) ((ll)((v).size()))
  32.  
  33. #define vinp(v, n) \
  34.   for (ull i = 0; i < (n); i++) \
  35.   cin >> (v)[i]
  36. #define printv(v) \
  37.   for (auto i : (v)) \
  38.   cout << i << " "
  39. #define fr0(i, n) for (ull(i) = 0; (i) < (n); (i)++)
  40. #define fr1(i, n) for (ull(i) = 1; (i) < (n); (i)++)
  41. #define fr(i, x, n) for (ull(i) = (x); (i) < (n); (i)++)
  42. #define _CRT_SECURE_NO_WARNING
  43. const ll MOD = 1000000007;
  44.  
  45. void Bustany() {
  46. ios_base::sync_with_stdio(false);
  47. cin.tie(NULL);
  48. cout.tie(NULL);
  49. #ifndef ONLINE_JUDGE
  50. freopen("./in.txt", "r", stdin), freopen("./out.txt", "w", stdout);
  51. #endif
  52. }
  53.  
  54. void solve() {
  55. ll a,b;
  56. cin >> a >> b;
  57. //a pos and b neg
  58. //a pos and b pos to long long max a+b>Long long max a>long long max-b
  59. //a neg and b neg to long long min a+b<long long min a<long long min -b
  60. if(a>0 && b>0 && a>LONG_LONG_MAX-b){
  61. cout << "YES";
  62. }
  63. else if(a<0 && b<0 && a<LONG_LONG_MIN-b){
  64. cout << "YES";
  65. }
  66. else{
  67. cout << "NO";
  68. }
  69. }
  70.  
  71. int main() {
  72. Bustany();
  73. ll t = 1;
  74. // cin >> t;
  75. while (t--) {
  76. solve();
  77. }
  78. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
NO