Submission #240648

#TimeUsernameProblemLanguageResultExecution timeMemory
240648faremySweeping (JOI20_sweeping)C++14
1 / 100
28 ms640 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...