提交时间:2021-05-12 17:14:36

运行 ID: 19218

#include<bits/stdc++.h> using namespace std; int Length_Gene,Part_Gene,Model_Gene,Answer_Gene; int Gene_MAXN=0; int Gene_X[100001]; int Gene_Y[34]; void Check(){ int Gene_Numerical=1,Gene_Count=0; for(int i=Part_Gene;i<=Length_Gene-Part_Gene+1;i++){ for(int j=i;j>=i-Part_Gene+1;j--){ Gene_Count+=Gene_X[j]*Gene_Numerical; Gene_Numerical*=10; } if(Gene_Y[Gene_Count]==0) Gene_Y[Gene_Count]=Gene_Count; if(Gene_Count>Gene_MAXN) Gene_MAXN=Gene_Count; Gene_Count=0; } } int main(){ cin>>Length_Gene>>Part_Gene>>Model_Gene; int Number_Gene; for(int i=1;i<=Length_Gene;i++){ Number_Gene=Model_Gene*i%4; Gene_X[i]=Number_Gene; } Check(); for(int i=0;i<=Gene_MAXN;i++){ if(Gene_Y[i]!=0) Answer_Gene++; } cout<<Answer_Gene; return 0; }