69222023-12-19 19:45:42111Pac-Mancpp17Wrong answer 0/1003.099s22516 KiB
#include <bits/stdc++.h>
using namespace std;

#define int long long
#define double long double

#define pii pair<int, int>

signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#ifdef CB
	freopen("in.txt", "r", stdin);
//	freopen("out.txt", "w", stdout);
#endif
	int N;
	cin >> N;
	vector<int> X(N), Y(N), Z(N);
	for (int i = 0; i < N; i++) {
		cin >> X[i];
	}
	for (int i = 0; i < N; i++) {
		cin >> Y[i];
	}
	for (int i = 0; i < N; i++) {
		cin >> Z[i];
	}
	set<tuple<int, int, int>> s;
	for (int i = 0; i < N; i++) {
		s.insert({X[i], Y[i], Z[i]});
	}
	for (int i = 0; i < N; i++) {
		for (int j = i + 1; j < N; j++) {
			bool ok = true;
			if (X[i] < X[j]) {
				if (s.count({X[i] + 1, Y[i], Z[i]})) {
					continue;
				}
				ok = false;
			}
			if (Y[i] < Y[j]) {
				if (s.count({X[i], Y[i] + 1, Z[i]})) {
					continue;
				}
				ok = false;
			}
			if (Z[i] < Z[j]) {
				if (s.count({X[i], Y[i], Z[i] + 1})) {
					continue;
				}
				ok = false;
			}
			if (!ok) {
				goto bad;
			}
		}
	}
	cout << "YES" << '\n';
	return 0;
bad:
	cout << "NO" << '\n';
	return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1824 KiB
2Accepted3ms2056 KiB
3Accepted3ms2276 KiB
subtask20/18
4Accepted3ms2336 KiB
5Accepted3ms2548 KiB
6Wrong answer3ms2920 KiB
7Wrong answer3ms3300 KiB
8Wrong answer3ms3172 KiB
9Accepted3ms3368 KiB
10Wrong answer3ms3564 KiB
11Wrong answer3ms3624 KiB
12Accepted3ms3704 KiB
13Accepted3ms3836 KiB
subtask30/19
14Accepted7ms5196 KiB
15Wrong answer3ms3924 KiB
16Accepted6ms4908 KiB
17Accepted9ms5464 KiB
18Wrong answer12ms5576 KiB
19Wrong answer8ms5344 KiB
20Accepted3ms4040 KiB
21Accepted4ms4704 KiB
22Accepted7ms5308 KiB
23Accepted8ms5544 KiB
24Accepted8ms5720 KiB
25Accepted25ms5848 KiB
26Accepted3ms4628 KiB
subtask40/24
27Accepted76ms21836 KiB
28Accepted54ms5232 KiB
29Wrong answer722ms21880 KiB
30Wrong answer2.903s21900 KiB
31Wrong answer1.207s21948 KiB
32Wrong answer261ms22088 KiB
33Accepted3ms5320 KiB
34Time limit exceeded3.099s12852 KiB
35Wrong answer1.705s21964 KiB
36Accepted1.595s21968 KiB
37Wrong answer524ms22184 KiB
38Accepted210ms22056 KiB
39Accepted3ms5116 KiB
subtask50/22
40Accepted81ms21960 KiB
41Wrong answer3ms4956 KiB
42Accepted46ms9912 KiB
43Accepted349ms21720 KiB
44Wrong answer109ms21704 KiB
45Wrong answer256ms22136 KiB
46Accepted3ms4960 KiB
47Accepted3ms4956 KiB
48Accepted34ms8328 KiB
49Accepted90ms20276 KiB
50Accepted317ms21900 KiB
51Accepted160ms21860 KiB
52Accepted97ms22312 KiB
53Accepted3ms5308 KiB
subtask60/17
54Accepted79ms22360 KiB
55Wrong answer85ms22400 KiB
56Accepted120ms22296 KiB
57Accepted228ms22352 KiB
58Accepted381ms22376 KiB
59Wrong answer123ms22300 KiB
60Time limit exceeded3.075s13076 KiB
61Accepted111ms22296 KiB
62Accepted144ms22444 KiB
63Accepted317ms22084 KiB
64Wrong answer282ms22080 KiB
65Accepted204ms22516 KiB
66Accepted72ms22472 KiB