dp[now][i][ ppp[j] ]=0; dp[now][0][1]=1; FOR(i,1,K)///K次 { now^=1; FOR(j,0,N)FOR(k,0,pos-1) dp[now][j][ ppp[k] ]=0;///clear dp FOR(j,i-1,N)///至少是1 FOR(k,0,pos-1) { if(dp[now^1][j][ ppp[k] ]==0)continue; FOR(p,0,pos-1)///新...