Advertisement
LEGEND2004

deque

Feb 22nd, 2024
1,170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #pragma GCC optimize("O3")
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4.  
  5. #define int long long
  6. #define fastio ios_base::sync_with_stdio(0); cin.tie(0)
  7. const int N = 1e6 + 5;
  8.  
  9. signed main()
  10. {
  11.     fastio;
  12.     /*
  13.     deque<int> q;
  14.     q.size();
  15.     q.empty();
  16.  
  17.     q.back();
  18.     q.push_back();
  19.     q.pop_back();
  20.  
  21.     q.front();
  22.     q.push_front();
  23.     q.pop_front();
  24.     */
  25.     deque<int> q;
  26.     q.push_front(5);
  27.     q.push_back(2);
  28.     q.push_front(7);
  29.     for(int i = 0; i < q.size(); i++){
  30.         cout << q[i] << " ";
  31.     }
  32.     cout << '\n';
  33.     // 7 5 2
  34.  
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement