Submission #1012439

# Submission time Handle Problem Language Result Execution time Memory
1012439 2024-07-02T07:27:58 Z Dan4Life Sweeping (JOI20_sweeping) C++17
1 / 100
14 ms 1116 KB
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define sz(a) (int)a.size()
#define all(a) begin(a),end(a)

const int mxN = (int)1e4;
int n, m, q;
using ar3 = array<int,3>;
ar3 dust[mxN];

int32_t main(){
    ios_base::sync_with_stdio(false); cin.tie(0);
    cin >> n >> m >> q;
	for(int i = 0; i < m; i++) cin >> dust[i][0] >> dust[i][1], dust[i][2]=i;
	for(int _ = 0; _ < q; _++){
		int t; cin >> t;
		if(t==1){
			int x; cin >> x; x--;
			cout << dust[x][0] << " " << dust[x][1] << "\n";
		}
		else if(t==2){
			int l; cin >> l;
			for(int i = 0; i < m; i++){
				if(dust[i][0]<n-l and dust[i][1]<=l){
					dust[i][0]=n-l;
				}
			}
		}
		else if(t==3){
			int l; cin >> l;
			for(int i = 0; i < m; i++){
				if(dust[i][1]<n-l and dust[i][0]<=l){
					dust[i][1]=n-l;
				}
			}
		}
		else{
			int x, y; cin >> x >> y;
			dust[m]=ar3({x,y,m}); m++;
		}
	}
}
# Verdict Execution time Memory Grader output
1 Correct 6 ms 600 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 2 ms 604 KB Output is correct
4 Correct 6 ms 604 KB Output is correct
5 Correct 14 ms 540 KB Output is correct
6 Correct 4 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 1116 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 1112 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 1112 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 600 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 2 ms 604 KB Output is correct
4 Correct 6 ms 604 KB Output is correct
5 Correct 14 ms 540 KB Output is correct
6 Correct 4 ms 348 KB Output is correct
7 Runtime error 2 ms 1116 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -