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 <iostream>
#include <algorithm>
const int MAXN = 7e3;
int x[MAXN], y[MAXN];
int main()
{
std::ios::sync_with_stdio(false);
std::cout.tie(nullptr);
std::cin.tie(nullptr);
int size, dusts, queries;
std::cin >> size >> dusts >> queries;
for (int iDst = 0; iDst < dusts; iDst++)
std::cin >> x[iDst] >> y[iDst];
for (int iQ = 0; iQ < queries; iQ++)
{
int type; std::cin >> type;
switch (type)
{
case 1:
int wanted; std::cin >> wanted;
wanted--;
std::cout << x[wanted] << ' ' << y[wanted] << '\n';
break;
case 2:
int width; std::cin >> width;
for (int iDst = 0; iDst < dusts; iDst++)
if (y[iDst] <= width)
x[iDst] = std::max(x[iDst], size - width);
break;
case 3:
std::cin >> width;
for (int iDst = 0; iDst < dusts; iDst++)
if (x[iDst] <= width)
y[iDst] = std::max(y[iDst], size - width);
break;
case 4:
std::cin >> x[dusts] >> y[dusts];
dusts++;
}
}
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... |