#line 1 "main.cpp" /** library https//github.com/hidehic0/library_cpp **/ #line 1 "/home/hidehic0/src/github.com/hidehic0/library_cpp/all.h" #if __has_include() #include #endif #include #ifdef ONLINE_JUDGE #define dump(...) #define CPP_DUMP_SET_OPTION(...) #define CPP_DUMP_SET_OPTION_GLOBAL(...) #define CPP_DUMP_DEFINE_EXPORT_OBJECT(...) #define CPP_DUMP_DEFINE_EXPORT_ENUM(...) #define CPP_DUMP_DEFINE_EXPORT_OBJECT_GENERIC(...) #define export_command #elif __has_include() #include #define dump(...) cpp_dump(__VA_ARGS__) #else #define dump(...) #define CPP_DUMP_SET_OPTION(...) #define CPP_DUMP_SET_OPTION_GLOBAL(...) #define CPP_DUMP_DEFINE_EXPORT_OBJECT(...) #define CPP_DUMP_DEFINE_EXPORT_ENUM(...) #define CPP_DUMP_DEFINE_EXPORT_OBJECT_GENERIC(...) #define export_command #endif #line 3 "/home/hidehic0/src/github.com/hidehic0/library_cpp/templates/alias.hpp" template using VC = std::vector; template using rpriority_queue = std::priority_queue, std::greater>; using ll = long long; using ld = long double; using u64 = uint64_t; using u32 = uint32_t; using pii = std::pair; using vi = VC; using vvi = VC; using vvvi = VC; using vb = VC; using vvb = VC; using vf = VC; using vvf = VC; using vpii = VC; using vvpii = VC; using si = std::set; using spii = std::set; using mii = std::map; using str = std::string; const std::string upperlist = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; const std::string lowerlist = "abcdefghijklmnopqrstuvwxyz"; #define mp make_pair constexpr int MOD998 = 998244353; #line 3 "/home/hidehic0/src/github.com/hidehic0/library_cpp/templates/macro.hpp" // 引数の長さで内容が変わるrep 参考: https://trap.jp/post/1224 #define overload4(a, b, c, d, ...) d #define _rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define rep(...) overload4(__VA_ARGS__, REP, _rep)(__VA_ARGS__) #define _rrep(i, n) for (int i = n - 1; i >= 0; i--) #define RREP(i, a, b) for (int i = (int)(b - 1); i >= (int)(a); i--) #define rrep(...) overload4(__VA_ARGS__, RREP, _rrep)(__VA_ARGS__) #define all(a) (a).begin(), (a).end() template bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template std::istream &operator>>(std::istream &is, std::pair &p) { is >> p.first >> p.second; return is; } template std::istream &operator>>(std::istream &is, std::vector &v) { for (T &in : v) is >> in; return is; } template std::ostream &operator<<(std::ostream &os, const std::vector &v) { for (int i = 0; i < static_cast(v.size()); i++) { os << v[i] << (i + 1 == v.size() ? "" : " "); } return os; } // pythonのprintライクな関数 参考: // https://nyaannyaan.github.io/library/template/inout.hpp inline void out() { std::cout << std::endl; } template void out(const T &t, const U &...u) { std::cout << t; if (sizeof...(u)) std::cout << sep; out(u...); } // cinの短縮関数 参考: https://nyaannyaan.github.io/library/template/inout.hpp inline void in() {} template void in(T &t, U &...u) { std::cin >> t; in(u...); } template inline T ceil_div(T a, T b) { return (a + b - 1) / b; } template inline T mod_pow(T a, T n, T mod) { T res = 1; while (n) { if (n % 2 != 0) { res *= a; res %= mod; } a *= a; a %= mod; n >>= 1; } return res; } template inline T minus_mod(T a, T b) { return ((a % b) + b) % b; } template void apply_vec(std::vector &v, T (*fn)(T)) { for (int i = 0; i < v.size(); i++) v[i] = fn(v[i]); } template struct Top2 { T a, b; Top2() {} Top2(T a) : a(a) {} Top2(T a, T b) : a(a), b(b) {} void add(const T &v) { if (Comp{}(v, a)) b = a, a = v; else if (Comp{}(v, b)) b = v; } friend Top2 operator*(const Top2 &lhs, const Top2 &rhs) { auto n = lhs; n.add(rhs.a), n.add(rhs.b); return n; } Top2 &operator*=(const Top2 &rhs) { (*this) = (*this) * rhs; return *this; } }; template struct TopMin2 : public Top2> { using Top2>::Top2; }; template struct TopMax2 : public Top2> { using Top2>::Top2; }; template std::vector ordinal_compression(const std::vector &v) { std::vector order(v.size()), res(v.size()); std::ranges::iota(order, 0), std::ranges::sort(order, [&](int a, int b) { return v[a] < v[b]; }); for (size_t i = 0; i < v.size(); i++) res[order[i]] = i; return res; } #line 30 "/home/hidehic0/src/github.com/hidehic0/library_cpp/all.h" #line 3 "/home/hidehic0/src/github.com/hidehic0/library_cpp/grid/template.hpp" bool coordinate_check(int x, int w, int H, int W) { return 0 <= x && x < H && 0 <= w && w < W; } constexpr std::array, 4> MOVES1 = { {{0, 1}, {1, 0}, {-1, 0}, {0, -1}}}; constexpr std::array, 8> MOVES2 = { {{0, 1}, {1, 0}, {-1, 0}, {0, -1}, {1, 1}, {-1, -1}, {1, -1}, {-1, 1}}}; #line 32 "/home/hidehic0/src/github.com/hidehic0/library_cpp/all.h" #line 5 "/home/hidehic0/src/github.com/hidehic0/library_cpp/utils/compress.hpp" template std::map compress_1d(std::vector V) { sort(V.begin(), V.end()); V.erase(std::unique(V.begin(), V.end()), V.end()); std::map res; for (int i = 0; i < V.size(); i++) { res[V[i]] = i; } return res; } #line 5 "/home/hidehic0/src/github.com/hidehic0/library_cpp/utils/factorial.hpp" template std::vector factorial_list(int N) { std::vector P(N + 1, 1); for (int i = 1; i <= N; i++) { P[i] = P[i - 1] * T{i}; } return P; } template struct Fact { std::vector F, FINV; int _n; Fact(int n) : F(n + 1, 1), FINV(n + 1, 1), _n(n) { rep(i, 1, n + 1) { F[i] = F[i - 1] * (T)i; FINV[i] = (T)1 / F[i]; } } T *begin() { return F.begin(); } T *end() { return F.end(); } T *rbegin() { return F.rbegin(); } T *rend() { return F.rend(); } T operator[](size_t ind) { return F[ind]; } T getinv(int i) { assert(0 <= i && i <= _n); return FINV[i]; } T nCr(int n, int k) { if (k < 0 || n < k) return (T)0; return F[n] * FINV[n - k] * FINV[k]; } T nPr(int n, int k) { if (k < 0 || n < k) return (T)0; return F[n] * FINV[n - k]; } }; #line 35 "/home/hidehic0/src/github.com/hidehic0/library_cpp/all.h" #line 3 "/home/hidehic0/src/github.com/hidehic0/library_cpp/data-structure/removable_priority_queue.hpp" template > struct RemovablePriorityQueue { std::priority_queue, Compare> PQ, RPQ; void m_remove() { if (PQ.empty()) return; while (true) { if (PQ.empty() || RPQ.empty()) return; if (PQ.top() == RPQ.top()) PQ.pop(), RPQ.pop(); else return; } } void push(T v) { PQ.push(v); } void remove(T v) { RPQ.push(v); } bool empty() { m_remove(); return PQ.empty(); } T top() { assert(!empty()); return PQ.top(); } void pop() { assert(!empty()); PQ.pop(); } }; #line 6 "main.cpp" using namespace std; using namespace atcoder; int main() { ll Q; in(Q); rep(i, Q) { ll t; in(t); if (t == 1) { ll a, b; in(a, b); out(a + b); } else out(i + 1); } }