This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n,m,q;
cin >> n >> m >> q;
vector<pair<int,int>> dusts(m+1);
for(int i=1;i<=m;i++)cin>>dusts[i].first>>dusts[i].second;
for(int i=1;i<=q;i++){
int type;cin>>type;
if(type==1){
int x;cin>>x;
cout << dusts[x].first << ' ' << dusts[x].second << '\n';
} else if(type==2){
int l;cin>>l;
for(int i=1;i<=m;i++)if(dusts[i].second<=l)dusts[i].first=max(dusts[i].first,n-l);
} else if(type==3){
int l;cin>>l;
for(int i=1;i<=m;i++)if(dusts[i].first<=l)dusts[i].second=max(dusts[i].second,n-l);
} else {
int x,y;cin>>x>>y;
dusts.emplace_back(x,y);
m++;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |