提交时间:2021-05-11 19:02:18

运行 ID: 19183

#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[100001]; void Check(){ int Gene_Numerical=1,Gene_Count=0; for(int i=1;i<=Length_Gene-Part_Gene+1;i++){ for(int j=i;j>=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; } } 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=1;i<=Gene_MAXN;i++){ if(Gene_Y[i]!=0) Answer_Gene++; } cout<<Answer_Gene; return 0; }