제출 #1276065

#제출 시각아이디문제언어결과실행 시간메모리
1276065email_address_passwordBubble Sort Machine (JOI25_bubble)C++20
11 / 100
774 ms8784 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define rep1(a, i) for(int i = 1; i <= (a); i++)
#define pi pair<int, int>
#define fi first
#define se second
int mod = 1e9+7;


signed main(){
    int n; cin >> n;
    vector<int> a(n+1, 0);
    rep1(n, i) cin >> a[i];
    

    int cur = a[1];
    vector<pi> val;
    for(int i = 2; i <= n; i++){
        if(a[i] < cur){
            cur = a[i];
            val.pb({i-1, cur});
        }
    }
    int q; cin >> q;

    int awan = a[1];
    int idx = 0;
    int tot = 0;
    while(q--){
        int t; cin >> t;
        if(t == 1){
            tot++;
        }
        else{
            int l, r; cin >> l >> r;
            while(idx < val.size() && val[idx].fi <= tot){
                awan = val[idx].se;
                idx++;
            }

            cout << awan << '\n';
        }
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...