跳到正文

jasonsun1

682266

DESTRUCTION3,2,1

在洛谷打开
资料、奖项与版本

资料

编号
682266
抓取
C++
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e3+5;
const int pos[4][2]={-1,0,0,-1,1,0,0,1};
int n,m;
bool vis[MAXN][MAXN];
int dis[MAXN][MAXN];
char a[MAXN][MAXN];
struct node{
	int x,y,step,dic;
	bool operater < (const node &t) const{
		return step>t.step;
	}
}now,nt;
bool bfs(int xs,int ys,int xe,int ye){
	q.push(Node{xs,ys,0});
	vis[xs][ys]=1
	while(!q.empty()){
		now = q.top();q.pop();
		if(now.x==xe && now.y==ye){
			printf("%d",)
			return;
		}
		for(int i=0;i<4;i++){
			nt.x=now.x+pos[i][0];
			nt.y=now.y+pos[i][1];
			int x = getstep(a[now.x][now.y],i);
			for(int j = 1;j<= 3;j++){
				nt.x = now.x+pos[i][0]*j;
				nt.y = now.y+pos[i][1]*j;
				if(nt.x<0 || nt.x>=n||nt.y<0||nt.y>=n) break;
				if(a[nt.x][nt.y]=='#') break;
				if(vis) continue;
				vis[nt.x][nt.y] = 1;
				nt.step = now.step+1+x;
				a[nt.x][nt.y]=
				q.push(nt);
			} 
		}
	}
}
C++
#include<bits/stdc++.h>
#include<windows.h>
#include<time.h>
#include<conio.h>
using namespace std;
int xr=0,evtask,jctask,wltask,hdtask,evtas,jctas,wltas,hdtas;
char ch; 
void Read()
{
    ifstream in("萤火突击存档.log");
    in.close();
}
void Save()
{
    ofstream out("萤火突击存档.log");
    out.close();
}
void tasks(){
	system("cls");
	printf("1:主线任务;\n2:悬赏任务;\n3:日常任务;\n4:赛季任务;");
	ch = getchar();
	if(ch == 59){
		if(hdtask == 0){
			printf("收到一个来自海蒂的任务!\n");
			hdtask += 1;
		}
		
	}
}
void startup(){
	printf("1:进入避难所\n2:用户中心");
	ch = getchar();
	if(ch == 49){
		return;
	}
	if(ch == 50){
		printf("暂未开放!");
		//players();
	}
	else{
	    return;	
	}
}
int main(){
	startup();
	for(;;){
		system("cls");
		printf("1:任务区\n2:活动区\n3:部署区\n4:商店区");
		ch = getchar();
		if(ch == 49) tasks();
		if(ch == 50) //actvities();
		if(ch == 51) //maps();
		if(ch == 52) //shop();
		else{
			system("cls");
			printf("请重新输入");
		}
	} 
}

不是哥们

C++
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e5+5;
bool vis[MAXN][MAXN];
struct node{
	int x,y,step;
}q[MAXN*MAXN];
int a[MAXN][MAXN];
int pos[4][2]={-1,0,0,-1,1,0,0,1};
void bfs(int xs,int ys,int xe,int ye,int n,int m){
	int front = 1,rear = 0;
	memset(vis,0,sizeof(vis));
	memset(a,0,sizeof(a));
	q[++rear]={xs,ys,0};
	vis[xs][ys] = 0;
	while(front <= rear){
		node now = q[++rear];
		if(now.x==xe&&now.y==ye){
			printf("%d\n",now.step);
			return;
		}
		for(int i = 0;i<4;i++){
			node nt;
			nt.x=now.x+pos[i][0];
			nt.y=now.y+pos[i][1];
			if(nt.x<0 || nt.x>=n||nt.y<0||nt.y>=n){
				continue;
			}
			if(a[nt.x][nt.y]=='#') continue;
			if(vis[nt.x][nt.y]) continue;
			vis[nt.x][nt.y]=1;
			nt.step = now.step + 1;
			q[++rear] = nt;
		} 
	}
	printf("No");
}
int main(){
	
}

战绩可查

rks15.30217

AP:

micro vav

蝎虎天体

chronomia

Don’t never around

future mind

重生

you are the miserable

共 1 篇
  1. 个人记录

    dabi0.0.3

    这段C++代码实现了一个回合制游戏的逻辑,模拟两个玩家(a和b)通过输入指令进行资源消耗与积累的战斗系统。主要功能包括: 变量定义:声明了多个整型和浮点型变量,用于记录血点、盾牌(闪电盾、雷电盾、元素盾)、技能次数等游戏状态。 round函数:处理单个回合的逻辑,根据输入指令(如"dx"、"s"、"chui"等)执行以下操作: 消耗特定资源(如血点、盾牌)并增加对应收益。 检查资源是否足够,不足则返回特定数值(3/4/6)表示失败或特殊结果。 计算剩余资源并分配空回合次数(bk/ak)。 main函数:循环调用round函数,根据返回值输出战斗结果(如"b卒一根儿"),若资源不足则结束游戏。同时统计并输出双方消耗的资源和空回合信息。 核心机制:通过指令触发资源转换与消耗,最终根据资源状态判断胜负或继续战斗,模拟了回合制策略游戏的资源管理与胜负判定逻辑。