Advertisement
Alexvans

Untitled

Jul 2nd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #define MAX 50002
  3. using namespace std;
  4.  
  5. int n;
  6. vector<pair<int, string> > cola[26];
  7.  
  8. int main() {
  9.     ios_base::sync_with_stdio(0);
  10.     cin.tie(0);
  11.     cout.tie(0);
  12.  
  13.     cin >> n;
  14.     while(n--) {
  15.         char op;
  16.         cin >> op;
  17.         if(op == 'C') {
  18.             int prioridad;
  19.             string nombre;
  20.             cin >> nombre >> prioridad;
  21.             int idx = nombre[0] - 65;
  22.             auto it = upper_bound(cola[idx].begin(), cola[idx].end(), make_pair(prioridad, string())) - cola[idx].begin();
  23.             cola[idx].insert(it, make_pair(prioridad, nombre));
  24.         }
  25.         else if(op == 'S') {
  26.  
  27.         }
  28.         else if(op == 'A') {
  29.  
  30.         }
  31.     }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement