답안 #540026

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
540026 2022-03-19T08:50:06 Z rk42745417 Crossing (JOI21_crossing) C++17
26 / 100
7000 ms 7152 KB
#include <bits/stdc++.h>
using namespace std;

#define EmiliaMyWife ios::sync_with_stdio(0); cin.tie(0);
using ll = int64_t;
using ull = uint64_t;
using uint = uint32_t;
using ld = long double;
const int INF = 0x3f3f3f3f;
const ll LINF = ll(4e18) + ll(2e15);
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
static int LamyIsCute = []() {
	EmiliaMyWife
	return 48763;
}();

signed main() {
	int n;
	cin >> n;
	string arr[3];
	for(int i = 0; i < 3; i++)
		cin >> arr[i];

	const string tmp = "JOI";
	auto solve = [&](auto a, auto b) {
		string res(n, 'a');
		for(int i = 0; i < n; i++) {
			if(a[i] == b[i])
				res[i] = a[i];
			else {
				int it = 0;
				while(tmp[it] == a[i] || tmp[it] == b[i])
					it++;
				res[i] = tmp[it];
			}
		}
		return res;
	};

	vector<int> ord = {0, 1, 2};
	vector<string> owo;
	for(int i = 0; i < 3; i++)
		owo.push_back(arr[i]);
	do {
		if(ord[0] < ord[1])
			owo.push_back(solve(arr[ord[0]], arr[ord[1]]));
		owo.push_back(solve(solve(arr[ord[0]], arr[ord[1]]), arr[ord[2]]));
	} while(next_permutation(ord.begin(), ord.end()));

	auto test = [&](string s) {
		bool ok = 0;
		for(int i = 0; i < owo.size(); i++)
			ok |= owo[i] == s;
		return ok;
	};

	int q;
	cin >> q;
	string s;
	cin >> s;
	cout << (test(s) ? "Yes" : "No") << '\n';
	while(q--) {
		int l, r;
		char c;
		cin >> l >> r >> c;
		for(int i = l - 1; i < r; i++)
			s[i] = c;
		cout << (test(s) ? "Yes" : "No") << '\n';
	}
}

Compilation message

Main.cpp: In lambda function:
Main.cpp:53:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   53 |   for(int i = 0; i < owo.size(); i++)
      |                  ~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 70 ms 2224 KB Output is correct
