Advertisement
Bassel_11

Untitled

Mar 18th, 2023
898
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.58 KB | None | 0 0
  1. /*
  2.  ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠄⠒⠌⠔⣱⣒⣀⣄⡀⠀⠀⠒⠁⠛⠑⠆⠀⠊⠀⠠⠢⢰⠀⠀⠀⣀⡤⢖⣽⣾⣾⣿⣿⡿⣿⣿
  3.  ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠂⠀⠀⠀⠀⠀⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠨⠤⢴⣾⣴⣾⣿⣿⢿⣿⣿⣿⣿⡿⠟
  4.  ⠀⠀⠀⠀⠀⠀⠀⠀⢀⠈⠄⠀⢀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠠⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⣿⣷⣿⣻⣿⣿⡿⠛⠁⡀⠄
  5.  ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⡈⠁⣀⠡⠀⡁⠄⢤⡆⠀⡤⠀⡠⠀⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠺⢿⣿⡿⠟⠋⠁⢀⠀⢂⠀⠄
  6.  ⠀⠀⠀⠀⠀⠀⠀⠰⣒⠊⠁⠠⢀⠢⢁⠐⢆⡰⢯⡊⣆⠄⣀⣀⢀⡕⢀⠔⠀⢰⠂⠀⢀⠀⠀⠀⠀⠀⠀⢖⠋⠀⠠⠐⠈⡀⠐⡀⠄⠂
  7.  ⠀⠀⠀⠀⠀⠀⠀⢀⣤⣛⠠⣑⡏⣰⡿⢺⢟⡭⠉⠙⡿⠐⢥⠀⠀⠀⠀⠀⠀⠈⢂⠐⠈⠀⠀⠀⠀⠀⠀⢢⡉⠠⠁⠐⠠⠐⠀⠄⠐⡀
  8.  ⠀⠀⠀⠀⠀⠀⠀⣀⠔⠁⠠⢔⠣⢌⠢⡍⠈⠀⠀⠀⢠⠀⠀⠀⠀⠀⠄⠐⡄⠀⠀⠆⠀⠀⠀⠀⢀⢀⠠⡤⠽⠂⢀⠡⠐⠀⠡⠐⢀⠀
  9.  ⠀⠀⠀⠀⠀⠀⠀⠉⠉⡹⠀⣤⠣⢌⢢⡁⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠆⠀⢲⡀⠀⢠⠀⠂⠀⢔⣥⡛⢤⣶⣤⣐⠀⡀⠂⢁⠐⠀⠂⡀
  10.  ⠀⠀⠀⠀⠀⠀⠀⠀⠴⠕⡇⢎⡗⣈⡲⠁⠀⠀⢀⡇⢸⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⢼⠀⠀⢀⡞⣥⣸⣜⣿⣳⠿⣮⣥⣶⣤⣂⠁⠐⠀
  11.  ⠀⠀⠀⠀⠀⠀⠀⠀⢠⢴⣃⢸⣏⢍⣛⢣⡀⠀⠈⠳⢈⠀⠀⠀⠀⣀⠼⡤⠄⠈⠀⠀⠀⣾⢫⣟⣖⢸⣿⣿⣿⣻⡵⢯⣿⣿⣆⠉⠳⣶
  12.  ⠴⢻⡒⢦⣠⣀⠤⢔⠈⢀⡀⢿⠽⡜⠟⠻⠿⠓⢤⣄⠘⢱⣤⡶⣛⣁⣤⣇⣠⡤⠀⠀⠀⡧⣾⣟⡿⢸⢛⢿⣿⣷⣻⢻⡾⣍⢏⠳⣄⠈
  13.  ⠀⠀⠙⠃⠢⢈⠧⡀⢳⡀⢱⡀⢶⢣⡣⢍⢩⡘⠯⢽⠀⠘⠁⠒⠈⠉⠉⢛⠉⠀⠀⠀⠀⣧⡞⣯⣼⡯⢌⠎⣿⣷⢯⣟⡽⣿⢘⣿⣿⣷
  14.  ⠀⠀⠀⠀⠀⠉⠰⠌⡆⣷⠈⡆⠉⢰⣷⣊⠴⠡⠎⡽⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⢾⢻⣿⢹⠀⠈⢎⣿⣿⣻⢮⣟⣧⣿⣿⣿⢿
  15.  ⡼⡳⡄⢀⡶⡀⠨⡁⠓⡄⡒⣏⣾⢻⣽⣷⡊⡕⢣⠹⢤⡤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⢟⣸⢿⢸⢀⠀⠘⣿⣿⣽⣻⢾⣽⡏⡕⣯⠞
  16.  ⣙⠻⣧⢸⣗⣣⠀⢸⣴⣷⡟⣯⠷⠛⣼⡿⣿⡜⢤⠓⣼⠤⠄⠀⠠⠀⡀⠀⠀⠀⣠⠔⡱⣪⠞⠘⠈⠁⠀⠀⣿⣿⡷⣯⣟⣾⣗⢷⢸⡹
  17.  ⠈⣽⡟⠈⠷⠏⢠⣟⣿⠗⠋⠁⠀⣼⡿⣽⣳⣿⣦⡙⣌⢒⠲⠲⠤⠀⠀⢀⡤⡚⡔⣊⡱⠋⡂⠀⠀⠀⠀⠀⣽⣿⣟⣷⣻⣞⣿⣸⠀⣹
  18.  ⣴⡿⠗⣦⡀⠀⢠⡟⠁⠀⠀⠀⣼⡿⣽⣳⣿⣿⣿⣧⣜⢢⡆⣀⣀⡴⠞⣍⠲⡱⢘⡤⠁⡜⠀⠀⠀⡄⠀⠀⣾⣿⣿⣳⣟⣾⣻⣏⠀⢰
  19.  ⡟⡴⢂⠈⢧⠜⣫⣾⣶⣄⠀⣸⣿⣽⣳⣯⣿⣿⣿⣿⣿⣏⠹⣹⣶⣉⠞⣠⢣⡕⠉⢀⣼⠃⠀⠀⠀⣻⡄⠀⣻⣿⣿⣿⣞⣷⣻⢿⣿⣦
  20.  ⣇⠐⠠⡱⢢⣾⣿⣽⣟⣾⣷⣿⣳⢯⣷⡿⢸⣿⣿⣿⣿⣇⢣⠧⡈⠅⠉⠉⠁⠀⢀⣜⠆⠀⠀⠀⠀⢹⡜⣄⣻⣿⣿⣿⣞⡷⣯⣿⣿⣻
  21.  ⢳⣭⠟⡠⣹⣿⣿⣟⣾⣿⣟⣷⣻⣯⣿⠋⢸⣿⣿⣿⣿⡷⢮⠥⢹⣆⠀⠀⠀⣔⣣⠾⠔⠒⠒⠚⠉⠉⠁⢀⣿⣿⣿⣿⣿⡽⣷⢯⣿⣿
  22.  ⠀⣿⣸⣴⣿⣿⣳⣿⣿⣳⡿⣾⣽⣯⢻⠀⢸⣿⣿⣿⣿⣇⠻⠀⠀⠈⠁⠀⠈⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣻⣟⣷⣿
  23.  ⣾⣿⣿⣿⣿⣽⣿⣟⣾⢿⣽⠟⣹⠁⢸⠀⢸⣿⣿⣿⣿⡇⣏⠀⠀⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣄⡄⣿⣿⣿⣿⣿⣿⣿⣷⢿⣻⣾
  24.  ⣿⣿⣿⣿⡿⣯⣷⡿⣯⡿⠋⠀⠀⠀⣸⠀⠰⣿⣿⣿⣿⣏⠼⠀⠀⠀⢰⠀⠀⠀⠀⠀⠀⠀⠀⢀⡄⠀⢠⣿⣿⣿⣿⣿⣿⠇⠻⣟⣯⣿
  25.  ⣿⣿⣿⢯⣿⡿⣽⡿⠟⡃⠀⡀⠀⠀⡆⠀⠀⣿⣿⣿⣿⡧⢫⡅⠀⠀⠈⡄⠀⠀⠀⠀⠀⠀⠸⠃⠂⠀⣾⣿⣿⣿⣿⣿⡟⠀⡠⢹⢻⣿
  26.  ⣿⣿⣽⣿⣿⠝⠁⠀⠀⢧⠀⡆⠀⠀⠀⠀⠀⣿⣿⣿⣿⣗⢣⢞⣄⠀⠀⢟⣆⠀⠀⠀⢠⠜⠁⠀⠀⣸⣿⣿⣿⣿⣿⡿⠁⠀⢇⢸⠀⠙
  27.  */
  28. // IAM Batman
  29. //           Vengeance
  30. //                    Maybe im the problem
  31. #include <bits/stdc++.h>
  32. #define ll long long
  33. #define Time cerr << "Time Taken: " << (float)clock() / CLOCKS_PER_SEC << " Secs" \<< "\n";
  34. #define ln cout << endl;
  35. #define c(n) cout << n;
  36. #define fix cout << fixed << setprecision(6);
  37. #define sz(x) int(x.size())
  38. #define loop(n) for (int i = 0; i < n; i++)
  39. #define loop1(n) for (int i = 1; i <= n; i++)
  40. #define vi vector<int>
  41. #define vll vector<long long>
  42. #define all(s) s.begin(), s.end()
  43. #define srt(arr, n) sort(arr, arr + n);
  44. #define prefixsum(arr, n)        \
  45.     for (int i = 1; i <= n; i++) \
  46.     {                            \
  47.         arr[i] += arr[i - 1];    \
  48.     }
  49. #define upper(s) transform(all(s), s.begin(), ::toupper);
  50. #define lower(s) transform(all(s), s.begin(), ::tolower);
  51. #define pi 3.141592653
  52. #define pb push_back
  53. #define vc vector<char>
  54.  
  55. using namespace std;
  56.  
  57. void Bassel()
  58. {
  59.     ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  60. #ifndef ONLINE_JUDGE
  61.     freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  62. #endif
  63. }
  64.  
  65. void solve()
  66. {
  67.     queue<int> q;
  68.     int t;
  69.     cin >> t;
  70.     while (t--)
  71.     {
  72.         int a, b;
  73.         cin >> a >> b;
  74.         if (a == 1)
  75.             q.push(b);
  76.         else if (a == 2)
  77.         {
  78.             if (b == q.front())
  79.                 cout << "YES\n";
  80.         }
  81.         else
  82.             cout << "NO\n";
  83.         q.pop();
  84.     }
  85. }
  86.  
  87. int main()
  88. {
  89.     Bassel();
  90.     queue<int> q;
  91.     int t;
  92.     cin >> t;
  93.     for(int i=0; i<t; i++)
  94.     {
  95.         int a, b;
  96.         cin >> a >> b;
  97.         if (a == 1)q.push(b);
  98.         else if (a == 2)
  99.         {
  100.             if (b == q.front())
  101.                 cout << "YES\n";
  102.         }
  103.         else
  104.             cout << "NO\n";
  105.         q.pop();
  106.     }
  107.  
  108.     return 0;
  109. }
  110.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement