Submission #894727

# Submission time Handle Problem Language Result Execution time Memory
894727 2023-12-28T19:54:33 Z box Sweeping (JOI20_sweeping) C++17
1 / 100
88 ms 16480 KB
#include <bits/stdc++.h>
using namespace std;

#define ar array
#define sz(v) int(std::size(v))
using i64 = long long;

const int SIZE = 15e5;

int N, M, Q;
int X[SIZE], Y[SIZE];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> N >> M >> Q;
    for (int i = 0; i < M; i++) {
        cin >> X[i] >> Y[i];
    }
    if (M <= 2000) {
        while (Q--) {
            int t;
            cin >> t;
            if (t == 1) {
                int i;
                cin >> i, i--;
                cout << X[i] << ' ' << Y[i] << '\n';
            } else if (t == 2) {
                int l;
                cin >> l;
                for (int i = 0; i < M; i++) if (Y[i] <= l)
                    X[i] = max(X[i], N - l);
            } else if (t == 3) {
                int l;
                cin >> l;
                for (int i = 0; i < M; i++) if (X[i] <= l)
                    Y[i] = max(Y[i], N - l);
            } else {
                cin >> X[M] >> Y[M];
                M++;
            }
        }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 8 ms 2652 KB Output is correct
2 Correct 3 ms 2396 KB Output is correct
3 Correct 2 ms 2592 KB Output is correct
4 Correct 9 ms 2652 KB Output is correct
5 Correct 21 ms 2572 KB Output is correct
6 Correct 4 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 88 ms 16480 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 74 ms 16364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 74 ms 16364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 8 ms 2652 KB Output is correct
2 Correct 3 ms 2396 KB Output is correct
3 Correct 2 ms 2592 KB Output is correct
4 Correct 9 ms 2652 KB Output is correct
5 Correct 21 ms 2572 KB Output is correct
6 Correct 4 ms 2396 KB Output is correct
7 Incorrect 88 ms 16480 KB Output isn't correct
8 Halted 0 ms 0 KB -