QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#336053#8110. Additionucup-team1209#WA 0ms3512kbC++201.8kb2024-02-24 12:20:482024-02-24 12:20:48

Judging History

你现在查看的是最新测评结果

  • [2024-02-24 12:20:48]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3512kb
  • [2024-02-24 12:20:48]
  • 提交

answer

#include<bits/stdc++.h>
using std::cin;
using std::cout;
using ll = long long;
using u64 = unsigned long long;
std::vector<std::pair<std::string, std::string>> v;
auto ch = {'a', 'b'};
auto nu = {0, 1};
std::string g(char x) { return std::string(1, x); } 
std::string g(int x) { return std::string(1, 48 + x); }
int main() {
	std::ios::sync_with_stdio(false), cin.tie(0);
	for(int x : nu) for(char a : ch) for(char b : ch) {
		int z = x + (a - 'a') + (b - 'a');
		v.emplace_back(g(x) + g(a) + '#' + g(b), '#' + g(z / 2) + g(z % 2));
	}
	for(char a : ch) {
		v.emplace_back(g(a) + "0", "0" + g(a));
		v.emplace_back(g(a) + "1", "1" + g(a));
	}
	for(int x : nu) for(char a : ch) {
		int z = x + (a - 'a');
		v.emplace_back(g(x) + g(a), '#' + g(z / 2) + g(z % 2));
	}
	v.emplace_back("+#", "#");
	v.emplace_back("0+", "+a");
	v.emplace_back("1+", "+b");
	v.emplace_back("+0", "0");
	v.emplace_back("+1", "1");
	for(int x : nu) for(int y : nu) {
		int z = x + y;
		if(z == 2) {
			v.emplace_back(g(x) + "#" + g(y), "#" + g(z / 2) + g(z % 2));
		} else {
			v.emplace_back(g(x) + "#" + g(y), g(z));
		}
	}
	v.emplace_back("#0", "#");
	v.emplace_back("#1", "1");
	cout << v.size() << '\n';
	for(auto [a, b] : v) {
		cout << a << ' ' << b << '\n';
	}
	return 0;
	cout << std::flush;
	cout << "###################" << '\n';
	cout << "start simulation : " << '\n';
	std::string s;
	cin >> s;
	for(int i = 0;i < 1e5;++i) {
		int ok = 0;
		for(auto [a, b] : v) {
			for(int i = 0;i <= int(s.size() - a.size());++i) {
				if(std::string(s.begin() + i, s.begin() + i + a.size()) == a) {
					s = std::string(s.begin(), s.begin() + i) + b + std::string(s.begin() + i + a.size(), s.end());
					ok = 1;
					break;
				}
			}
			if(ok) break;
		}
		cout << s << '\n';
		if(!ok) {
			break;
		}
	}
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3512kb

input:

1

output:

27
0a#a #00
0a#b #01
0b#a #01
0b#b #10
1a#a #01
1a#b #10
1b#a #10
1b#b #11
a0 0a
a1 1a
b0 0b
b1 1b
0a #00
0b #01
1a #01
1b #10
+# #
0+ +a
1+ +b
+0 0
+1 1
0#0 0
0#1 1
1#0 1
1#1 #10
#0 #
#1 1

result:

wrong answer Zla odpowiedz. Oczekiwano 0, a wczytano #