Submission #203695

# Submission time Handle Problem Language Result Execution time Memory
203695 2020-02-21T21:25:02 Z Sorting Tenis (COI19_tenis) C++14
0 / 100
59 ms 5880 KB
#include <bits/stdc++.h>

using namespace std;

const int kNMax = 1e5 + 7;

int n, q;
int a[3][kNMax], mx[kNMax], pos[3][kNMax];

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);

	cin >> n >> q;
	for(int i = 0; i < 3; ++i){
		for(int j = 1; j <= n; ++j){
			cin >> a[i][j];
			pos[i][a[i][j]] = j;
		}
	}

	for(int i = 1; i <= n; ++i){
		mx[i] = 0;
		for(int j = 0; j < 3; ++j)
			mx[i] = max(mx[i], pos[j][i]);
	}

	int border = -1, mx_all = 0;
	for(int i = 1; i <= n; ++i){
		mx_all = max(mx_all, mx[i]);
		if(mx_all == i - 1){
			border = i;
			break;
		}
	}

	for(int i = 0; i < q; ++i){
		int type;
		cin >> type;

		if(type == 1){
			int x;
			cin >> x;

			if(mx[x] >= border)
				cout << "DA\n";
			else
				cout << "NE\n";
		}
		else{

		}
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 59 ms 5880 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -