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 pb push_back
#define fi first
#define se second
#define sz(a) (int)a.size()
#define all(a) begin(a),end(a)
const int mxN = (int)1e4;
int n, m, q;
using ar3 = array<int,3>;
ar3 dust[mxN];
int32_t main(){
ios_base::sync_with_stdio(false); cin.tie(0);
cin >> n >> m >> q;
for(int i = 0; i < m; i++) cin >> dust[i][0] >> dust[i][1], dust[i][2]=i;
for(int _ = 0; _ < q; _++){
int t; cin >> t;
if(t==1){
int x; cin >> x; x--;
cout << dust[x][0] << " " << dust[x][1] << "\n";
}
else if(t==2){
int l; cin >> l;
for(int i = 0; i < m; i++){
if(dust[i][0]<n-l and dust[i][1]<=l){
dust[i][0]=n-l;
}
}
}
else if(t==3){
int l; cin >> l;
for(int i = 0; i < m; i++){
if(dust[i][1]<n-l and dust[i][0]<=l){
dust[i][1]=n-l;
}
}
}
else{
int x, y; cin >> x >> y;
dust[m]=ar3({x,y,m}); 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... |