跳到正文

剪贴板

剪贴板 feu32kir

原文
剪贴板信息

剪贴板信息

收录
更新

#include <bits/stdc++.h> #ifdef WIN32 #define clear_the_screen system(“cls”) #else #define clear_the_screen system(“clear”) #endif #define pause cout << “Press [Enter] to continue…” << endl; getline(cin, input) #define dcnt diff.size() #define mcnt module.size() #define acnt other_algo.size() #define ecnt ex_type.size() #define scnt skill.size() #define int long long #define double long double #define sqrt(x) sqrtl((double)(x)) #define MAXN 105 using namespace std; string input; double difficulty, a[MAXN], ma[MAXN], aa[MAXN], ea[MAXN], sa[MAXN], attitude, fund; int choice_cnt, determination, d_need[MAXN] = {1000, 500, 500, 1000, 1000, 2000, 500, 2000, 1500}, d_delta[MAXN] = { 200, 100, 100, 200, 500, 500, 200, 500, 300}, d_need_r = 300, d_delta_r = 100, d_need_a = 1500, d_delta_a = 200, cid[MAXN]; vector<string> diff{“天赋老哥”, “很有实力”, “正常选手”, “唐王”, “作者”}; // 0 1 2 3 4 5 6 7 8 vector<string> module{“动态规划 ”, “数据结构 ”, “字符串 ”, “数学 ”, “图论 ”}; vector<string> other_algo{“搜索 ”, “分块 ”, “树 ”, “组合计数 ”, “多项式 ”, “数论 ”, “计数 ”, “连通性相关 ”, “计算几何 ”}; vector<string> ex_type{“构造 ”, “贪心 ”, “博弈 ”, “概率 ”, “工程 ”}; vector<string> skill{“洞察力 ”, “思维 ”, “代码 ”, “毅力 ”, “经验 ”, “迅捷 ”, “细心 ”, “心理素质 ”, “记忆力 ”}; vector<string> module{“动态规划”,“数据结构”,“字符串”,“数学”,“图论”}; vector<string> other_algo_{“搜索”,“分块”,“树”,“组合计数”, “多项式”,“数论”,“计数”,“连通性相关”,“计算几何”}; vector<string> ex_type_{“构造”,“贪心”,“博弈”,“概率”,“工程”}; vector<string> skill_{“洞察力”,“思维”,“代码”,“毅力”,“经验”,“迅捷”,“细心”,“心理素质”,“记忆力”}; vector<string> skill__{“洞察力”,“思维”,“代码”,“毅力”,“经验”,“速度”,“细心”,“心理素质”,“记忆力”}; vector<string> plots; vector<vector<string> > choice_set; set<pair<int, int> > algo_cor{{0, 1}, {1, 1}, {4, 2}, {3, 3}, {3, 4}, {3, 5}, {3, 6}, {4, 7}}; set<int> China_only{2, 8}; random_device rd; mt19937 gen(rd()); uniform_real_distribution<> dis(0.0, 1.0); double random_real_number() { return dis(gen); }; string string_print(const char* format, …) { static char buffer[1024]; va_list args; va_start(args, format); vsnprintf(buffer, sizeof(buffer), format, args); va_end(args); return string(buffer); } void plot(string s) { choice_cnt = 0; choice_set.clear(); plots = vector<string>{s}; } void add_plot(string s) { plots.push_back(s); } void print_plots(bool random_choice_permutation = true) { // cout << “print_plots(” << random_choice_permutation << ”)” << endl; // pause; clear_the_screen; if (choice_cnt) { for (int i = 1; i <= choice_cnt; i++) { cid[i] = i - 1; } if (random_choice_permutation) { random_shuffle(cid + 1, cid + choice_cnt + 1); } for (int i = 1; i <= choice_cnt; i++) { add_plot(""); add_plot(string_print(“%d”, i)); for (string s : choice_set[cid[i]]) { add_plot(s); } } } #define print_mod 10 if (print_mod == 0) { cout << “OI 模拟器改版,模式 [” << diff[(int)(difficulty + 0.5)] << ”]” << endl; cout << “心态:” << attitude << endl; cout << “决心:” << determination << endl; int tot_lines = max(4 + (mcnt + acnt + ecnt + scnt) * 2, plots.size()); plots.resize(tot_lines); vector<string> skills; skills.push_back(“大模块实力 ”); for (int i = 0; i < mcnt; i++) { skills.push_back(string(” ”) + module[i]); skills.push_back(string_print(“%14.4Lf”, ma[i])); } skills.push_back(“小模块实力 ”); for (int i = 0; i < acnt; i++) { skills.push_back(string(” ”) + other_algo[i]); skills.push_back(string_print(“%14.4Lf”, aa[i])); } skills.push_back(“非常规题目实力”); for (int i = 0; i < ecnt; i++) { skills.push_back(string(” ”) + ex_type[i]); skills.push_back(string_print(“%14.4Lf”, ea[i])); } skills.push_back(“能力 ”); for (int i = 0; i < scnt; i++) { skills.push_back(string(” ”) + skill[i]); skills.push_back(string_print(“%14.4Lf”, sa[i])); } skills.resize(tot_lines); for (int i = 0; i < tot_lines; i++) { cout << skills[i] << ” | ” << plots[i] << endl; } } if (print_mod == 10) { cout << “OI 模拟器改版,模式 [” << diff[(int)(difficulty + 0.5)] << ”]” << endl; cout << “心态:” << attitude << endl; cout << “决心:” << determination << endl; int tot_lines = max(4 + (mcnt + acnt + ecnt + scnt), plots.size()); plots.resize(tot_lines); vector<string> skills; skills.push_back(“大模块实力 ”); for (int i = 0; i < mcnt; i++) { skills.push_back(string(” ”) + module[i] + string_print(“%8.4Lf”, ma[i])); } skills.push_back(“小模块实力 ”); for (int i = 0; i < acnt; i++) { skills.push_back(string(” ”) + other_algo[i] + string_print(“%8.4Lf”, aa[i])); } skills.push_back(“非常规题目实力 ”); for (int i = 0; i < ecnt; i++) { skills.push_back(string(” ”) + ex_type[i] + string_print(“%8.4Lf”, ea[i])); } skills.push_back(“能力 ”); for (int i = 0; i < scnt; i++) { skills.push_back(string(” ”) + skill[i] + string_print(“%8.4Lf”, sa[i])); } skills.resize(tot_lines); for (int i = 0; i < tot_lines; i++) { cout << skills[i] << ” | ” << plots[i] << endl; } } } void add_choice(vector<string> p) { choice_cnt++; choice_set.push_back(p); } int get_choice() { // cout << “get_choice ” << choice_cnt << endl; do { getline(cin, input); } while (input.size() == 0 || input[0] < ‘1’ || input[0] >= ‘1’ + choice_cnt); return cid[input[0] - ‘1’ + 1] + 1; } template<typename T> void print_log(T s) { clog << s << endl; } void upgrade(int x, int y) { double addition = random_real_number() * 0.5 + 0.75; // cout << addition << endl; addition *= 1 + sa[8] * 0.1; if (x <= 3) { addition *= 2; } if (x == 1) { ma[y] += addition; } if (x == 2) { aa[y] += addition; } if (x == 3) { ea[y] += addition; } if (x == 4) { sa[y] += addition; } } void add_attitude() { double x = random_real_number() * 0.5 + 0.75 + sa[7] * 0.15; attitude += x; } void dec_attitude() { double x = max((double)0, random_real_number() * 0.5 + 0.75 - sa[7] * 0.15); attitude -= x; attitude = max((double)0, attitude); }

