답안 #203698

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
203698 2020-02-21T21:30:12 Z Sorting Tenis (COI19_tenis) C++14
21 / 100
64 ms 6008 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){
		int x = a[0][i];
		mx_all = max(mx_all, mx[x]);
		if(mx_all == i){
			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{

		}
	}
}
/*
4 2
1 2 3 4
2 1 3 4
2 4 3 1
1 1
1 4
*/
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 58 ms 3424 KB Output is correct
2 Correct 62 ms 5920 KB Output is correct
3 Correct 63 ms 5880 KB Output is correct
4 Correct 59 ms 5880 KB Output is correct
5 Correct 59 ms 5880 KB Output is correct
6 Correct 63 ms 5880 KB Output is correct
7 Correct 62 ms 5880 KB Output is correct
8 Correct 59 ms 6008 KB Output is correct
9 Correct 61 ms 6008 KB Output is correct
10 Correct 60 ms 5880 KB Output is correct
11 Correct 60 ms 5880 KB Output is correct
12 Correct 59 ms 5884 KB Output is correct
13 Correct 64 ms 5884 KB Output is correct
14 Correct 58 ms 5880 KB Output is correct
15 Correct 58 ms 5880 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -