首页 > 编程知识 正文

西门子dp头接线示意图,profibusdp接线方法

时间:2023-05-04 15:43:46 阅读:58626 作者:945

主题说明

出了纳米网格,一些网格不能铺纱,其他网格必须铺纱,形成闭合回路。 有几种铺法?

第一行,n,m(2=n,m=12 ) )。

4 4

*…

2

4 4

6

# include cstdio # include iostream # include cstring # include string # include cmath # include algorithm # include iterator # include include include map # includeset # definelllonglong # definemo 590027 usingnamespacestd; int n,m,mapx[20][20]={0},endx,endy; ll all_ans=0,dp[2][600000]={0}; int bits[28]={0}; int state[2][600000]={0},tots[2]={0}; int pre=1,cnt=0; struct hash_table{ int pre,to; }idx[600000]={0}; int ptr[600000]={0},at=0; inlinevoidreadx(intx ) x=0; int k=1; 注册器char ch=0; wile(ch(0)|ch (9) ) { ch=getchar ); if(ch=='-' ) k=-1; }while(ch='0'ch='9' ) {x=x*10 ch-'0); ch=getchar (; } x*=k; }在线语音读取() readx ) ) n; readx(m char cht=0; for(intI=1; i=n; I ) for(intj=1; j=m; j ) { cht=0; 威尔(cht!='.' cht! 浅白的皮虾() cht=getchar ) ); if(cht=='.' ) { mapx[i][j]=1; endx=i; endy=j; } }}inline void init_bits () for ) intI=1; i=25; I ) bits[I]=(I1 ); }inlinevoidhah(intsta,ll val ) { int key=sta%mo; for(intprex=ptr[key]; prex; prex=idx [ prex ].pre ] if [ state [ CNT ] [ idx [ prex ].to ]==sta ] { DP [ CNT ] [ idx [ prex ].to迷人的糖豆=val; 返回; (tots ) CNT魅力糖豆; state[cnt][tots[cnt]]=sta; dp[cnt][tots[cnt]]=val; idx[ at].pre=ptr[key]; idx[at].to=tots[cnt]; ptr[key]=at; }inline void DP () { tots[cnt]=1; dp[cnt][1]=1; state[cnt][1]=0; for(intI=1; i=n; I ) for(intj=1; j=tots[cnt]; j ) state[cnt][j]=2; for(intj=1; j=m; j () { at=0; 短信(ptr,0,sizeof ptr ); SWAP(pre,cnt ); tots[cnt]=0; register int nowsta,is_d,is_r; 注册者LL Nowans; for(intk=1; k=tots[pre]; k({nowsta=state[pre][k],nowans=dp[pre][k]; is_d=(Nowstabits[j] ) 4,is _ r=(nowstabits [ j-1 ] ) 4; if (! mapx[I][j]}{if (! is_d ()! is_r ) ) hah (新sta,新nowans ); } else if ((! is_d ()! is_r () if ) mapx[I1][j]mapx[I][j1] ) hah ) nowsta(1bits(j-1 ) )1bits[j] ),nowans ); } else if ((! is_d(is_r ) ) if ) mapx[I1][j] ) hah ) nowsta,nowans ); if(MapX[I][j1] ) hah ) nowsta-is_r* )1bits[j-1] ) is_r* )1bits[j],nowans ); }elseif(is_d (! is_r ) ) (if ) MapX[I][j1] ) hah ) Nowsta,nowans ); if(MapX[I1][j] ) hah ) nowsta-is_d* )1bits[j] ) is_d*(1bits[j-1] ),nowans ); }elseif(is_d==1is_r==1) { register int count=1; for(intL=j1; l=m; l () if ) ) Nowstabits[L] ) %4==1) count; elseif () Nowstabits[L] ) %4==2) count--; if (! count () hah ) nowsta-(1bits[L]-)1bits [ j ]-(1bits [ j-1 ],nowans ); 布雷克; }}elseif(is_d==2is_r==2) { register int count=1; for(intL=j-2; l=0; L--}{if () Nowstabits[L] ) %4==1) count--; elseif () Nowstabits[L] ) %4==2) count; if (! count () hah ) nowsta-2* )1bits[j]-2* )1bits[j-1] )1bits[l],nowans ); 布雷克; }}elseif(is_d==1is_r==2) hah ) nowsta-2* )1bits[j-1] )-(1bits[j],nowans ); elseif(is_r==1is_d==2) if ) I==endxj==endy ) all_ans=(ll ) nowans; } } }}int main () ) { readit ); init_bits (; DP (; printf('%lldn ',all_ans ); 返回0; }

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。