表哥AI - Cousin's AI 2.52.5

C24C24正确率最高的AI一直被模仿,从未被超越


未经授权禁止转载 @ @


更新日志

2025/3/4

  • 1.01.0版本,能够直接查询到ZXOJ中某一题目的多个(或是0个)解法,需去掉网址前缀
  • 2.02.0版本,支持了洛谷题库,包括洛谷官方题目和用户添加的题目

2025/3/5

  • 1.51.5版本,更新了UI,使页面更清晰明了,同时也不必再去掉网址前缀,更加方便简便
  • 2.12.1版本,更新了可选的加载流程,加载后可以有更好的体验

2025/3/6

  • 2.52.5版本,可直接询问问题,会显示结果,默认bing搜索引擎

表哥AI - Cousin's AI 2.52.5开源

#include <bits/stdc++.h>
#include <windows.h>
#include <shellapi.h>
using namespace std;

string user_input;
bool cat = false, load_cousin = false;

void slow_print(string s)
{
	cout << "> ";
	int len = s.length();
	for(int i = 0; i < len; i++)
	{
		cout << s[i];
		Sleep(62);
	}
	cout << endl;
	
}

int load()
{
	
	slow_print("开始加载org皇帝名单 - 这将会影响到使用体验");
	slow_print("C24liukaiwen\nAAA勾石代码批发溜溜(茶叶同行)\n 月半伦\nC24tanhaolun\n.\n.\n.\n.\n.\n.\n");
	slow_print("[//////////////////////////////////////////////////]");
	slow_print("加载org皇帝名单成功");
	cout << endl;
	slow_print("开始偷取你C24账号密码");
	slow_print("正在潜入ZXOJ");
	slow_print("正在偷窥你的blog");
	slow_print("正在让你的电脑挖矿");
	slow_print("正在大佬的个人资料结尾写入:吸吸,尝试吸入大佬气息");
	slow_print("正在偷密码..........................失败");
	slow_print("[//////////////////////////////////////////////////]");
	cout << endl;
	slow_print("开始不知道要写什么但是就是想写些什么东西");
	slow_print("[//////////////////////////////////////////////////]");
	cout << endl;
	slow_print("我就是要浪费你时间");
	slow_print("[//////////////////////////////////////////////////]");
	
	return 0;
}


int getRand(int min, int max)
{
	return (rand() % (max - min + 1)) + min;
}

bool check_zxoj()
{
	if (
		user_input.size() >= 26 and user_input.size() <= 40 and 
		user_input[user_input.size() - 1] >= '0' and user_input[user_input.size() - 1] <= '9' and
		user_input[0 + 7] == 'm' and
		user_input[1 + 7] == 'l' and
		user_input[2 + 7] == '3' and
		user_input[3 + 7] == '4' and
		user_input[4 + 7] == '9' and
		user_input[5 + 7] == '0' and
		user_input[6 + 7] == '2' and
		user_input[7 + 7] == '0' and
		user_input[8 + 7] == '4' and
		user_input[9 + 7] == '.' and
		user_input[10 + 7] == 'v' and
		user_input[11 + 7] == 'i' and
		user_input[12 + 7] == 'c' and
		user_input[13 + 7] == 'p' and
		user_input[14 + 7] == '.' and
		user_input[15 + 7] == 'c' and
		user_input[16 + 7] == 'c'
		)
		return true;
	
	else if (
		user_input.size() >= 26 and user_input.size() <= 40 and 
		user_input[user_input.size() - 1] >= '0' and user_input[user_input.size() - 1] <= '9' and
		user_input[0 + 7] == '2' and
		user_input[1 + 7] == '2' and
		user_input[2 + 7] == '2' and
		user_input[3 + 7] == '.' and
		user_input[4 + 7] == '2' and
		user_input[5 + 7] == '0' and
		user_input[6 + 7] == '3' and
		user_input[7 + 7] == '.' and
		user_input[8 + 7] == '1' and
		user_input[9 + 7] == '1' and
		user_input[10 + 7] == '0' and
		user_input[11 + 7] == '.' and
		user_input[12 + 7] == '1' and
		user_input[13 + 7] == '3'
		) 
		return true;
	return false;
}

bool check_luogu()
{
	if (
		user_input.size() >= 33 and user_input.size() <= 40 and 
		user_input[user_input.size() - 1] >= '0' and user_input[user_input.size() - 1] <= '9' and
		user_input[0 + 8] == 'w' and
		user_input[1 + 8] == 'w' and
		user_input[2 + 8] == 'w' and
		user_input[3 + 8] == '.' and
		user_input[4 + 8] == 'l' and
		user_input[5 + 8] == 'u' and
		user_input[6 + 8] == 'o' and
		user_input[7 + 8] == 'g' and
		user_input[8 + 8] == 'u' and
		user_input[9 + 8] == '.' and
		user_input[10 + 8] == 'c' and
		user_input[11 + 8] == 'o' and
		user_input[12 + 8] == 'm' and
		user_input[13 + 8] == '.' and
		user_input[14 + 8] == 'c' and
		user_input[15 + 8] == 'n' and
		user_input[16 + 8] == '/' and
		user_input[17 + 8] == 'p' and
		user_input[18 + 8] == 'r' and
		user_input[19 + 8] == 'o' and
		user_input[20 + 8] == 'b' and
		user_input[21 + 8] == 'l' and
		user_input[22 + 8] == 'e' and
		user_input[23 + 8] == 'm' and
		user_input[24 + 8] == '/'
		and (user_input[25 + 8] == 'P' or user_input[15 + 8] == 'U')
		)
		return true;
	return false;
}

int main()
{
	cout << endl << ">     表哥AI - Cousin's AI     <"
	<< endl << ">        C24错误率最低!        <" << endl;
	Sleep(300);
	cout << ">   咨询使用教程请输入:help!   <" << endl << endl; 
	Sleep(300);
	while (true)
	{
		cout << ">> ";
		getline(cin, user_input);
		
		if (user_input == "cat")
		{
			if (load_cousin and cat)
				cat = false;
			else if (cat and !load_cousin)
			{
				slow_print("cat cousin: ");
				for (int i = 1; i <= getRand(1, 114514); i++)
					cout << "喵";
				cout << endl;
			}
			else
			{
				slow_print("cousin: 好的");
				cat = true;
			}
		}
		else if (cat)
		{
			slow_print("cat cousin: ");
			for (int i = 1; i <= getRand(1, 114514); i++)
				cout << "喵";
			cout << endl;
		}
		else if (user_input == "help!")
		{
			cout << "> 主功能:" << endl;
			cout << "> 1. 找到想要咨询的C++题目(目前仅支持 执信OJ + 洛谷)" << endl;
			cout << "> 2. 将题目地址输入给 表哥AI(输入地址时请带着http://或https://www." << endl; 
			cout << "> 3. 可直接将搜索内容输入,检索成功后将会自动打开结果页面" << endl << endl; 
			
			cout << "> 副功能:" << endl;
			if (!load_cousin)
				cout << "> 输入cat可以将cousin变成小猫,但在你退出表哥AI之前不可逆" << endl;
			else
				cout << "> 输入cat可以将cousin变成小猫,再次输入cat即可取消" << endl;
			cout << endl;
			
			cout << "> Tip:" << endl;
			cout << "> 输入load加载以体验更好的表哥AI" << endl;
		}
		else if (user_input == "load")
		{
			load();
			slow_print("正在准备重新加载......");
			Sleep(1000);
			system("cls");
			load_cousin = true;
			main();
		}
		else if (check_zxoj())
		{
			Sleep(500);
			slow_print("cousin: 成功查询,正在加载");
			Sleep(1000);
			string url = user_input + "/solution"; 
			HINSTANCE result = ShellExecute(NULL, "open", url.c_str(), NULL, NULL, SW_SHOWNORMAL);
			slow_print("cousin: 成功加载,结果页面已自动在浏览器打开!");
		}
		else if (check_luogu())
		{
			Sleep(500);
			slow_print("cousin: 成功查询,正在加载");
			Sleep(1000);
			string url; 
			for (int i = 0 ; i < 32; i++)
				url += user_input[i];
			url += "/solution";
			for (int i = 32; i < user_input.size(); i++)
				url += user_input[i];
			HINSTANCE result = ShellExecute(NULL, "open", url.c_str(), NULL, NULL, SW_SHOWNORMAL);
			slow_print("cousin: 成功加载,结果页面已自动在浏览器打开!");
		}
		else
		{
			Sleep(500);
			slow_print("cousin: 成功搜索,正在加载");
			Sleep(1000);
			string url = "https://cn.bing.com/search?q=" + user_input; 
			for (int i = 32; i < user_input.size(); i++)
				url += user_input[i];
			HINSTANCE result = ShellExecute(NULL, "open", url.c_str(), NULL, NULL, SW_SHOWNORMAL);
			slow_print("cousin: 成功加载,结果页面已自动在浏览器打开!");
		} 
	}
	
	return 0;
}