2 Correct 105 ms 2376 KB Output is correct
3 Correct 111 ms 2200 KB Output is correct
4 Correct 92 ms 2252 KB Output is correct
5 Correct 90 ms 2312 KB Output is correct
6 Correct 87 ms 2300 KB Output is correct
7 Correct 105 ms 2284 KB Output is correct
8 Correct 85 ms 2380 KB Output is correct
9 Correct 85 ms 2420 KB Output is correct
10 Correct 70 ms 2340 KB Output is correct
11 Correct 79 ms 2396 KB Output is correct
12 Correct 73 ms 2412 KB Output is correct
13 Correct 73 ms 2436 KB Output is correct
14 Correct 79 ms 2372 KB Output is correct
15 Correct 80 ms 2432 KB Output is correct
16 Correct 73 ms 2320 KB Output is correct
17 Correct 76 ms 2428 KB Output is correct
18 Correct 127 ms 2300 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 70 ms 2224 KB Output is correct
2 Correct 105 ms 2376 KB Output is correct
3 Correct 111 ms 2200 KB Output is correct
4 Correct 92 ms 2252 KB Output is correct
5 Correct 90 ms 2312 KB Output is correct
6 Correct 87 ms 2300 KB Output is correct
7 Correct 105 ms 2284 KB Output is correct
8 Correct 85 ms 2380 KB Output is correct
9 Correct 85 ms 2420 KB Output is correct
10 Correct 70 ms 2340 KB Output is correct
11 Correct 79 ms 2396 KB Output is correct
12 Correct 73 ms 2412 KB Output is correct
13 Correct 73 ms 2436 KB Output is correct
14 Correct 79 ms 2372 KB Output is correct
15 Correct 80 ms 2432 KB Output is correct
16 Correct 73 ms 2320 KB Output is correct
17 Correct 76 ms 2428 KB Output is correct
18 Correct 127 ms 2300 KB Output is correct
19 Execution timed out 7015 ms 7152 KB Time limit exceeded
20 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 70 ms 2224 KB Output is correct
2 Correct 105 ms 2376 KB Output is correct
3 Correct 111 ms 2200 KB Output is correct
4 Correct 92 ms 2252 KB Output is correct
5 Correct 90 ms 2312 KB Output is correct
6 Correct 87 ms 2300 KB Output is correct
7 Correct 105 ms 2284 KB Output is correct
8 Correct 85 ms 2380 KB Output is correct
9 Correct 85 ms 2420 KB Output is correct
10 Correct 70 ms 2340 KB Output is correct
11 Correct 79 ms 2396 KB Output is correct
12 Correct 73 ms 2412 KB Output is correct
13 Correct 73 ms 2436 KB Output is correct
14 Correct 79 ms 2372 KB Output is correct
15 Correct 80 ms 2432 KB Output is correct
16 Correct 73 ms 2320 KB Output is correct
17 Correct 76 ms 2428 KB Output is correct
18 Correct 127 ms 2300 KB Output is correct
19 Correct 78 ms 2364 KB Output is correct
20 Correct 114 ms 2300 KB Output is correct
21 Correct 78 ms 2380 KB Output is correct
22 Correct 81 ms 2216 KB Output is correct
23 Correct 74 ms 2448 KB Output is correct
24 Correct 73 ms 2248 KB Output is correct
25 Correct 83 ms 2384 KB Output is correct
26 Correct 62 ms 2244 KB Output is correct
27 Correct 78 ms 2380 KB Output is correct
28 Correct 77 ms 2160 KB Output is correct
29 Correct 73 ms 2344 KB Output is correct
30 Correct 67 ms 2188 KB Output is correct
31 Correct 75 ms 2336 KB Output is correct
32 Correct 87 ms 2488 KB Output is correct
33 Correct 87 ms 2404 KB Output is correct
34 Correct 67 ms 2236 KB Output is correct
35 Correct 84 ms 2408 KB Output is correct
36 Correct 85 ms 2412 KB Output is correct
37 Correct 83 ms 2420 KB Output is correct
38 Correct 75 ms 2400 KB Output is correct
39 Correct 76 ms 2432 KB Output is correct
40 Correct 90 ms 2344 KB Output is correct
41 Correct 92 ms 2380 KB Output is correct
42 Correct 81 ms 2356 KB Output is correct
43 Correct 64 ms 2312 KB Output is correct
44 Correct 73 ms 2360 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 70 ms 2224 KB Output is correct
2 Correct 105 ms 2376 KB Output is correct
3 Correct 111 ms 2200 KB Output is correct
4 Correct 92 ms 2252 KB Output is correct
5 Correct 90 ms 2312 KB Output is correct
6 Correct 87 ms 2300 KB Output is correct
7 Correct 105 ms 2284 KB Output is correct
8 Correct 85 ms 2380 KB Output is correct
9 Correct 85 ms 2420 KB Output is correct
10 Correct 70 ms 2340 KB Output is correct
11 Correct 79 ms 2396 KB Output is correct
12 Correct 73 ms 2412 KB Output is correct
13 Correct 73 ms 2436 KB Output is correct
14 Correct 79 ms 2372 KB Output is correct
15 Correct 80 ms 2432 KB Output is correct
16 Correct 73 ms 2320 KB Output is correct
17 Correct 76 ms 2428 KB Output is correct
18 Correct 127 ms 2300 KB Output is correct
19 Execution timed out 7015 ms 7152 KB Time limit exceeded
20 Halted 0 ms 0 KB -