Advertisement
erfanul007

Untitled

Jan 11th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef long long int ll;
  5. typedef unsigned long long int ull;
  6. typedef vector<int> vi;
  7. typedef vector<ll> vll;
  8. typedef vector<vi> vvi;
  9. typedef pair<ll,ll> pll;
  10. typedef vector< pll > vpll;
  11. typedef set<int> sti;
  12.  
  13. #define pb push_back
  14. #define pob pop_back
  15. #define mp make_pair
  16. #define ff first
  17. #define ss second
  18. #define loop1(i,n) for(int i=1; i<=int(n); i++)
  19. #define loop(i,y) for(int i=0; i<int(y); i++)
  20. #define rloop(i,y) for(int i=int(y); i>0; i--)
  21. #define rloop1(i,y) for(int i=int(y)-1; i>=0; i--)
  22. #define read() freopen("input.txt", "r", stdin)
  23. #define write() freopen("output.txt", "w", stdout)
  24. #define cspf(i) printf("Case %d: ", i)
  25. /// Constants
  26. #define eps 1e-9
  27. #define PI acos(-1.0) // 3.1415926535897932
  28.  
  29. int main()
  30. {
  31. int n,x,y,tm,sz,fl,mx=0,my=0;
  32. char a,no[10],yes[10];
  33. strcpy(yes,"YES");
  34. strcpy(no,"NO");
  35. cin>>n;
  36. loop(i,n){
  37. scanf(" %c %d %d",&a,&x,&y);
  38. if(x<y)
  39. swap(x,y);
  40. if(a=='+'){
  41. mx=max(mx,x);
  42. my=max(my,y);
  43. }
  44. if(a=='?'){
  45. if(x>=mx && y>=my)
  46. printf("YES\n");
  47. else
  48. printf("NO\n");
  49. }
  50. }
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement