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;
template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl
using ll = long long;
const int maxn = 1e6 + 5;
int n,m,q;
pair<int,int> P[maxn];
int main() {
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
cin>>n>>m>>q;
for (int i=1; i<=m; i++) {
cin>>P[i].first>>P[i].second;
}
for (int z=1; z<=q; z++) {
int op;
cin>>op;
if (op==4) {
// add dust
int x,y; cin>>x>>y;
P[++m] = {x,y};
} else if (op==3) {
// vertical
int l;
cin>>l;
for (int i=1; i<=m; i++) {
if (P[i].first<=l && P[i].second<=n-l) {
P[i].second = n-l;
}
}
} else if (op==2) {
// horizontal
int l;
cin>>l;
for (int i=1; i<=m; i++) {
if (P[i].first<=n-l && P[i].second<=l) {
P[i].first = n-l;
}
}
} else if (op==1) {
int i;
cin>>i;
cout<<P[i].first<<" "<<P[i].second<<"\n";
}
}
return 0;
}
# | 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... |