Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define MAX 50002
- using namespace std;
- int n;
- vector<pair<int, string> > cola[26];
- int main() {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- cin >> n;
- while(n--) {
- char op;
- cin >> op;
- if(op == 'C') {
- int prioridad;
- string nombre;
- cin >> nombre >> prioridad;
- int idx = nombre[0] - 65;
- auto it = upper_bound(cola[idx].begin(), cola[idx].end(), make_pair(prioridad, string())) - cola[idx].begin();
- cola[idx].insert(it, make_pair(prioridad, nombre));
- }
- else if(op == 'S') {
- }
- else if(op == 'A') {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement