Submission #800028

# Submission time Handle Problem Language Result Execution time Memory
800028 2023-08-01T09:29:26 Z 이성호(#10083) Sweeping (JOI20_sweeping) C++17
1 / 100
20 ms 724 KB
#include <iostream>
#include <vector>
using namespace std;
pair<int, int> coord[5005];
int main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int N, M, Q; cin >> N >> M >> Q;
    for (int i = 1; i <= M; i++) cin >> coord[i].first >> coord[i].second;
    for (int i = 0; i < Q; i++) {
        int t; cin >> t;
        if (t == 1) {
            int p; cin >> p;
            cout << coord[p].first << ' ' << coord[p].second << '\n';
        }
        else if (t == 2) {
            int l; cin >> l;
            for (int j = 1; j <= M; j++) {
                if (coord[j].second <= l) coord[j].first = max(coord[j].first, N - l);
            }
        }
        else if (t == 3) {
            int l; cin >> l;
            for (int j = 1; j <= M; j++) {
                if (coord[j].first <= l) coord[j].second = max(coord[j].second, N - l);
            }
        }
        else {
            M++;
            cin >> coord[M].first >> coord[M].second;
        }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 8 ms 476 KB Output is correct
2 Correct 3 ms 336 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 8 ms 424 KB Output is correct
5 Correct 20 ms 396 KB Output is correct
6 Correct 4 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 724 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 724 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 724 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 8 ms 476 KB Output is correct
2 Correct 3 ms 336 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 8 ms 424 KB Output is correct
5 Correct 20 ms 396 KB Output is correct
6 Correct 4 ms 336 KB Output is correct
7 Runtime error 2 ms 724 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -