#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 |
1 |
Correct |
11 ms |
512 KB |
Output is correct |
2 |
Correct |
5 ms |
492 KB |
Output is correct |
3 |
Correct |
3 ms |
492 KB |
Output is correct |
4 |
Correct |
10 ms |
492 KB |
Output is correct |
5 |
Correct |
26 ms |
364 KB |
Output is correct |
6 |
Correct |
5 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
18074 ms |
14728 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
18075 ms |
15648 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
18075 ms |
15648 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
512 KB |
Output is correct |
2 |
Correct |
5 ms |
492 KB |
Output is correct |
3 |
Correct |
3 ms |
492 KB |
Output is correct |
4 |
Correct |
10 ms |
492 KB |
Output is correct |
5 |
Correct |
26 ms |
364 KB |
Output is correct |
6 |
Correct |
5 ms |
384 KB |
Output is correct |
7 |
Execution timed out |
18074 ms |
14728 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |