跳到正文

个人记录

kill v0.6

Nights_watcher约 25 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2025年12月12日
篇幅
约 25 分钟

版本

  1. v1当前

花瓣介绍

设等级数为kk
k=1,2,3,4,5,6,7,8,9k=1,2,3,4,5,6,7,8,9
l=1,2,2,3,3,5,5,5,5l=1,2,2,3,3,5,5,5,5
basicbasic 对目标造成0.1k0.1k点伤害,每轮只能出一次
lightlight 对目标加上ll点lightslights值,并造成0.5lk0.5lk伤害
roserose 对自己回复kk点血,每轮只能出一次
ricerice 对目标造成0.5k0.5k点伤害
movemove 加一点距离或是减去一点距离,每轮只能出一次

标记介绍

lightsxlights_x 准备阶段,对自己造成0.5x0.5x点伤害,x−1x-1

怪物介绍

设等级数为kk
k=1,2,3,4,5,6,7,8,9k=1,2,3,4,5,6,7,8,9
s=0.2,0.6,1.2,2,3,4.2,5.6,7.2,9s=0.2,0.6,1.2,2,3,4.2,5.6,7.2,9
ladybugladybug 若受到xx点伤害,则扣x−sx-s点血(若x−s<0x-s<0,不受伤害),掉落light,roselight,rose,血量4k4k,攻击距离11

机制介绍

1.挑战

  1. 准备阶段
  2. 摸牌阶段,摸两张牌
  3. 出牌阶段,出牌(输入牌的编号),若超出使用次数或是攻击距离不够,自动取消牌效果。花朵的攻击范围为2
  4. 挑战成功可以获得花瓣

2.查看花瓣

  1. 会输出所有花瓣的情况,按下空格可退出

3.合成花瓣

  1. 会输出所有花瓣的情况
  2. 第一个问题下,回答你要合成的花瓣的名字(例如lightlight)
  3. 第二个问题下,回答你要合成的花瓣的等级名(例如CommonCommon)
  4. 第三个问题下,回答你要合成的花瓣的数量
C++
/*
. _                      The combination of the first letters of the first ten sentences together is TOOAMAZING.
.| |                    What ? What ? What ? What ? What ?
.| |                   Go back ! I ' ll ask you !
.| |____   __      __ No any way to solve this problem !
.|  __  \  \ \    / /In my opini , this impossible .
.| /  \ |   \ \  / /Zzzzzzzzzz ···
.| \__/ |    \ \/ /A nother idea is great !
.\______/     / _/My brain is broken !
.            / / Amazing !
.           / / Or a next way ?
.          / / Oh , my god !
.          |_|Ture or false ?
.first is this ↑.
*/
#include <bits/stdc++.h>
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <time.h>
#define pi 3.1415926
using namespace std;
mt19937 rnd (time (NULL) ^ clock ());
#define rd rnd ()
typedef BOOL (WINAPI * PROCSETCONSOLEFONT) (HANDLE , DWORD);
PROCSETCONSOLEFONT SetConsoleFont;
int have[5][10] , yours[105] , yourssl , mobs[105] , mobssl , maxof[5] = {1 , 1 , 1 , 1 , 1} , l[10] = {0 , 1 , 2 , 2 , 3 , 3 , 5 , 5 , 5 , 5} , jl1 , jl2;
double blood , bloodmobs , bj[1] , bjmob[1] , maxbl , mobsbl , ss[] = {0 , 0.2 , 0.6 , 1.2 , 2 , 3 , 4.2 , 5.6 , 7.2 , 9} , bzgl[10][10] =
{
	{} ,
	{0 , 0.5 , 0.25} ,
	{0 , 0.3 , 0.7} ,
	{0 , 0.1 , 0.35 , 0.55} ,
	{0 , 0 , 0.15 , 0.4 , 0.45} ,
	{0 , 0 , 0 , 0.05 , 0.75 , 0.2} ,
	{0 , 0 , 0 , 0 , 0.05 , 0.85 , 0.1} ,
	{0 , 0 , 0 , 0 , 0 , 0.5 , 0.45 , 0.05} ,
	{0 , 0 , 0 , 0 , 0 , 0.01 , 0.35 , 0.64} ,
	{0 , 0 , 0 , 0 , 0 , 0 , 0.23 , 0.77} ,
} , glhk[10] = {0 , 0.64 , 0.32 , 0.16 , 0.8 , 0.4 , 0.2 , 0.1 , 1};
bool sf[5];
string text , name_petal[] = {"basic" , "light" , "rose" , "rice" , "move"} , mob[] = {"ladybug"} , bjname[] = {"lights"} , djname[] = {"Common" , "Unusual" , "Rare" , "Epic" , "Legendary" , "Mythic" , "Ultra" , "Super" , "Unique"};
int main ();
void work ();
void SetPos (int x , int y);
string ltostr (long long x);
void Say (char * p , int x);
int Color (int R , int G , int B);
int toint (double a);
double Sin (int a);
double Cos (int a);
double SinP (int a);
double CosP (int a);
pair <int , int> pos ();
void qp ();
void Print (int a);
void s ();
void tz ();
void vs (int x);
void print (int x);
void getpetal (int x , int y);
void ck ();
void ch ();
void read ();
void save ();
int main () {work ();}
void work ()
{
	system ("mode con cols=500 lines=500");
	HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
	CONSOLE_CURSOR_INFO cursorInfo;
	GetConsoleCursorInfo (hOut , & cursorInfo);
	cursorInfo.bVisible = FALSE;
	SetConsoleCursorInfo (hOut , & cursorInfo);
	//start :
	Color (255 , 255 , 255);
	have[0][1] = 5;
	read ();
	while (1)
	{
		save ();
		system ("cls");
		Say ("1.Challenge\n2.View Petals\n3.Craft Petals\n" , 20);
		int x;
		cin >> x;
		if (x == 1) tz ();
		else if (x == 2) ck ();
		else if (x == 3) ch ();
	}
}
void SetPos (int x , int y)
{
	COORD pos;
	pos.X = y; pos.Y = x;
	SetConsoleCursorPosition (GetStdHandle (STD_OUTPUT_HANDLE) , pos);
}
string ltostr (long long x)
{
	if (x == 0) return "0";
	string s;
	bool flag = true;
	if (x < 0) {flag = 0; x = -x;}
	while (x) {s += char (x % 10 + '0'); x /= 10;}
	reverse (s.begin () , s.end ());
	if (! flag) s = "-" + s;
	return s;
}
void Say (char * p , int x) {while (1) {if (* p != 0) cout << char (* p ++); else break; Sleep (x);}}
int Color (int R , int G , int B)
{
	HANDLE hd = GetStdHandle (STD_OUTPUT_HANDLE);
	if (hd == INVALID_HANDLE_VALUE) return GetLastError ();
	DWORD dm = 0;
	if (!GetConsoleMode (hd , & dm)) return GetLastError ();
	dm != 0x0004;
	if (!SetConsoleMode (hd , dm)) return GetLastError ();
	wprintf (L"\033[38;2;%d;%d;%dm" , R , G , B);
}
int to_int (double a) {if (a > 0) return int (a + 0.5);	else if (a < 0) return int (-a - 0.5); if (a == 0) return 0;}
double Sin (int a) {return sin (pi * a / 180);}
double Cos (int a) {return cos (pi * a / 180);}
double SinP (int a) {return sin (pi * a);}
double CosP (int a) {return cos (pi * a);}
pair <int , int> pos ()
{
	POINT pt;
	GetCursorPos (& pt);
	HWND h = GetForegroundWindow ();
	ScreenToClient (h , & pt);
	return {pt.x / 8 , pt.y / 16};
}
void qp () {system ("cls");}
void Print (int a)
{
	HMODULE hKernel32 = GetModuleHandle ("kernel32");
	SetConsoleFont = (PROCSETCONSOLEFONT) GetProcAddress (hKernel32 , "SetConsoleFont");
	SetConsoleFont (GetStdHandle (STD_OUTPUT_HANDLE) , a);
}
void s () {Say (text.data () , 20);}
void tz ()
{
	system ("cls");
	Say ("Which mob are you challenge?\n" , 20);
	for (int i = 0;i < 1;i ++)
	{
		text = ltostr (i) + "." + mob[i] + '\n';
		s ();
	}
	int x;
	cin >> x;
	if (x > 0) return ;
	vs (x);
}
void vs (int x)
{
	yourssl = 0;
	mobssl = 0;
	memset (bj , 0 , sizeof (bj));
	memset (bjmob , 0 , sizeof (bjmob));
	jl1 = 1;
	jl2 = 1;
	system ("cls");
	Say ("Please chose the mob's grade(1~9):" , 20);
	int y;
	cin >> y;
	if (y < 1 || y > 9) return ;
	blood = 4;
	if (x == 0) bloodmobs = 4 * y;
	for (int i = 1;i <= 4;i ++) yours[++ yourssl] = rd % 5;
	for (int i = 1;i <= 4;i ++) mobs[++ mobssl] = rd % 5;
	maxbl = blood;
	mobsbl = bloodmobs;
	while (1)
	{
		system ("cls");
		Say ("Time to you.\n" , 20);
		print (x);
		text += "\nprepare...";
		if (bj[0]) blood -= 0.5 * (bj[0] --);
		s ();
		if (blood <= 0)
		{
			Say ("\nYou don't win!" , 20);
			break;
		}
		Sleep (3000);
		system ("cls");
		Say ("Time to you.\n" , 20);
		print (x);
		text += "\nget petals...";
		for (int i = 1;i <= 2;i ++) yours[++ yourssl] = rd % 5;
		s ();
		Sleep (3000);
		memset (sf , 0 , sizeof (sf));
		cp :
		system ("cls");
		Say ("Time to you.\n" , 20);
		print (x);
		text += "\ngive petals...Please chose the petal to give.If you don't want to give petals, please tell us 0.\n";
		s ();
		int sr;
		cin >> sr;
		if (sr > 0 && sr <= yourssl)
		{
			for (int i = sr;i < yourssl;i ++) swap (yours[i] , yours[i + 1]);
			int pai = yours[yourssl --];
			if (! sf[pai] || pai == 1 || pai == 3)
			{
				sf[pai] = 1;
				double sh = 0;
				if (pai == 0) sh += (jl2 <= 2) * 0.1 * maxof[0];
				else if (pai == 1) bjmob[0] += (jl2 <= 2) * l[maxof[1]] , sh += 0.5 * l[maxof[1]] * maxof[1];
				else if (pai == 2) blood = min (blood + maxof[2] , maxbl);
				else if (pai == 3) sh += (jl2 <= 2) * 0.5 * maxof[3];
				else
				{
					Say ("Please choose + or -. + please tell us 0, - please tell us 1.\n" , 20);
					int p;
					cin >> p;
					if (p) jl1 = max (1 , jl1 - 1) , jl2 = max (1 , jl2 - 1);
					else jl1 ++ , jl2 ++;
				}
				bloodmobs -= max ((double) 0 , sh - ss[y]);
			}
			if (bloodmobs <= 0)
			{
				Say ("You win!" , 20);
				getpetal (x , y);
				break;
			}
			goto cp;
		}
		system ("cls");
		text = "Time to " + mob[x] + ".\n";
		s ();
		print (x);
		text += "\nprepare...";
		if (bjmob[0]) bloodmobs -= max ((double) 0 , 0.5 * (bjmob[0] --) - ss[y]);
		s ();
		if (bloodmobs <= 0)
		{
			Say ("\nYou win!" , 20);
			getpetal (x , y);
			break;
		}
		Sleep (3000);
		system ("cls");
		text = "Time to " + mob[x] + ".\n";
		s ();
		print (x);
		text += "\nget petals...";
		for (int i = 1;i <= 2;i ++) mobs[++ mobssl] = rd % 5;
		s ();
		Sleep (3000);
		memset (sf , 0 , sizeof (sf));
		system ("cls");
		text = "Time to " + mob[x] + ".\n";
		s ();
		print (x);
		text += "\ngive petals...Please chose the petal to give.\n";
		s ();
		for (int i = 1;i <= mobssl;i ++)
		{
			int pai = mobs[i];
			if (pai == 4 && jl1 > 1 && !sf[4])
			{
				for (int j = 1;j < mobssl;j ++) swap (mobs[j] , mobs[j + 1]);
				mobssl --;
				sf[pai] = 1;
				text = "move\n";
				s ();
				Sleep (3000);
				Say ("Please choose + or -. + please tell us 0, - please tell us 1.\n1" , 20);
				Sleep (3000);
				jl1 = max (1 , jl1 - 1) , jl2 = max (1 , jl2 - 1);
				system ("cls");
				text = "Time to " + mob[x] + ".\n";
				s ();
				print (x);
				text += "\ngive petals...Please chose the petal to give.\n";
				s ();
				i --;
			}
		}
		for (int i = 1;i <= mobssl;i ++)
		{
			int pai = mobs[i];
			if ((pai == 0 && ! sf[pai] && jl1 <= 1) || (pai == 1 && jl1 <= 1) || (pai == 2 && bloodmobs < mobsbl && ! sf[pai]) || (pai == 3 && jl1 <= 1))
			{
				for (int j = 1;j < mobssl;j ++) swap (mobs[j] , mobs[j + 1]);
				mobssl --;
				sf[pai] = 1;
				if (pai == 0) blood -= 0.1 * y;
				else if (pai == 1) bj[0] += l[y] , blood -= 0.5 * l[y] * y;
				else if (pai == 2) bloodmobs = min (bloodmobs + y , mobsbl);
				else blood -= 0.5 * y;
				text = name_petal[pai];
				s ();
				Sleep (3000);
				system ("cls");
				text = "Time to " + mob[x] + ".\n";
				s ();
				print (x);
				text += "\ngive petals...Please chose the petal to give.\n";
				s ();
				i --;
			}
		}
		if (blood <= 0)
		{
			Say ("You don't win!" , 20);
			break;
		}
	}
	Sleep (3000);
}
void print (int x)
{
	text = mob[x] + " Petals:" + ltostr (mobssl) + " Blood:";
	s ();
	text = "";
	cout << bloodmobs;
	for (int i = 0;i < 1;i ++)
		if (bjmob[i]) text += " " + bjname[i] + "_" + ltostr (bjmob[i]);
	text += " move_to_you:" + ltostr (jl1) + "\nyou Petals:" + ltostr (yourssl) + " Blood:";
	s ();
	text = "";
	cout << blood;
	for (int i = 0;i < 1;i ++)
		if (bj[i]) text += " " + bjname[i] + "_" + ltostr (bj[i]);
	text += " move_to_mobs:" + ltostr (jl2) + "\n";
	for (int i = 1;i <= yourssl;i ++) text += name_petal[yours[i]] + " ";
}
void getpetal (int x , int y)
{
	if (x == 0)
	{
		int he = 0 , k = rd % 100;
		for (int i = 1;i <= 9;i ++)
		{
			he += bzgl[y][i] * 100;
			if (k < he)
			{
				have[1][i] ++;
				maxof[1] = max (maxof[1] , i);
				break;
			}
		}
		he = 0 , k = rd % 100;
		for (int i = 1;i <= 9;i ++)
		{
			he += bzgl[y][i] * 100;
			if (k < he)
			{
				have[2][i] ++;
				maxof[2] = max (maxof[2] , i);
				break;
			}
		}
	}
}
void ck ()
{
	system ("cls");
	for (int i = 0;i < 5;i ++)
		for (int j = 1;j <= 9;j ++)
			if (have[i][j])
			{
				text = djname[j - 1] + "_" + name_petal[i] + ":" + ltostr (have[i][j]) + " ";
				s ();
			}
	char c = _getch ();
}
void ch ()
{
	system ("cls");
	for (int i = 0;i < 5;i ++)
		for (int j = 1;j <= 9;j ++)
			if (have[i][j])
			{
				text = djname[j - 1] + "_" + name_petal[i] + ":" + ltostr (have[i][j]) + " ";
				s ();
			}
	Say ("What petals do you want to craft?\n" , 20);
	string s;
	cin >> s;
	for (int i = 0;i < 5;i ++)
		if (s == name_petal[i])
		{
			Say ("What grade petals do you want to craft?\n" , 20);
			cin >> s;
			for (int j = 1;j <= 8;j ++)
				if (s == djname[j - 1])
				{
					Say ("How many petals do you want to craft?\n" , 20);
					int x;
					cin >> x;
					if (x <= have[i][j])
					{
						while (x >= 5)
						{
							x -= 5;
							have[i][j] -= 5;
							int ks = rd % 100;
							if (ks < glhk[j] * 100) have[i][j + 1] ++;
							else
							{
								ks = rd % 5;
								x += ks;
								have[i][j] += ks;
							}
						}
					}
				}
		}
}
void read ()
{
	ifstream fin ("cd2.ioi");
	for (int i = 0;i < 5;i ++)
		for (int j = 1;j <= 9;j ++) fin >> have[i][j];
	for (int i = 0;i < 5;i ++) fin >> maxof[i];
	fin.close ();
}
void save ()
{
	ofstream fout ("cd2.ioi");
	for (int i = 0;i < 5;i ++)
		for (int j = 1;j <= 9;j ++) fout << have[i][j] << " ";
	for (int i = 0;i < 5;i ++) fout << maxof[i] << " ";
	fout.close ();
}
/*
. _                      The combination of the first letters of the first ten sentences together is TOOAMAZING.
.| |                    What ? What ? What ? What ? What ?
.| |                   Go back ! I ' ll ask you !
.| |____   __      __ No any way to solve this problem !
.|  __  \  \ \    / /In my opini , this impossible .
.| /  \ |   \ \  / /Zzzzzzzzzz ···
.| \__/ |    \ \/ /A nother idea is great !
.\______/     / _/My brain is broken !
.            / / Amazing !
.           / / Or a next way ?
.          / / Oh , my god !
.          |_|Ture or false ?
.first is this ↑.
*/
原文