Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long LL;
- #define PII pair<int,int>
- #define PLL pair<LL,LL>
- #define VI vector<int>
- #define VL vector<LL>
- #define VPII vector<PII>
- #define VPLL vector<PLL>
- #define MII map<int,int>
- #define MSI map<string,int>
- #define MIS map<int,string>
- #define MLL map<LL,LL>
- #define SI set<int>
- #define SL set<LL>
- #define SS set<string>
- #define SSS multiset<string>
- #define LINE printf("\n")
- #define SYNC ios_base::sync_with_stdio(0)
- #define debug puts("here")
- #define PI acos(-1)
- #define all(x) ((x).begin(),(x).end())
- #define reset(x, val) memset((x),val,sizeof((x)))
- #define forl(i, s, n) for(int (i) = (s); i < (n); (i)++)
- #define fore(i, s, n) for(int (i) = (s); i <= (n); (i)++)
- #define fi first
- #define se second
- #define pb push_back
- LL gcd(LL x, LL y) {return y == 0? x : gcd(y, x % y);}
- LL lcm(LL x, LL y) {return (x * y) / gcd(x, y);}
- bool is_prime(int x) {
- if(x == 2) return true;
- if(x % 2 == 0) return false;
- int sq = sqrt(x);
- for(int i = 3; i <= sq; i += 2) {
- if(x % i == 0) return false;
- }
- return true;
- }
- const LL MOD = (LL)1e9 + 7;
- const int MAXN = 1e6 + 10;
- int main() {
- SYNC;
- SSS table;
- string s;
- int N, type, num, T;
- cin >> T;
- while(T--) {
- cin >> N;
- table.clear();
- while(N--) {
- cin >> type;
- if(type) {
- cin >> num;
- num--;
- SSS :: iterator it = table.begin();
- std:: advance(it, num);
- cout << *it << '\n';
- } else {
- cin >> s;
- table.insert(s);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment