Gravatar
LBW
积分:13
提交:9 / 50
×

提示!

该题解未通过审核,建议分享者本着启发他人,照亮自己的初衷以图文并茂形式完善之,请勿粘贴代码。

#include <iostream>

using namespace std;

int n,m,num=0;

int bz[100][100];

int dx[4]={-1,0,1,0},

   dy[4]={0,1,0,-1};

void doit(int p,int q){

num++;

int h[1000][3];

int x,y,t,w;

t=0;w=1;h[1][1]=p;h[1][2]=q;

do{

t++;

for(int i=0;i<4;i++){

x=h[t][1]+dx[i];y=h[t][2]+dy[i];

if(x>=0&&x<m&&y>=0&&y<n&&bz[x][y])

{

w++;h[w][1]=x;h[w][2]=y;

bz[x][y]=0;

}

}

}while(t<w);

}

int main(){

........................................................................

该题解等待再次审核

........................................................................(剩余 723 个中英字符)

题目560  细胞个数
2024-07-17 10:56:16    
Gravatar
seastar
积分:2
提交:1 / 12
×

提示!

该题解未通过审核,建议分享者本着启发他人,照亮自己的初衷以图文并茂形式完善之,请勿粘贴代码。

#include<bits/stdc++.h>

using namespace std;

int dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};

int sum=0,m,n,xb[100][100];

void doit(int p,int q)

{

int x,y,t,w,i;

int h[1000][3];

sum++;xb[p][q]=0;

t=0;w=1;h[1][1]=p;h[1][2]=q;

do{

t++;

for(i=0;i<=3;i++){

x=h[t][1]+dx[i];

y=h[t][2]+dy[i];

if((x>=0)&&(x<m)&&(y>=0)&&(y<n)&&(xb[x][y])){

w++;

h[w][1]=x;

h[w][2]=y;

xb[x][y]=0;

}

}

}while(t<w);

}

int main()



........................................................................

该题解等待再次审核

........................................................................(剩余 748 个中英字符)

题目560  细胞个数
2024-07-17 10:15:49    
Gravatar
汪越森
积分:10
提交:5 / 11
×

提示!

该题解未通过审核,建议分享者本着启发他人,照亮自己的初衷以图文并茂形式完善之,请勿粘贴代码。

#include<iostream>

#include<cstdio>

#include<cstring>

#include<algorithm>

#define x first

#define y second

using namespace std;

typedef pair<char,char> PCC;


const int N = 3010;

PCC pcc[N];


int main()

{

 int n, len;

 cin >> n >> len;

 if(n == 1){

   puts("1");

   return 0;

 }

 for(int i = 1; i <= n; i ++)

 {

   string s;

   cin >> s;

   char minc = s[0], maxc = s[0];

   for(int j = 1; j < len; j ++ )

   {

     if(s[j] < minc) minc = s[j

........................................................................

该题解等待再次审核

........................................................................(剩余 955 个中英字符)

题目3953  [NOIP 2023]词典
2024-07-17 09:40:09    
Gravatar
1nclude
积分:326
提交:159 / 584
×

提示!

该题解未通过审核,建议分享者本着启发他人,照亮自己的初衷以图文并茂形式完善之,请勿粘贴代码。
dfs意义:从x过来的最小值 记忆化dfs定义f数组存储结果 //dfs函数 long long int dfs(int x,int lwalk,int rwalk) { if(f[x][lwalk][rwalk]!=0x7f7f7f7f7f7f7f7f) return f[x][lwalk][rwalk]; if(x==0) return f[x][lwalk][rwalk]=0; if(lwalk==0&&rwalk==0&&mp[b[x]]) return f[x][lwalk][rwalk]=min(min(min(min(dfs(x-1,0,0),dfs(x-1,1,0)),dfs(x-1,2,0)),dfs(x-1,0,1)),dfs(x-1,0,2)); else if(lwalk==0&&rwalk==1) return f[x][lwalk][rwalk]=min(min(dfs(x-1,1,0)+r[x],dfs(x-1,2,0)+r[x]),dfs(x-1,0,0)+r[x]); else

........................................................................

该题解等待再次审核

........................................................................(剩余 492 个中英字符)

题目3979  篮球 AAAAAAAAAAAAAAAAAAAA
2024-06-22 03:56:21    
Gravatar
石页嘉
积分:5
提交:3 / 26
×

提示!

该题解未通过审核,建议分享者本着启发他人,照亮自己的初衷以图文并茂形式完善之,请勿粘贴代码。
                  #include<bits/stdc++.h>        using namespace std;                int main()        {            freopen("split.in","r",stdin);            freopen("split.out","w",stdout);                        int a,i=2;            cin>>a;           &n

........................................................................

该题解等待再次审核

........................................................................(剩余 568 个中英字符)

题目3979  篮球
2024-05-28 20:36:09    
Gravatar
noi加油
积分:74
提交:60 / 256
×

提示!

该题解未通过审核,建议分享者本着启发他人,照亮自己的初衷以图文并茂形式完善之,请勿粘贴代码。

#include<bits/stdc++.h>

using namespace std;

int main()

{

freopen("title.in","r",stdin);

freopen("title.out","w",stdout);

char n[5];

int m,l;

gets(n);

m=strlen(n);



........................................................................

该题解等待再次审核

........................................................................(剩余 294 个中英字符)

题目3049  [NOIP 2018PJ]标题统计
2024-01-04 20:08:13