void determination_shop() { set<int> st; if (rand() & 3) { st.insert(-2); // 随机提升 } if (rand() & 1) { st.insert(-1); // 全面提升 } while (st.size() < 4) { st.insert(rand() % acnt); } vector<pair<int, int> > vec; for (int i : st) { vec.push_back({i, 1}); } random_shuffle(vec.begin(), vec.end()); while (true) { /* clear_the_screen; for (pair<int, int> i : vec) { cout << i.first << ” ” << i.second << endl; } pause; / plot(“决心商店”); add_plot(“在梦境中,你到了一个神秘的商店。”); add_plot(“商店的老板告诉你,只要你愿意,你就可以用你的决心来提升你的能力。”); add_plot(“但也许你需要先慎重地考虑一下,你到底需要什么。每次购买后,商品的价格都会上涨。”); add_plot(“输入 E 退出决心商店”); for (pair<int, int> I : vec) { int i = I.first; if (i == -2) { add_choice({string(“随机提升”) + (I.second ? "" : “(已选过,无法重新选择)”), string_print(“花费 %d 点决心提升随机一项算法能力 1 次”, d_need_r - (I.second ? 0 : (int)(d_delta_r + difficulty * 100)))}); } else if (i == -1) { add_choice({string(“全面提升”) + (I.second ? "" : “(已选过,无法重新选择)”), string_print(“花费 %d 点决心提升所有算法能力各 1 次”, d_need_a - (I.second ? 0 : (int)(d_delta_a + difficulty * 100)))}); } else { add_choice({skill__[i] + “提升” + (I.second ? "" : “(已选过,无法重新选择)”), string_print(“花费 %d 点决心提升 1 次”, d_need[i] - (I.second ? 0 : (int)(d_delta[i] + difficulty * 100))) + skill_[i]}); } } print_plots(false); do { getline(cin, input); } while (input.size() == 0 || !(input[0] == ‘E’ || (input[0] >= ‘1’ && input[0] < ‘1’ + 4))); char now_choice = input[0]; if (now_choice == ‘E’) { break; } // cout << cid[now_choice - ‘1’ + 1] << endl; // cout << vec.size() << endl; // cout << vec[cid[now_choice - ‘1’ + 1]].first << endl; // pause; // cout << ”!!!” << endl; // pause; int k = vec[cid[now_choice - ‘1’ + 1]].first; // cout << ”!” << endl; // pause; if (k == -2) { if (determination < d_need_r || !vec[cid[now_choice - ‘1’ + 1]].second) { continue; } determination -= d_need_r; d_need_r += d_delta_r + difficulty * 100; vec[cid[now_choice - ‘1’ + 1]].second = 0; int x = rand() % 3 + 1; if (x == 1) { upgrade(1, rand() % mcnt); } if (x == 2) { upgrade(2, rand() % acnt); } if (x == 3) { upgrade(3, rand() % ecnt); } } else if (k == -1) { if (determination < d_need_a || !vec[cid[now_choice - ‘1’ + 1]].second) { continue; } determination -= d_need_a; d_need_a += d_delta_a + difficulty * 100; vec[cid[now_choice - ‘1’ + 1]].second = 0; for (int i = 0; i < mcnt; i++) { upgrade(1, i); } for (int i = 0; i < acnt; i++) { upgrade(2, i); } for (int i = 0; i < ecnt; i++) { upgrade(3, i); } } else { // cout << ”#” << endl; // pause; if (determination < d_need[k] || !vec[cid[now_choice - ‘1’ + 1]].second) { continue; } // cout << ”$” << endl; // pause; determination -= d_need[k]; // cout << ”%” << endl; // pause; d_need[k] += d_delta[k] + difficulty * 100; // cout << ”^” << endl; // pause; vec[cid[now_choice - ‘1’ + 1]].second = 0; // cout << ”&” << endl; // pause; upgrade(4, k); // cout << "" << endl; // pause; } } }

void play_game() { plot(“打隔膜”); add_plot(“竞赛生的快乐来源之一,当然是打隔膜。”); add_plot(“你和你的朋友们一起在机房打隔膜,在享受着游戏的乐趣的同时,又要避开教练的视线”); add_plot(“——你的学长曾因为在机房打隔膜被教练抓到,然后被罚写检讨并被轰出了机房。”); add_plot(""); int x = rand() % 4; if (x == 0) { add_plot(“你在打隔膜时候被抓,跟学长一样地,被罚写检讨并被轰出了机房”); add_plot(“效果:心态减少 2 次”); dec_attitude(); dec_attitude(); } if (x == 1) { add_plot(“被对面虐,心态爆炸。连开了五把却怎么都赢不了,你开始怀疑自己的实力”); add_plot(“效果:心态减少 1 次”); dec_attitude(); } if (x == 2) { add_plot(“赢”); add_plot(“效果:心态增加 1 次”); add_attitude(); } if (x == 3) { add_plot(“赢麻了”); add_plot(“效果:心态增加 2 次”); add_attitude(); add_attitude(); } print_plots(); pause; } void take_rest() { plot(“休息”); add_plot(“竞赛生的生活非常忙碌,适当的休息也许可以让你更好地调整心态,迎接接下来的挑战。”); add_plot(“你期待着有个好梦,便躺在了床上。”); add_plot(""); int x = rand() % 5; if (x == 0) { add_plot(“噩梦”); add_plot(“效果:心态减少 2 次”); dec_attitude(); dec_attitude(); } if (x == 1) { add_plot(“小屁孩吵”); add_plot(“效果:心态减少 1 次”); dec_attitude(); } if (x == 2) { add_plot(“在床上躺着使你感到非常舒适,你很快就睡着了,至于虚幻的梦你醒来时已经记不清了”); add_plot(“效果:心态增加 1 次”); add_attitude(); } if (x == 3) { add_plot(“渐入梦境之时,你带上了你所有的决心……”); add_plot(“效果:?”); } if (x == 4) { add_plot(“好梦”); add_plot(“效果:决心增加 ” + string_print(“%d”, (int)(1000 - difficulty * 125 + 0.5))); determination += (int)(1000 - difficulty * 125 + 0.5); } print_plots(); pause; if (x == 3) { determination_shop(); } } void slack_off() { plot(“摸鱼”); add_plot(“日常训练给你带来了巨大的压力,你决定在训练期间暂时放松一下,舒缓一下心情。总不会真的有学习机器,连摸鱼的时间都没有吧?”); add_choice({“朋友都在旁边:为什么不一起打隔膜?”, “效果:?”}); add_choice({“去床上休息一下,缓解一下压力”, “效果:?”}); add_choice({“刷了会手机,时间就过去了”, “效果:无”}); print_plots(); int x = get_choice(); if (x == 1) { play_game(); } if (x == 2) { take_rest(); } return; } /* void simulation_contest() { plot(“模拟赛”); add_plot(“你参加了一场校内模拟赛…”); double sum = 0; for (int i = 0; i < mcnt; i++) { sum += ma[i]; } for (int i = 0; i < acnt; i++) { sum += aa[i]; } for (int i = 0; i < ecnt; i++) { sum += ea[i]; } if (sum >= 100) { add_plot(“你的实力非常高,教练要求你参加”) } } */ void long_training(vector<string> p = {}) { plot(“长期训练”); for (string i : p) { add_plot(i); } set<pair<int, int> > st; if (rand() & 3) { st.insert({9, 0}); } if (rand() & 3) { st.insert({8, 0}); } st.insert({10, 0}); while (st.size() < 5) { int k = rand() % (mcnt + acnt + ecnt); if (k < mcnt) { st.insert({1, k}); } else if (k < mcnt + acnt) { st.insert({2, k - mcnt}); } else { st.insert({3, k - mcnt - acnt}); } } vector<pair<int, int> > vec(st.begin(), st.end()); for (pair<int, int> i : vec) { if (i.first == 1) { add_choice({module_[i.second] + “专项训练”, “效果:” + module_[i.second] + “提升 10 次”}); } if (i.first == 2) { add_choice({other_algo_[i.second] + “专项训练”, “效果:” + other_algo_[i.second] + “提升 8 次”}); } if (i.first == 3) { add_choice({ex_type_[i.second] + “专项训练”, “效果:” + ex_type_[i.second] + “提升 8 次”}); } if (i.first == 8) { add_choice({“数学专项训练”, “效果:数学、组合计数、多项式、数论各提升 3 次”}); } if (i.first == 9) { add_choice({“综合训练”, “效果:大模块实力、小模块实力、非常规题目实力各提升 1 次”}); } if (i.first == 10) { add_choice({“训练不如摸鱼”, “效果:?”}); } } print_plots(); int ans = get_choice(); int x = vec[ans - 1].first; int y = vec[ans - 1].second; if (x == 9) { for (int i = 0; i < mcnt; i++) { print_log(module_[i] + “得到提升”); upgrade(1, i); } for (int i = 0; i < acnt; i++) { print_log(other_algo_[i] + “得到提升”); upgrade(2, i); } for (int i = 0; i < ecnt; i++) { print_log(ex_type_[i] + “得到提升”); upgrade(3, i); } } if (x == 8) { print_log(“数学得到提升 * 3”); upgrade(1, 3); print_log(“组合计数得到提升 * 3”); upgrade(2, 3); print_log(“多项式得到提升 * 3”); upgrade(2, 4); print_log(“数论得到提升 * 3”); upgrade(2, 5); } if (x == 1) { print_log(module_[y] + “得到提升 * 10”); for (int i = 1; i <= 10; i++) { upgrade(1, y); } } if (x == 2) { print_log(other_algo_[y] + “得到提升 * 8”); for (int i = 1; i <= 8; i++) { upgrade(2, y); } } if (x == 3) { print_log(ex_type_[y] + “得到提升 * 8”); for (int i = 1; i <= 8; i++) { upgrade(3, y); } } if (x == 10) { slack_off(); } // pause; return; }

/* struct problem { struct subtask { double mr[MAXN], ar[MAXN], er[MAXN]; // 需要的算法 double thinking_length, coding_length; double confuse, // 迷惑,减缓思考速度,显示 ad_hoc, // Ad-hoc,概率大量减少思考速度,显示 worry, // 红温,第一次思考时减少心态,显示 trap, // 陷阱,降低通过的可能性,不显示 // 上面的全部由部分分生成器生成 motivate, // 激励,过对拍后增加心态,显示 score_b, score_k; // 通过分数,k * time + b,显示 vector<int> correlation; // 关联的部分分 string name; // 上面的由题目生成器生成 double thinked, solved; bool correct; subtask() : correlation(), thinked(0.0), solved(0.0), correct(false) { for (int i = 0; i < MAXN; i++) { mr[i] = ar[i] = er[i] = 0; } } }; string name; vector<subtask> subtasks; }; problem::subtask generate_subtask(double diff, vector<int> need_m, vector<int> need_a, vector<int> need_e) { problem::subtask sub; double real_diff = diff * pow((double)(1.5 * need_m.size() + 0.5 * need_a.size() + 0.75 * need_e.size()), 0.8); double m_diff = random_real_number() * 0.3 + 0.7; double a_diff = random_real_number() * 0.1 + 0.9; double e_diff = random_real_number() * 0.5 + 0.5; vector<double> cur_m(need_m.size(), min(diff, m_diff)); vector<double> cur_a(need_a.size(), min(diff, a_diff)); vector<double> cur_e(need_e.size(), min(diff, e_diff)); vector<double> m_lb, a_lb, e_lb; double m_lb_sum = 0, a_lb_sum = 0, e_lb_sum = 0; for (int i = 0; i < need_m.size(); i++) { m_lb.push_back(random_real_number() * min((double)1, m_diff / need_m.size())); m_lb_sum += m_lb.back(); } for (int i = 0; i < need_a.size(); i++) { a_lb.push_back(random_real_number() * min((double)1, a_diff / need_a.size())); a_lb_sum += a_lb.back(); } for (int i = 0; i < need_e.size(); i++) { e_lb.push_back(random_real_number() * min((double)1, e_diff / need_e.size())); e_lb_sum += e_lb.back(); } while (true) { double sum = 0; for (int i = 0; i < need_m.size(); i++) { sum += cur_m[i]; } if (sum <= m_diff || sum <= m_lb_sum + 0.1) { break; } int x = rand() % need_m.size(); cur_m[x] = max(cur_m[x] - random_real_number(), m_lb[x]); } while (true) { double sum = 0; for (int i = 0; i < need_a.size(); i++) { sum += cur_a[i]; } if (sum <= a_diff || sum <= a_lb_sum + 0.1) { break; } int x = rand() % need_a.size(); cur_a[x] = max(cur_a[x] - random_real_number(), a_lb[x]); } while (true) { double sum = 0; for (int i = 0; i < need_e.size(); i++) { sum += cur_a[i]; } if (sum <= e_diff || sum <= e_lb_sum + 0.1) { break; } int x = rand() % need_e.size(); cur_e[x] = max(cur_e[x] - random_real_number(), e_lb[x]); } for (int i = 0; i < need_m.size(); i++) { sub.mr[need_m[i]] = cur_m[i]; } for (int i = 0; i < need_a.size(); i++) { sub.ar[need_a[i]] = cur_a[i]; } for (int i = 0; i < need_e.size(); i++) { sub.er[need_e[i]] = cur_e[i]; } sub.confuse = rand() % 2 * random_real_number() * diff / 2; sub.ad_hoc = rand() % 2 * random_real_number() * diff; sub.trap = min((double)1, rand() % 2 * random_real_number() * diff / 3); } problem generate_problem(double diff, int type, // 0 = China, 1 = CF, 2 = AT, 10 = can’t split string problem_name, int score) { diff = diff + random_real_number(); problem pro; pro.name = problem_name; if (type % 10 == 0) {

C++
}
if (type % 10 == 1)
{
	int sbt = 1;
	if (type < 10 && diff >= 9 && rand() % 100 == 0)
	{
		sbt++;
	}
	if (type < 10 && score >= 3000 && diff >= 5 && rand() % 10 == 0)
	{
		sbt++;
	}
	pro.subtasks.resize(sbt);
	vector<int> need_m, need_a, need_e;
	need_m.push_back(rand() % mcnt);
	if (rand() & 1)
	{
		need_m.push_back(rand() % (mcnt - 1));
		if (need_m[0] <= need_m[1])
		{
			need_m[1]++;
		}
	}
	for (int i : need_m)
	{
		for (pair<int, int> j : algo_cor)
		{
			if (j.first == i && rand() % 3 == 0)
			{
				need_a.push_back(j.second);
				diff -= random_real_number() * 0.5;
			}
		}
	}
	if (rand() % 4 == 0)
	{
		need_a.push_back(rand() % acnt);
		if (rand() % 4 == 0)
		{
			need_a.push_back(rand() % (acnt - 1));
			if (need_a[0] <= need_a[1])
			{
				need_a[1]++;
			}
		}
	}
	score += sbt * 500 - 500;
	score += rand() % 1 * 250;
	vector<int> score_(sbt, score);
	if (sbt == 2)
	{
		double x = random_real_number() * 0.5 + 0.25;
		int fir_s = (int)(x * score / 250) * 250;
		score_[0] = fir_s;
		score_[1] -= fir_s;
	}
	if (sbt == 3)
	{
		while (true)
		{
			int sum = 0;
			for (int i : score_)
			{
				sum += i;
			}
			if (sum == score)
			{
				break;
			}
			int x = rand() % sbt;
			score_[x] = max(1000, score_[x] - 250);
		}
	}
	for (int i = 0; i < sbt; i++)
	{
		int sum = 0;
		for (int j = 0; j <= i; j++)
		{
			sum = score_[j];
		}
		pro.subtasks[i] = generate_subtask(diff * sum / score, need_m, need_a, need_e);
		pro.subtasks[i].name = problem_name + char('1' + i);
		if (sbt == 1)
		{
			pro.subtasks[i].name = problem_name;
		}
		for (int j = 0; j < i; j++)
		{
			pro.subtasks[i].correlation.push_back(j);
		}
	}
	for (int i = sbt - 2; i >= 0; i--)
	{
		for (int j = 0; j < mcnt; j++)
		{
			pro.subtasks[i].mr[j] = min(pro.subtasks[i].mr[j], pro.subtasks[i + 1].mr[j]);
		}
		for (int j = 0; j < acnt; j++)
		{
			pro.subtasks[i].ar[j] = min(pro.subtasks[i].ar[j], pro.subtasks[i + 1].ar[j]);
		}
		for (int j = 0; j < ecnt; j++)
		{
			pro.subtasks[i].er[j] = min(pro.subtasks[i].er[j], pro.subtasks[i + 1].er[j]);
		}
	}
}
if (type % 10 == 2)
{

}
return pro;

}

void contest(string contest_name, // 比赛名称 double time, // 比赛总时长 double attitude_dec, // 比赛消耗心态 double determination_mul, // 成绩对信心的影响 vector<pair<int, int> > pro_data, // 题目数据 {难度, 分值} vector<pair<string, pair<int, int> > prize) { // 奖项数据 {名称, {最低线, 最高线}} print_log(contest_name + ” 开始了”); attitude_dec = min(attitude, max((double)0, random_real_number() * 0.5 + attitude_dec - sa[7] * 0.8)); print_log(“由于比赛影响,心态自动减 ” + string_print(“%.4Lf”, attitude_dec)); attitude -= attitude_dec; // print_plot(); // pause; vector<problem> problemset; bool type = 0; if (contest_name == “CF Div.4” || contest_name == “CF Div.3” || contest_name == “CF Div.2” || contest_name == “CF Div.1” || contest_name == “CF Div.1+2”) { type = 1; } if (contest_name == “ABC” || contest_name == “ARC” || contest_name == “AGC”) { type = 2; } for (pair<int, int> i : pro_data) { problem_set.push_back(generate_problem(i.first + rand() % 1 - rand() % 1, 0, string("") + char(‘A’ + problemset.size()), second)); // if (type == 1) // { // problem_set.push_back(generate_problem(i.first + rand() % 1 - rand() % 1, 0, string(“T”) + char(‘1’ + problemset.size()), second)); // } /* if (type == 2) { problem_set.push_back(generate_problem(i.first + rand() % 1 - rand() % 1, 0, string("") + char(‘A’ + problemset.size()), second)); } if (type == 1) { if (i.first >= 4) { if (rand() % 36 == 0) {

C++
			}
		}
	}
	/
}
int cur_pro = 0;
double passed_time = 0;
while (true)
{

	plot(string("参加 ") + contest_name),=;
	add_plot("A 上一题     D 下一题     E 提前离场");
	add_plot("S 睡大觉     I 辱骂出题人");
	add_plot(string_print("%.4Lf/%.4Lf", passed_time, contest_name));
	add_plot(string("题目 ") + (string("T") + char('1' + cur_pro)));
	for (subtask i : problemset[cur_pro].subtasks)
	{
		add_choice()
	}
	print_plot();
	CONTEST_INPUT:
	getline(cin, input);
	if (input.size() != 1)
	{
		goto CONTEST_INPUT;
	}
	if (input[0] >= '1' && input[0] < '1' + problemset.size())
	{

	}
	if (input[0] == 'A')
	{
		cur_pro = (cur_pro + problemset.size() - 1) % problemset.size();
		continue;
	}
	if (input[0] == 'D')
	{
		cur_pro = (cur_pro + problemset.size() - 1) % problemset.size();
		continue;
	}
	if (input[0] == 'E')
	{
		break;
	}
	if (input[0] == 'S')
	{
		passed_time += random_real_number() * 0.2 + 1;
		continue;
	}
	/*
	if (input[0] == 'I')
	{
		passed_time += random_real_number() * 0.2 + 0.5;
		if (rand() & 1)
		{
			plot("辱骂出题人");
			add_plot("这场比赛真的太垃圾了,你忍不住对出题人的双亲进行问候,非常泄气");
			add_choice()
		}
		continue;
	}
	/
}

} */ signed main() { // freopen(“game.log”, “w”, stdlog); // cout << “中文\n”; cout << “调整你的窗口尽可能的大,最好全屏,防止邪恶的黑窗口自动换行” << endl; pause; clear_the_screen; cout << fixed << setprecision(4); srand(time(0));

C++
cout << "难度:" << endl; // 选择难度
for (int i = 0; i < dcnt; i++)
{
	cout << i + 1 << ": " << diff[i] << endl;;
}
do
{
	getline(cin, input);
} while (!(set<string>{"1", "2", "3", "4", "5", "D"}).count(input));
difficulty = input[0] - '1';
if (input == "D")
{
	difficulty = 0;
}
clear_the_screen;

// #define debug 1
bool debug = (input == "D");
do // 选择大模块实力分配
{
	double tot = 32.0 - difficulty * 4, sum = 0; /* can change */
	bool flag = true;
	for (int i = 0; i < mcnt; i++)
	{
		clear_the_screen;
		cout << "总大模块实力点为 " << tot << endl;
		cout << "请选择大模块实力分配(自动按输入数据比例分配)" << endl;
		for (int j = 0; j < mcnt; j++)
		{
			cout << module[j] << ": ";
			if (j < i)
			{
				cout << a[j];
			}
			cout << endl;
		}
		cout << "现在输入 " << module_[i] << " 的权重: ";
		if (!debug)
			cin >> a[i];
		else
			a[i] = 1;
		sum += a[i];
		if (a[i] < 0)
		{
			flag = false;
			break;
		}
	}
	if (sum == 0)
	{
		flag = false;
	}
	if (!flag)
	{
		cout << "Error..." << endl;
		getline(cin, input);
		pause;
		continue;
	}
	for (int i = 0; i < mcnt; i++)
	{
		ma[i] = tot / sum * a[i];
		// cout << ma[i] << "\t";
	}
	// cout << endl;
	break;
} while (true);

do // 选择小模块实力分配
{
	double tot = 10.0 - difficulty * 2, sum = 0; /* can change */
	bool flag = true;
	for (int i = 0; i < acnt; i++)
	{
		clear_the_screen;
		cout << "总小模块实力点为 " << tot << endl;
		cout << "请选择小模块实力分配(自动按输入数据比例分配)" << endl;
		for (int j = 0; j < acnt; j++)
		{
			cout << other_algo[j] << ": ";
			if (j < i)
			{
				cout << a[j];
			}
			cout << endl;
		}
		cout << "现在输入 " << other_algo_[i] << " 的权重: ";
		if (!debug)
			cin >> a[i];
		else
			a[i] = 1;
		sum += a[i];
		if (a[i] < 0)
		{
			flag = false;
			break;
		}
	}
	if (sum == 0)
	{
		flag = false;
	}
	if (!flag)
	{
		cout << "Error..." << endl;
		getline(cin, input);
		pause;
		continue;
	}
	for (int i = 0; i < acnt; i++)
	{
		aa[i] = tot / sum * a[i];
		// cout << aa[i] << "\t";
	}
	// cout << endl;
	break;
} while (true);

do // 选择非常规题目实力分配
{
	double tot = 5.0 - difficulty * 1, sum = 0; /* can change */
	bool flag = true;
	for (int i = 0; i < ecnt; i++)
	{
		clear_the_screen;
		cout << "总非常规题目实力点为 " << tot << endl;
		cout << "请选择非常规题目实力分配(自动按输入数据比例分配)" << endl;
		for (int j = 0; j < ecnt; j++)
		{
			cout << ex_type[j] << ": ";
			if (j < i)
			{
				cout << a[j];
			}
			cout << endl;
		}
		cout << "现在输入 " << ex_type_[i] << " 的权重: ";
		if (!debug)
			cin >> a[i];
		else
			a[i] = 1;
		sum += a[i];
		if (a[i] < 0)
		{
			flag = false;
			break;
		}
	}
	if (sum == 0)
	{
		flag = false;
	}
	if (!flag)
	{
		cout << "Error..." << endl;
		getline(cin, input);
		pause;
		continue;
	}
	for (int i = 0; i < ecnt; i++)
	{
		ea[i] = tot / sum * a[i];
		// cout << ea[i] << "\t";
	}
	// cout << endl;
	break;
} while (true);

do // 选择能力分配
{
	double tot = 5.0 - difficulty * 1, sum = 0; /* can change */
	bool flag = true;
	for (int i = 0; i < scnt; i++)
	{
		clear_the_screen;
		cout << "总能力点为 " << tot << endl;
		cout << "请选择能力分配(自动按输入数据比例分配)" << endl;
		for (int j = 0; j < scnt; j++)
		{
			cout << skill[j] << ": ";
			if (j < i)
			{
				cout << a[j];
			}
			cout << endl;
		}
		cout << "现在输入 " << skill_[i] << " 的权重: ";
		if (!debug)
			cin >> a[i];
		else
			a[i] = 1;
		sum += a[i];
		if (a[i] < 0)
		{
			flag = false;
			break;
		}
	}
	if (sum == 0)
	{
		flag = false;
	}
	if (!flag)
	{
		cout << "Error..." << endl;
		getline(cin, input);
		pause;
		continue;
	}
	for (int i = 0; i < scnt; i++)
	{
		sa[i] = tot / sum * a[i];
		// cout << sa[i] << "\t";
	}
	// cout << endl;
	break;
} while (true);

clear_the_screen;
for (int i = 0; i < mcnt; i++)
{
	cout << module[i] << ": " << ma[i] << endl;
}
for (int i = 0; i < acnt; i++)
{
	cout << other_algo[i] << ": " << aa[i] << endl;
}
for (int i = 0; i < ecnt; i++)
{
	cout << ex_type[i] << ": " << ea[i] << endl;
}
for (int i = 0; i < scnt; i++)
{
	cout << skill[i] << ": " << sa[i] << endl;
}
getline(cin, input);
pause;

attitude = 16 - 2 * difficulty;
determination = 2500 - 500 * difficulty;

if (debug)
{
	determination = 10000000;
}

clear_the_screen;
plot("我重生了?");
add_plot("参加完 2077 年的省队选拔后,高二的你意识到自己无缘今年省队了。也许从此就和 OI 无缘了。");
add_plot("你躺在床上,闭上眼,回想起自己曾经在 OI 赛场上挥洒汗水的场景。");
add_plot("眼泪还是流了出来。你不甘心,你觉得你还可以做得更好。");
add_plot("你突然惊醒,发现自己回到了高一前的暑假。");
add_plot("之前经历的一切仿佛是一场梦,却又那么真实。");
add_plot("你意识到,这一次,你还有机会。");
add_plot("你决定,这一次,让 OI 生涯不留遗憾。");
add_plot("你充满了决心。");
print_plots();
pause;

// long_training({"你很幸运地进入到了最好的高中,这里有着最好的师资力量,最好的学习氛围,最好的竞赛氛围。",
// 			   "现在是暑假,你开始进行长期训练,水平很快得到了提升。"});
while(1) {
	determination_shop();
	long_training();
}
/*
live(11);
before("CSP-S 高一");
contest("CSP-S 高一", 24 + sa[6] * 2, 3, 5, {{3, 100}, {4, 100}, {5, 100}, {6, 100}}, {{"没有奖项", {0, 0}},
																					   {"三等奖", {50, 100}},
																					   {"二等奖", {80, 150}},
																					   {"一等奖", {170, 230}},
																					   {"一等奖(第一名)", {400, 400}}});
live(7);
long_training({"你在上一个学期有了很大的提高",
			   "现在是寒假,你开始进行长期训练,水平很快得到了提升。"});
live(7);
if (score["CSP-S 高一"] >= rand() % 71 + 250)
{
	contest("WC 高一", 30 + sa[6] * 2, 5, 10, {{5, 100}, {7, 100}, {8, 100}}, {{"铁牌", {0, 0}},
																			   {"铜牌", {30, 80}},
																			   {"银牌", {80, 120}},
																			   {"金牌", {150, 170}},
																			   {"金牌(第一名)", {240, 250}}});
}
else
{
	plot("错过 WC");
	add_plot("尽管你错过了此次训练,但是你的 OI 生涯仍在继续");
	print_plot();
	pause;
}
*/

return 0;

}