借着为群里选管理员的机会,向大家抛出了一个编程游戏,大家踊跃参加,现在分享其中八位朋友的源码,供大家学习交流:
# @CNimage
'''
m1=[[6,4,0,3],0,2]
m2=[[3,6,5,9],0,2]
m3=[[0,1,9,7],0,1]
m4=[[8,9,6,4],0,1]
m5=[[5,8,3,0],2,2]
m6=[[1,3,8,6],0,2]
m1=[[3,7,2,9],2,0]
m2=[[1,6,9,7],0,2]
m3=[[7,8,1,2],0,2]
m4=[[4,1,2,9],2,0]
m5=[[5,2,6,8],0,1]
m6=[[2,9,3,1],0,3]
'''
m1=[[3,4,1,9],0,2]
m2=[[8,3,4,5],0,2]
m3=[[5,9,7,4],1,1]
m4=[[6,7,2,3],0,1]
m5=[[7,0,8,1],0,1]
m6=[[9,8,3,7],0,2]
def right_order(t1,t2):
t3=[t1[0]-t2[0][0],t1[1]-t2[0][1],t1[2]-t2[0][2],t1[3]-t2[0][3]]
return t3.count(0) == t2[1]
def right_num(t1,t2):
return len(set(t1)&set(t2[0])) == t2[1]+t2[2]
def list_to_list(t1):
t2=str(t1)
if len(t2)<4:
new_list = [0,int(t2[0]),int(t2[1]),int(t2[2])]
else:
new_list = [int(t2[0]),int(t2[1]),int(t2[2]),int(t2[3])]
return new_list
i1=range(100,9900)
i2=[]
for t1 in range(len(i1)):
t2=list_to_list(i1[t1])
i2.append(t2)
for t1 in range(len(i1)):
if right_order(i2[t1],m1) == True and right_order(i2[t1],m2) == True and right_order(i2[t1],
m3) == True and right_order(i2[t1],m4) == True and right_order(i2[t1],
m5) == True and right_order(i2[t1],m6) == True and right_num(i2[t1],m1) == True and right_num(i2[t1],
m2) == True and right_num(i2[t1],m3) == True and right_num(i2[t1],m4) == True and right_num(i2[t1],
m5) == True and right_num(i2[t1],m6) == True:
print i2[t1]
else:
pass
// @~XiaoQ~
// ConsoleApplication5.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include <assert.h>
#include <stdio.h>
#include <map>
#include <vector>
using namespace std;
#define MAX_NUM_LENGTH 4
int get_a_num(int src_num, int dest_num);
int get_b_num(int src_num, int dest_num, int a_num);
bool check_rule_result(int src_num, int dest_num, const char * check_resut);
typedef map<int , string> rule_map;
vector<rule_map> m_rule_map_vec;
void load_rules()
{
rule_map rule_map1;
rule_map1.insert(make_pair(6403, "0A2B"));
rule_map1.insert(make_pair(3659, "0A2B"));
rule_map1.insert(make_pair(197, "0A1B"));
rule_map1.insert(make_pair(8964, "0A1B"));
rule_map1.insert(make_pair(5830, "2A2B"));
rule_map1.insert(make_pair(1386, "0A2B"));
m_rule_map_vec.push_back(rule_map1);
rule_map rule_map2;
rule_map2.insert(make_pair(3729, "2A0B"));
rule_map2.insert(make_pair(1697, "0A2B"));
rule_map2.insert(make_pair(7812, "0A2B"));
rule_map2.insert(make_pair(4129, "2A0B"));
rule_map2.insert(make_pair(5268, "0A1B"));
rule_map2.insert(make_pair(2931, "0A3B"));
m_rule_map_vec.push_back(rule_map2);
rule_map rule_map3;
rule_map3.insert(make_pair(3419, "0A2B"));
rule_map3.insert(make_pair(8345, "0A2B"));
rule_map3.insert(make_pair(5974, "1A1B"));
rule_map3.insert(make_pair(6723, "0A1B"));
rule_map3.insert(make_pair(7081, "0A1B"));
rule_map3.insert(make_pair(9837, "0A2B"));
m_rule_map_vec.push_back(rule_map3);
}
void do_result (int rule_id)
{
if(rule_id < 0 || rule_id >= m_rule_map_vec.size())
{
cout << "do result error!";
return;
}
rule_map rule = m_rule_map_vec.at(rule_id);
for (int i = 1000 ; i < 9999; i++)
{
bool error = false;
rule_map::const_iterator it = rule.begin();
for( ; it != rule.end(); ++ it)
{
if(!check_rule_result(i, it->first, it->second.c_str()))
{
error = true;
break;
}
}
if(error)
{
continue;
}
cout << "result:" << i << endl;
}
}
int _tmain(int argc, _TCHAR* argv[])
{
load_rules();
while (true)
{
cout << "please input question num 1~3 or quit to exit!" << endl;
string key ;
cin >> key;
if(key == "quit")
{
break;
}
else if(key == "1"
|| key == "2"
|| key == "3")
{
int key2 = atoi(key.c_str());
do_result(key2 -1);
}
else
{
cout << " input error!";
}
}
return 0;
}
//比较两个数值,
//位置跟值相等返回A
//数值相等返回B
bool check_rule_result(int src_num, int dest_num, const char * check_resut)
{
char temp[64] = {0};
int a_num = get_a_num(src_num, dest_num);
int b_num = get_b_num(src_num, dest_num, a_num);
sprintf_s(temp, sizeof(temp), "%dA%dB", a_num, b_num);
if(strcmp(check_resut, temp) == 0)
{
return true;
}
return false;
}
int get_a_num(int src_num, int dest_num)
{
int ret = 0 ;
for (int i = 0 ; i < MAX_NUM_LENGTH; i++)
{
int temp_src = src_num % 10;
int temp_dest = dest_num % 10;
if(temp_src == temp_dest)
{
ret ++;
}
//取每个位
src_num = src_num / 10;
dest_num = dest_num / 10;
}
return ret;
}
///判断所在数据中是否存在某个数值
bool check_in_num(char * src_temp, int check_num)
{
assert(check_num < 10);
char temp[64] = {0};
sprintf_s(temp, sizeof(temp), "%d", check_num);
bool ret = false;
for (int i = 0 ; i < strlen(src_temp); i++)
{
if(src_temp[i] == temp[0])
{
ret = true;
src_temp[i] = '_';
break;
}
}
return ret;
}
int get_b_num(int src_num, int dest_num, int a_num)
{
char temp[64] = {0};
sprintf_s(temp, sizeof(temp), "%d", src_num);
int ret = 0;
for (int i = 0 ; i < MAX_NUM_LENGTH; i++)
{
int tem_num = dest_num % 10;
if(check_in_num(temp, tem_num))
{
ret ++;
}
//取每个位
dest_num = dest_num / 10;
}
return ret - a_num;
}
// @aslongas
#include<iostream>
#include<cstring>
using namespace std;
string ans,a,b,c,d;
string cmp[6];
string ab[6];
int aa[6]={0},bb[6]={0};
void detect(string s,int num){
int i,j;
for (i=0;i<4;i++){
for (j=0;j<4;j++){
if (i==j){
if (s[i]==cmp[num][j]){
aa[num]++;
}
}else{
if (s[i]==cmp[num][j]){
bb[num]++;
continue;
}
}
}
}
}
int main(){
int p=1;
int i1,i2,i3,i4,j;
for (j=0;j<6;j++){
cin>>cmp[j]>>ab[j];
}
for (i1=0;i1<=9;i1++){
a='0'+i1;
for (i2=0;i2<=9;i2++){
b='0'+i2;
if (a==b){
continue;
}
for (i3=0;i3<=9;i3++){
c='0'+i3;
if (a==c||b==c){
continue;
}
for (i4=0;i4<=9;i4++){
d='0'+i4;
if (a==d||b==d||c==d){
continue;
}
ans=a+b+c+d;
int num;
for (num=0;num<6;num++){
detect(ans,num);
if (aa[num]!=ab[num][0]-'0'||bb[num]!=ab[num][2]-'0'){
p=0;
break;
}
}
memset(aa,0,sizeof(aa));
memset(bb,0,sizeof(bb));
if (p==1)
cout<<ans<<endl;
p=1;
}
}
}
}
return 0;
}
# @ENegatiVY
#作者QQ: 996450958
#语言:python3.60
#主要思路:通过检查各个数字出现的频率,优先考虑最有可能的数字组合
#测试方法: 直接运行
#自行测试结果
#the answer is 5038
#the answer is 3189
#the answer is 4968
#total time is 0.05846549711057122
import re #正则表达式模块
import time #时间模块
import itertools #排列组合模块
rule1 = {'6403': '0A2B', '3659': '0A2B', '0197': '0A1B', '8964': '0A1B', '5830': '2A2B', '1386': '0A2B'}
rule2 = {'3729': '2A0B', '1697': '0A2B', '7812': '0A2B', '4129': '2A0B', '5268': '0A1B', '2931': '0A3B'}
rule3 = {'3419': '0A2B', '8345': '0A2B', '5974': '1A1B', '6723': '0A1B', '7081': '0A1B', '9837': '0A2B'}
def dict2list(dic:dict):
''' 将字典转化为列表 '''
keys = dic.keys()
vals = dic.values()
lst = [(key, val) for key, val in zip(keys, vals)]
return lst
def generatefrequencylist(ruledict,ruletuple):
'''生成每个数字出现(权重)频率的列表,用来简化检索流程'''
keylist = list(ruledict.keys())
frequencylist = initialfrequencydict()
for i in keylist:
checkresult = ruledict.get(i)
frequencynum = re.findall('([0-4])+', checkresult)
numweight = int(frequencynum[0]) + int(frequencynum[1]) # 根据AB的值来确定本组每一个数字的频率
i = int(i)
for j in range(1, 5):
keynum = i % 10
frequencylist[str(keynum)] = int(str(frequencylist.get(str(keynum)))) + numweight
i = i//10
if numweight ==4:
'''权重为4时 直接采用此数字排列组合查找正确结果'''
templist = list(itertools.permutations(splitnum(i), 4))
for j in templist:
num = j[0] * 1000 + j[1] * 100 + j[2] * 10 + j[3]
if checknum(num, ruletuple):
return
frequencylist = dict2list(frequencylist)
templist = sorted(frequencylist, key=lambda d: d[1], reverse=True)
formedlist = []
for i in range(0, 10):
formedlist.append(int(templist[i][0]))
return formedlist
def initialfrequencydict():
'''生成一个初始的权重字典,每个数字权重都是0'''
frequencylist = {}
for i in range(0, 10):
frequencylist[str(i)] = 0
return frequencylist
def splitnum(num):
'''把一个四位数分解成一个数字列表'''
list = []
for i in range(0, 4):
list.append(num % 10)
num = num//10
return list
def picknum(numlist10, ruletuple):
'''从权重列表里优先调用最可能的数字来产生结果,然后检查数字是否符合规则'''
for i in range(4,11):
templist = list(itertools.permutations(numlist10[:i], 4))
for j in templist:
num = j[0]*1000 + j[1]*100 + j[2]*10 + j[3]
if checknum(num, ruletuple):
return
def checknum(num,ruletuple):
'''检查此数字是否符合规则'''
A = 0
B = 0
for i in ruletuple:
guessnum = int(i[0])
result = str(i[1])
list1 = splitnum(num)
list2 = splitnum(guessnum)
for i in range(0,4):
if list1[i]==list2[i]:
A=A+1
for k in list1:
if k in list2:
B= B+1
ablist= re.findall('([0-9])', result)
if (A == int(ablist[0]) and (B-A == int(ablist[1]))):
A = 0
B = 0
continue
else:
return False
print('the answer is ' + str(num))
return True
def main():
start = time.clock()
rule1tuple = dict2list(rule1)
rule2tuple = dict2list(rule2)
rule3tuple = dict2list(rule3)
formedlist = generatefrequencylist(rule1, rule1tuple)
picknum(formedlist, rule1tuple)
formedlist = generatefrequencylist(rule2, rule2tuple)
picknum(formedlist, rule2tuple)
formedlist = generatefrequencylist(rule3, rule3tuple)
picknum(formedlist, rule3tuple)
end = time.clock()
print('total time is ' + str(end - start))
main()
代码中思路讲解的很清晰,可读性好。
// @给我根牙签我能翘起地球
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <stack>
#include <queue>
#include <vector>
#include <cmath>
#include <algorithm>
#define mem(a,b) memset(a,b,sizeof(a))
#define maxnum 300
#define inf 0x3f3f3f3f
using namespace std;
int flag;
int main()
{
char a[100],b[100][100],c[100][100];
for(int i=0; i<6; i++)
scanf("%s%s",b[i],c[i]);
for(int i=1000; i<10000; i++)
{
flag=0;
sprintf(a,"%d",i);
for(int j=0; j<6; j++)
{
int a1=c[j][0]-'0';
int b1=c[j][2]-'0';
int a2=0,b2=0;
for(int k=0; k<4; k++)
{
if(a[k]==b[j][k])
a2++;
for(int l=0; l<4; l++)
{
if(a[k]==b[j][l])
b2++;
}
}
b2-=a2;
if(a1==a2&&b1==b2)
flag++;
}
if(flag==6)
printf("答案是:%d \n",i);
}
return 0;
}
简洁。
// @猫
// numGame.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#include <list>
#include <numeric>
#include <algorithm>
using namespace std;
typedef list<string> strList;
bool Check(string str,int num[],int type[]);
void getanswer(int num[][4],int type[][4]);
int _tmain(int argc, _TCHAR* argv[])
{
int num1[6][4] = {{6,4,0,3},{3,6,5,9},{0,1,9,7},{8,9,6,4},{5,8,3,0},{1,3,8,6}};
int type1[6][4] = {{0,'A',2,'B'},{0,'A',2,'B'},{0,'A',1,'B'},{0,'A',1,'B'},{2,'A',2,'B'},{0,'A',2,'B'}};
int num2[6][4] = {{3,7,2,9},{1,6,9,7},{7,8,1,2},{4,1,2,9},{5,2,6,8},{2,9,3,1}};
int type2[6][4] = {{2,'A',0,'B'},{0,'A',2,'B'},{0,'A',2,'B'},{2,'A',0,'B'},{0,'A',1,'B'},{0,'A',3,'B'}};
int num3[6][4] = {{3,4,1,9},{8,3,4,5},{5,9,7,4},{6,7,2,3},{7,0,8,1},{9,8,3,7}};
int type3[6][4] = {{0,'A',2,'B'},{0,'A',2,'B'},{1,'A',1,'B'},{0,'A',1,'B'},{0,'A',1,'B'},{0,'A',2,'B'}};
DWORD start_time=GetTickCount();
getanswer(num1,type1);
getanswer(num2,type2);
getanswer(num3,type3);
cout<<"The run time is:"<<(GetTickCount()-start_time)<<"ms!"<<endl;
return 0;
}
void getanswer(int num[][4],int type[][4])
{
strList allnumList;
strList::iterator it;
int i,j,k,l;
for (i = 0; i <= 9; i ++){
for(j = 0; j <= 9; j ++){
for(k = 0; k <= 9; k ++){
for(l = 0; l <= 9; l ++){
if(i != j && i != k && i != l && j != k && j != l && k != l)
{
string str = "";
str+=(char)(i+0x30);
str+=(char)(j+0x30);
str+=(char)(k+0x30);
str+=(char)(l+0x30);
allnumList.push_back(str);
}
}
}
}
}
for (it = allnumList.begin(); it != allnumList.end(); ++it)
{
if(Check(string(*it),num[0],type[0]) && Check(string(*it),num[1],type[1])
&& Check(string(*it),num[2],type[2]) && Check(string(*it),num[3],type[3])
&& Check(string(*it),num[4],type[4]) && Check(string(*it),num[5],type[5]))
cout<<string(*it).c_str()<<" "<<endl;
}
}
int CheckNum(string str,int num[])
{
int ret = 0 ;
if(str.c_str()[0]-0x30 == num[0])
ret ++;
if(str.c_str()[1]-0x30 == num[1])
ret ++;
if(str.c_str()[2]-0x30 == num[2])
ret ++;
if(str.c_str()[3]-0x30 == num[3])
ret ++;
return ret;
}
int CheckLocation(string str,int num[])
{
int ret = 0 ;
int cmp1[2][4] = {0};
int cmp2[2][4] = {0};
for(int i = 0 ; i < 4 ; i ++)
{
cmp1[0][i] = str.c_str()[i]-0x30;
cmp2[0][i] = num[i];
cmp1[1][i] = cmp2[1][i] = i;
}
for(int i = 0 ; i < 4 ; i ++)
{
for(int x = 0 ; x < 4 ; x++)
{
if(cmp2[0][i] == cmp1[0][x] && cmp2[1][i] != cmp1[1][x] )
ret++;
}
}
return ret;
}
bool Check(string str,int num[],int type[])
{
if( CheckNum(str,num) == type[0] && CheckLocation(str,num) == type[2])
return true;
return false;
}
# @千年
import time
def init():
all_num = []
for num in range(123,10000):
num = str(num)
if len(num)<4:
num="0"+num
i = ""
for x in num:
if x in i:
break
else:
i=i+x
if i == num:
all_num.append(num)
return all_num
def compare(all_num,rule):
data = rule[0]
xaxb = rule[1]
s = []
for num in all_num:
i = 0
a = 0
b = 0
for x in num:
if x in data:
b=b+1
if x==data[i]:
a=a+1
i+=1
if str(a)+"A"+str(b-a)+"B"==xaxb:
s.append(num)
return s
def main(s,rules):
for rule in rules:
s = compare(s,rule)
return s
if __name__=="__main__":
start = time.time()
s = init()
#s = ['0123', '0124', '0125', '0126', '0127', '0128', '0129', '0132', '0134', '0135', '0136', '0137', '0138', '0139', '0142', '0143', '0145', '0146', '0147', '0148', '0149', '0152', '0153', '0154', '0156', '0157', '0158', '0159', '0162', '0163', '0164', '0165', '0167', '0168', '0169', '0172', '0173', '0174', '0175', '0176', '0178', '0179', '0182', '0183', '0184', '0185', '0186', '0187', '0189', '0192', '0193', '0194', '0195', '0196', '0197', '0198', '0213', '0214', '0215', '0216', '0217', '0218', '0219', '0231', '0234', '0235', '0236', '0237', '0238', '0239', '0241', '0243', '0245', '0246', '0247', '0248', '0249', '0251', '0253', '0254', '0256', '0257', '0258', '0259', '0261', '0263', '0264', '0265', '0267', '0268', '0269', '0271', '0273', '0274', '0275', '0276', '0278', '0279', '0281', '0283', '0284', '0285', '0286', '0287', '0289', '0291', '0293', '0294', '0295', '0296', '0297', '0298', '0312', '0314', '0315', '0316', '0317', '0318', '0319', '0321', '0324', '0325', '0326', '0327', '0328', '0329', '0341', '0342', '0345', '0346', '0347', '0348', '0349', '0351', '0352', '0354', '0356', '0357', '0358', '0359', '0361', '0362', '0364', '0365', '0367', '0368', '0369', '0371', '0372', '0374', '0375', '0376', '0378', '0379', '0381', '0382', '0384', '0385', '0386', '0387', '0389', '0391', '0392', '0394', '0395', '0396', '0397', '0398', '0412', '0413', '0415', '0416', '0417', '0418', '0419', '0421', '0423', '0425', '0426', '0427', '0428', '0429', '0431', '0432', '0435', '0436', '0437', '0438', '0439', '0451', '0452', '0453', '0456', '0457', '0458', '0459', '0461', '0462', '0463', '0465', '0467', '0468', '0469', '0471', '0472', '0473', '0475', '0476', '0478', '0479', '0481', '0482', '0483', '0485', '0486', '0487', '0489', '0491', '0492', '0493', '0495', '0496', '0497', '0498', '0512', '0513', '0514', '0516', '0517', '0518', '0519', '0521', '0523', '0524', '0526', '0527', '0528', '0529', '0531', '0532', '0534', '0536', '0537', '0538', '0539', '0541', '0542', '0543', '0546', '0547', '0548', '0549', '0561', '0562', '0563', '0564', '0567', '0568', '0569', '0571', '0572', '0573', '0574', '0576', '0578', '0579', '0581', '0582', '0583', '0584', '0586', '0587', '0589', '0591', '0592', '0593', '0594', '0596', '0597', '0598', '0612', '0613', '0614', '0615', '0617', '0618', '0619', '0621', '0623', '0624', '0625', '0627', '0628', '0629', '0631', '0632', '0634', '0635', '0637', '0638', '0639', '0641', '0642', '0643', '0645', '0647', '0648', '0649', '0651', '0652', '0653', '0654', '0657', '0658', '0659', '0671', '0672', '0673', '0674', '0675', '0678', '0679', '0681', '0682', '0683', '0684', '0685', '0687', '0689', '0691', '0692', '0693', '0694', '0695', '0697', '0698', '0712', '0713', '0714', '0715', '0716', '0718', '0719', '0721', '0723', '0724', '0725', '0726', '0728', '0729', '0731', '0732', '0734', '0735', '0736', '0738', '0739', '0741', '0742', '0743', '0745', '0746', '0748', '0749', '0751', '0752', '0753', '0754', '0756', '0758', '0759', '0761', '0762', '0763', '0764', '0765', '0768', '0769', '0781', '0782', '0783', '0784', '0785', '0786', '0789', '0791', '0792', '0793', '0794', '0795', '0796', '0798', '0812', '0813', '0814', '0815', '0816', '0817', '0819', '0821', '0823', '0824', '0825', '0826', '0827', '0829', '0831', '0832', '0834', '0835', '0836', '0837', '0839', '0841', '0842', '0843', '0845', '0846', '0847', '0849', '0851', '0852', '0853', '0854', '0856', '0857', '0859', '0861', '0862', '0863', '0864', '0865', '0867', '0869', '0871', '0872', '0873', '0874', '0875', '0876', '0879', '0891', '0892', '0893', '0894', '0895', '0896', '0897', '0912', '0913', '0914', '0915', '0916', '0917', '0918', '0921', '0923', '0924', '0925', '0926', '0927', '0928', '0931', '0932', '0934', '0935', '0936', '0937', '0938', '0941', '0942', '0943', '0945', '0946', '0947', '0948', '0951', '0952', '0953', '0954', '0956', '0957', '0958', '0961', '0962', '0963', '0964', '0965', '0967', '0968', '0971', '0972', '0973', '0974', '0975', '0976', '0978', '0981', '0982', '0983', '0984', '0985', '0986', '0987', '1023', '1024', '1025', '1026', '1027', '1028', '1029', '1032', '1034', '1035', '1036', '1037', '1038', '1039', '1042', '1043', '1045', '1046', '1047', '1048', '1049', '1052', '1053', '1054', '1056', '1057', '1058', '1059', '1062', '1063', '1064', '1065', '1067', '1068', '1069', '1072', '1073', '1074', '1075', '1076', '1078', '1079', '1082', '1083', '1084', '1085', '1086', '1087', '1089', '1092', '1093', '1094', '1095', '1096', '1097', '1098', '1203', '1204', '1205', '1206', '1207', '1208', '1209', '1230', '1234', '1235', '1236', '1237', '1238', '1239', '1240', '1243', '1245', '1246', '1247', '1248', '1249', '1250', '1253', '1254', '1256', '1257', '1258', '1259', '1260', '1263', '1264', '1265', '1267', '1268', '1269', '1270', '1273', '1274', '1275', '1276', '1278', '1279', '1280', '1283', '1284', '1285', '1286', '1287', '1289', '1290', '1293', '1294', '1295', '1296', '1297', '1298', '1302', '1304', '1305', '1306', '1307', '1308', '1309', '1320', '1324', '1325', '1326', '1327', '1328', '1329', '1340', '1342', '1345', '1346', '1347', '1348', '1349', '1350', '1352', '1354', '1356', '1357', '1358', '1359', '1360', '1362', '1364', '1365', '1367', '1368', '1369', '1370', '1372', '1374', '1375', '1376', '1378', '1379', '1380', '1382', '1384', '1385', '1386', '1387', '1389', '1390', '1392', '1394', '1395', '1396', '1397', '1398', '1402', '1403', '1405', '1406', '1407', '1408', '1409', '1420', '1423', '1425', '1426', '1427', '1428', '1429', '1430', '1432', '1435', '1436', '1437', '1438', '1439', '1450', '1452', '1453', '1456', '1457', '1458', '1459', '1460', '1462', '1463', '1465', '1467', '1468', '1469', '1470', '1472', '1473', '1475', '1476', '1478', '1479', '1480', '1482', '1483', '1485', '1486', '1487', '1489', '1490', '1492', '1493', '1495', '1496', '1497', '1498', '1502', '1503', '1504', '1506', '1507', '1508', '1509', '1520', '1523', '1524', '1526', '1527', '1528', '1529', '1530', '1532', '1534', '1536', '1537', '1538', '1539', '1540', '1542', '1543', '1546', '1547', '1548', '1549', '1560', '1562', '1563', '1564', '1567', '1568', '1569', '1570', '1572', '1573', '1574', '1576', '1578', '1579', '1580', '1582', '1583', '1584', '1586', '1587', '1589', '1590', '1592', '1593', '1594', '1596', '1597', '1598', '1602', '1603', '1604', '1605', '1607', '1608', '1609', '1620', '1623', '1624', '1625', '1627', '1628', '1629', '1630', '1632', '1634', '1635', '1637', '1638', '1639', '1640', '1642', '1643', '1645', '1647', '1648', '1649', '1650', '1652', '1653', '1654', '1657', '1658', '1659', '1670', '1672', '1673', '1674', '1675', '1678', '1679', '1680', '1682', '1683', '1684', '1685', '1687', '1689', '1690', '1692', '1693', '1694', '1695', '1697', '1698', '1702', '1703', '1704', '1705', '1706', '1708', '1709', '1720', '1723', '1724', '1725', '1726', '1728', '1729', '1730', '1732', '1734', '1735', '1736', '1738', '1739', '1740', '1742', '1743', '1745', '1746', '1748', '1749', '1750', '1752', '1753', '1754', '1756', '1758', '1759', '1760', '1762', '1763', '1764', '1765', '1768', '1769', '1780', '1782', '1783', '1784', '1785', '1786', '1789', '1790', '1792', '1793', '1794', '1795', '1796', '1798', '1802', '1803', '1804', '1805', '1806', '1807', '1809', '1820', '1823', '1824', '1825', '1826', '1827', '1829', '1830', '1832', '1834', '1835', '1836', '1837', '1839', '1840', '1842', '1843', '1845', '1846', '1847', '1849', '1850', '1852', '1853', '1854', '1856', '1857', '1859', '1860', '1862', '1863', '1864', '1865', '1867', '1869', '1870', '1872', '1873', '1874', '1875', '1876', '1879', '1890', '1892', '1893', '1894', '1895', '1896', '1897', '1902', '1903', '1904', '1905', '1906', '1907', '1908', '1920', '1923', '1924', '1925', '1926', '1927', '1928', '1930', '1932', '1934', '1935', '1936', '1937', '1938', '1940', '1942', '1943', '1945', '1946', '1947', '1948', '1950', '1952', '1953', '1954', '1956', '1957', '1958', '1960', '1962', '1963', '1964', '1965', '1967', '1968', '1970', '1972', '1973', '1974', '1975', '1976', '1978', '1980', '1982', '1983', '1984', '1985', '1986', '1987', '2013', '2014', '2015', '2016', '2017', '2018', '2019', '2031', '2034', '2035', '2036', '2037', '2038', '2039', '2041', '2043', '2045', '2046', '2047', '2048', '2049', '2051', '2053', '2054', '2056', '2057', '2058', '2059', '2061', '2063', '2064', '2065', '2067', '2068', '2069', '2071', '2073', '2074', '2075', '2076', '2078', '2079', '2081', '2083', '2084', '2085', '2086', '2087', '2089', '2091', '2093', '2094', '2095', '2096', '2097', '2098', '2103', '2104', '2105', '2106', '2107', '2108', '2109', '2130', '2134', '2135', '2136', '2137', '2138', '2139', '2140', '2143', '2145', '2146', '2147', '2148', '2149', '2150', '2153', '2154', '2156', '2157', '2158', '2159', '2160', '2163', '2164', '2165', '2167', '2168', '2169', '2170', '2173', '2174', '2175', '2176', '2178', '2179', '2180', '2183', '2184', '2185', '2186', '2187', '2189', '2190', '2193', '2194', '2195', '2196', '2197', '2198', '2301', '2304', '2305', '2306', '2307', '2308', '2309', '2310', '2314', '2315', '2316', '2317', '2318', '2319', '2340', '2341', '2345', '2346', '2347', '2348', '2349', '2350', '2351', '2354', '2356', '2357', '2358', '2359', '2360', '2361', '2364', '2365', '2367', '2368', '2369', '2370', '2371', '2374', '2375', '2376', '2378', '2379', '2380', '2381', '2384', '2385', '2386', '2387', '2389', '2390', '2391', '2394', '2395', '2396', '2397', '2398', '2401', '2403', '2405', '2406', '2407', '2408', '2409', '2410', '2413', '2415', '2416', '2417', '2418', '2419', '2430', '2431', '2435', '2436', '2437', '2438', '2439', '2450', '2451', '2453', '2456', '2457', '2458', '2459', '2460', '2461', '2463', '2465', '2467', '2468', '2469', '2470', '2471', '2473', '2475', '2476', '2478', '2479', '2480', '2481', '2483', '2485', '2486', '2487', '2489', '2490', '2491', '2493', '2495', '2496', '2497', '2498', '2501', '2503', '2504', '2506', '2507', '2508', '2509', '2510', '2513', '2514', '2516', '2517', '2518', '2519', '2530', '2531', '2534', '2536', '2537', '2538', '2539', '2540', '2541', '2543', '2546', '2547', '2548', '2549', '2560', '2561', '2563', '2564', '2567', '2568', '2569', '2570', '2571', '2573', '2574', '2576', '2578', '2579', '2580', '2581', '2583', '2584', '2586', '2587', '2589', '2590', '2591', '2593', '2594', '2596', '2597', '2598', '2601', '2603', '2604', '2605', '2607', '2608', '2609', '2610', '2613', '2614', '2615', '2617', '2618', '2619', '2630', '2631', '2634', '2635', '2637', '2638', '2639', '2640', '2641', '2643', '2645', '2647', '2648', '2649', '2650', '2651', '2653', '2654', '2657', '2658', '2659', '2670', '2671', '2673', '2674', '2675', '2678', '2679', '2680', '2681', '2683', '2684', '2685', '2687', '2689', '2690', '2691', '2693', '2694', '2695', '2697', '2698', '2701', '2703', '2704', '2705', '2706', '2708', '2709', '2710', '2713', '2714', '2715', '2716', '2718', '2719', '2730', '2731', '2734', '2735', '2736', '2738', '2739', '2740', '2741', '2743', '2745', '2746', '2748', '2749', '2750', '2751', '2753', '2754', '2756', '2758', '2759', '2760', '2761', '2763', '2764', '2765', '2768', '2769', '2780', '2781', '2783', '2784', '2785', '2786', '2789', '2790', '2791', '2793', '2794', '2795', '2796', '2798', '2801', '2803', '2804', '2805', '2806', '2807', '2809', '2810', '2813', '2814', '2815', '2816', '2817', '2819', '2830', '2831', '2834', '2835', '2836', '2837', '2839', '2840', '2841', '2843', '2845', '2846', '2847', '2849', '2850', '2851', '2853', '2854', '2856', '2857', '2859', '2860', '2861', '2863', '2864', '2865', '2867', '2869', '2870', '2871', '2873', '2874', '2875', '2876', '2879', '2890', '2891', '2893', '2894', '2895', '2896', '2897', '2901', '2903', '2904', '2905', '2906', '2907', '2908', '2910', '2913', '2914', '2915', '2916', '2917', '2918', '2930', '2931', '2934', '2935', '2936', '2937', '2938', '2940', '2941', '2943', '2945', '2946', '2947', '2948', '2950', '2951', '2953', '2954', '2956', '2957', '2958', '2960', '2961', '2963', '2964', '2965', '2967', '2968', '2970', '2971', '2973', '2974', '2975', '2976', '2978', '2980', '2981', '2983', '2984', '2985', '2986', '2987', '3012', '3014', '3015', '3016', '3017', '3018', '3019', '3021', '3024', '3025', '3026', '3027', '3028', '3029', '3041', '3042', '3045', '3046', '3047', '3048', '3049', '3051', '3052', '3054', '3056', '3057', '3058', '3059', '3061', '3062', '3064', '3065', '3067', '3068', '3069', '3071', '3072', '3074', '3075', '3076', '3078', '3079', '3081', '3082', '3084', '3085', '3086', '3087', '3089', '3091', '3092', '3094', '3095', '3096', '3097', '3098', '3102', '3104', '3105', '3106', '3107', '3108', '3109', '3120', '3124', '3125', '3126', '3127', '3128', '3129', '3140', '3142', '3145', '3146', '3147', '3148', '3149', '3150', '3152', '3154', '3156', '3157', '3158', '3159', '3160', '3162', '3164', '3165', '3167', '3168', '3169', '3170', '3172', '3174', '3175', '3176', '3178', '3179', '3180', '3182', '3184', '3185', '3186', '3187', '3189', '3190', '3192', '3194', '3195', '3196', '3197', '3198', '3201', '3204', '3205', '3206', '3207', '3208', '3209', '3210', '3214', '3215', '3216', '3217', '3218', '3219', '3240', '3241', '3245', '3246', '3247', '3248', '3249', '3250', '3251', '3254', '3256', '3257', '3258', '3259', '3260', '3261', '3264', '3265', '3267', '3268', '3269', '3270', '3271', '3274', '3275', '3276', '3278', '3279', '3280', '3281', '3284', '3285', '3286', '3287', '3289', '3290', '3291', '3294', '3295', '3296', '3297', '3298', '3401', '3402', '3405', '3406', '3407', '3408', '3409', '3410', '3412', '3415', '3416', '3417', '3418', '3419', '3420', '3421', '3425', '3426', '3427', '3428', '3429', '3450', '3451', '3452', '3456', '3457', '3458', '3459', '3460', '3461', '3462', '3465', '3467', '3468', '3469', '3470', '3471', '3472', '3475', '3476', '3478', '3479', '3480', '3481', '3482', '3485', '3486', '3487', '3489', '3490', '3491', '3492', '3495', '3496', '3497', '3498', '3501', '3502', '3504', '3506', '3507', '3508', '3509', '3510', '3512', '3514', '3516', '3517', '3518', '3519', '3520', '3521', '3524', '3526', '3527', '3528', '3529', '3540', '3541', '3542', '3546', '3547', '3548', '3549', '3560', '3561', '3562', '3564', '3567', '3568', '3569', '3570', '3571', '3572', '3574', '3576', '3578', '3579', '3580', '3581', '3582', '3584', '3586', '3587', '3589', '3590', '3591', '3592', '3594', '3596', '3597', '3598', '3601', '3602', '3604', '3605', '3607', '3608', '3609', '3610', '3612', '3614', '3615', '3617', '3618', '3619', '3620', '3621', '3624', '3625', '3627', '3628', '3629', '3640', '3641', '3642', '3645', '3647', '3648', '3649', '3650', '3651', '3652', '3654', '3657', '3658', '3659', '3670', '3671', '3672', '3674', '3675', '3678', '3679', '3680', '3681', '3682', '3684', '3685', '3687', '3689', '3690', '3691', '3692', '3694', '3695', '3697', '3698', '3701', '3702', '3704', '3705', '3706', '3708', '3709', '3710', '3712', '3714', '3715', '3716', '3718', '3719', '3720', '3721', '3724', '3725', '3726', '3728', '3729', '3740', '3741', '3742', '3745', '3746', '3748', '3749', '3750', '3751', '3752', '3754', '3756', '3758', '3759', '3760', '3761', '3762', '3764', '3765', '3768', '3769', '3780', '3781', '3782', '3784', '3785', '3786', '3789', '3790', '3791', '3792', '3794', '3795', '3796', '3798', '3801', '3802', '3804', '3805', '3806', '3807', '3809', '3810', '3812', '3814', '3815', '3816', '3817', '3819', '3820', '3821', '3824', '3825', '3826', '3827', '3829', '3840', '3841', '3842', '3845', '3846', '3847', '3849', '3850', '3851', '3852', '3854', '3856', '3857', '3859', '3860', '3861', '3862', '3864', '3865', '3867', '3869', '3870', '3871', '3872', '3874', '3875', '3876', '3879', '3890', '3891', '3892', '3894', '3895', '3896', '3897', '3901', '3902', '3904', '3905', '3906', '3907', '3908', '3910', '3912', '3914', '3915', '3916', '3917', '3918', '3920', '3921', '3924', '3925', '3926', '3927', '3928', '3940', '3941', '3942', '3945', '3946', '3947', '3948', '3950', '3951', '3952', '3954', '3956', '3957', '3958', '3960', '3961', '3962', '3964', '3965', '3967', '3968', '3970', '3971', '3972', '3974', '3975', '3976', '3978', '3980', '3981', '3982', '3984', '3985', '3986', '3987', '4012', '4013', '4015', '4016', '4017', '4018', '4019', '4021', '4023', '4025', '4026', '4027', '4028', '4029', '4031', '4032', '4035', '4036', '4037', '4038', '4039', '4051', '4052', '4053', '4056', '4057', '4058', '4059', '4061', '4062', '4063', '4065', '4067', '4068', '4069', '4071', '4072', '4073', '4075', '4076', '4078', '4079', '4081', '4082', '4083', '4085', '4086', '4087', '4089', '4091', '4092', '4093', '4095', '4096', '4097', '4098', '4102', '4103', '4105', '4106', '4107', '4108', '4109', '4120', '4123', '4125', '4126', '4127', '4128', '4129', '4130', '4132', '4135', '4136', '4137', '4138', '4139', '4150', '4152', '4153', '4156', '4157', '4158', '4159', '4160', '4162', '4163', '4165', '4167', '4168', '4169', '4170', '4172', '4173', '4175', '4176', '4178', '4179', '4180', '4182', '4183', '4185', '4186', '4187', '4189', '4190', '4192', '4193', '4195', '4196', '4197', '4198', '4201', '4203', '4205', '4206', '4207', '4208', '4209', '4210', '4213', '4215', '4216', '4217', '4218', '4219', '4230', '4231', '4235', '4236', '4237', '4238', '4239', '4250', '4251', '4253', '4256', '4257', '4258', '4259', '4260', '4261', '4263', '4265', '4267', '4268', '4269', '4270', '4271', '4273', '4275', '4276', '4278', '4279', '4280', '4281', '4283', '4285', '4286', '4287', '4289', '4290', '4291', '4293', '4295', '4296', '4297', '4298', '4301', '4302', '4305', '4306', '4307', '4308', '4309', '4310', '4312', '4315', '4316', '4317', '4318', '4319', '4320', '4321', '4325', '4326', '4327', '4328', '4329', '4350', '4351', '4352', '4356', '4357', '4358', '4359', '4360', '4361', '4362', '4365', '4367', '4368', '4369', '4370', '4371', '4372', '4375', '4376', '4378', '4379', '4380', '4381', '4382', '4385', '4386', '4387', '4389', '4390', '4391', '4392', '4395', '4396', '4397', '4398', '4501', '4502', '4503', '4506', '4507', '4508', '4509', '4510', '4512', '4513', '4516', '4517', '4518', '4519', '4520', '4521', '4523', '4526', '4527', '4528', '4529', '4530', '4531', '4532', '4536', '4537', '4538', '4539', '4560', '4561', '4562', '4563', '4567', '4568', '4569', '4570', '4571', '4572', '4573', '4576', '4578', '4579', '4580', '4581', '4582', '4583', '4586', '4587', '4589', '4590', '4591', '4592', '4593', '4596', '4597', '4598', '4601', '4602', '4603', '4605', '4607', '4608', '4609', '4610', '4612', '4613', '4615', '4617', '4618', '4619', '4620', '4621', '4623', '4625', '4627', '4628', '4629', '4630', '4631', '4632', '4635', '4637', '4638', '4639', '4650', '4651', '4652', '4653', '4657', '4658', '4659', '4670', '4671', '4672', '4673', '4675', '4678', '4679', '4680', '4681', '4682', '4683', '4685', '4687', '4689', '4690', '4691', '4692', '4693', '4695', '4697', '4698', '4701', '4702', '4703', '4705', '4706', '4708', '4709', '4710', '4712', '4713', '4715', '4716', '4718', '4719', '4720', '4721', '4723', '4725', '4726', '4728', '4729', '4730', '4731', '4732', '4735', '4736', '4738', '4739', '4750', '4751', '4752', '4753', '4756', '4758', '4759', '4760', '4761', '4762', '4763', '4765', '4768', '4769', '4780', '4781', '4782', '4783', '4785', '4786', '4789', '4790', '4791', '4792', '4793', '4795', '4796', '4798', '4801', '4802', '4803', '4805', '4806', '4807', '4809', '4810', '4812', '4813', '4815', '4816', '4817', '4819', '4820', '4821', '4823', '4825', '4826', '4827', '4829', '4830', '4831', '4832', '4835', '4836', '4837', '4839', '4850', '4851', '4852', '4853', '4856', '4857', '4859', '4860', '4861', '4862', '4863', '4865', '4867', '4869', '4870', '4871', '4872', '4873', '4875', '4876', '4879', '4890', '4891', '4892', '4893', '4895', '4896', '4897', '4901', '4902', '4903', '4905', '4906', '4907', '4908', '4910', '4912', '4913', '4915', '4916', '4917', '4918', '4920', '4921', '4923', '4925', '4926', '4927', '4928', '4930', '4931', '4932', '4935', '4936', '4937', '4938', '4950', '4951', '4952', '4953', '4956', '4957', '4958', '4960', '4961', '4962', '4963', '4965', '4967', '4968', '4970', '4971', '4972', '4973', '4975', '4976', '4978', '4980', '4981', '4982', '4983', '4985', '4986', '4987', '5012', '5013', '5014', '5016', '5017', '5018', '5019', '5021', '5023', '5024', '5026', '5027', '5028', '5029', '5031', '5032', '5034', '5036', '5037', '5038', '5039', '5041', '5042', '5043', '5046', '5047', '5048', '5049', '5061', '5062', '5063', '5064', '5067', '5068', '5069', '5071', '5072', '5073', '5074', '5076', '5078', '5079', '5081', '5082', '5083', '5084', '5086', '5087', '5089', '5091', '5092', '5093', '5094', '5096', '5097', '5098', '5102', '5103', '5104', '5106', '5107', '5108', '5109', '5120', '5123', '5124', '5126', '5127', '5128', '5129', '5130', '5132', '5134', '5136', '5137', '5138', '5139', '5140', '5142', '5143', '5146', '5147', '5148', '5149', '5160', '5162', '5163', '5164', '5167', '5168', '5169', '5170', '5172', '5173', '5174', '5176', '5178', '5179', '5180', '5182', '5183', '5184', '5186', '5187', '5189', '5190', '5192', '5193', '5194', '5196', '5197', '5198', '5201', '5203', '5204', '5206', '5207', '5208', '5209', '5210', '5213', '5214', '5216', '5217', '5218', '5219', '5230', '5231', '5234', '5236', '5237', '5238', '5239', '5240', '5241', '5243', '5246', '5247', '5248', '5249', '5260', '5261', '5263', '5264', '5267', '5268', '5269', '5270', '5271', '5273', '5274', '5276', '5278', '5279', '5280', '5281', '5283', '5284', '5286', '5287', '5289', '5290', '5291', '5293', '5294', '5296', '5297', '5298', '5301', '5302', '5304', '5306', '5307', '5308', '5309', '5310', '5312', '5314', '5316', '5317', '5318', '5319', '5320', '5321', '5324', '5326', '5327', '5328', '5329', '5340', '5341', '5342', '5346', '5347', '5348', '5349', '5360', '5361', '5362', '5364', '5367', '5368', '5369', '5370', '5371', '5372', '5374', '5376', '5378', '5379', '5380', '5381', '5382', '5384', '5386', '5387', '5389', '5390', '5391', '5392', '5394', '5396', '5397', '5398', '5401', '5402', '5403', '5406', '5407', '5408', '5409', '5410', '5412', '5413', '5416', '5417', '5418', '5419', '5420', '5421', '5423', '5426', '5427', '5428', '5429', '5430', '5431', '5432', '5436', '5437', '5438', '5439', '5460', '5461', '5462', '5463', '5467', '5468', '5469', '5470', '5471', '5472', '5473', '5476', '5478', '5479', '5480', '5481', '5482', '5483', '5486', '5487', '5489', '5490', '5491', '5492', '5493', '5496', '5497', '5498', '5601', '5602', '5603', '5604', '5607', '5608', '5609', '5610', '5612', '5613', '5614', '5617', '5618', '5619', '5620', '5621', '5623', '5624', '5627', '5628', '5629', '5630', '5631', '5632', '5634', '5637', '5638', '5639', '5640', '5641', '5642', '5643', '5647', '5648', '5649', '5670', '5671', '5672', '5673', '5674', '5678', '5679', '5680', '5681', '5682', '5683', '5684', '5687', '5689', '5690', '5691', '5692', '5693', '5694', '5697', '5698', '5701', '5702', '5703', '5704', '5706', '5708', '5709', '5710', '5712', '5713', '5714', '5716', '5718', '5719', '5720', '5721', '5723', '5724', '5726', '5728', '5729', '5730', '5731', '5732', '5734', '5736', '5738', '5739', '5740', '5741', '5742', '5743', '5746', '5748', '5749', '5760', '5761', '5762', '5763', '5764', '5768', '5769', '5780', '5781', '5782', '5783', '5784', '5786', '5789', '5790', '5791', '5792', '5793', '5794', '5796', '5798', '5801', '5802', '5803', '5804', '5806', '5807', '5809', '5810', '5812', '5813', '5814', '5816', '5817', '5819', '5820', '5821', '5823', '5824', '5826', '5827', '5829', '5830', '5831', '5832', '5834', '5836', '5837', '5839', '5840', '5841', '5842', '5843', '5846', '5847', '5849', '5860', '5861', '5862', '5863', '5864', '5867', '5869', '5870', '5871', '5872', '5873', '5874', '5876', '5879', '5890', '5891', '5892', '5893', '5894', '5896', '5897', '5901', '5902', '5903', '5904', '5906', '5907', '5908', '5910', '5912', '5913', '5914', '5916', '5917', '5918', '5920', '5921', '5923', '5924', '5926', '5927', '5928', '5930', '5931', '5932', '5934', '5936', '5937', '5938', '5940', '5941', '5942', '5943', '5946', '5947', '5948', '5960', '5961', '5962', '5963', '5964', '5967', '5968', '5970', '5971', '5972', '5973', '5974', '5976', '5978', '5980', '5981', '5982', '5983', '5984', '5986', '5987', '6012', '6013', '6014', '6015', '6017', '6018', '6019', '6021', '6023', '6024', '6025', '6027', '6028', '6029', '6031', '6032', '6034', '6035', '6037', '6038', '6039', '6041', '6042', '6043', '6045', '6047', '6048', '6049', '6051', '6052', '6053', '6054', '6057', '6058', '6059', '6071', '6072', '6073', '6074', '6075', '6078', '6079', '6081', '6082', '6083', '6084', '6085', '6087', '6089', '6091', '6092', '6093', '6094', '6095', '6097', '6098', '6102', '6103', '6104', '6105', '6107', '6108', '6109', '6120', '6123', '6124', '6125', '6127', '6128', '6129', '6130', '6132', '6134', '6135', '6137', '6138', '6139', '6140', '6142', '6143', '6145', '6147', '6148', '6149', '6150', '6152', '6153', '6154', '6157', '6158', '6159', '6170', '6172', '6173', '6174', '6175', '6178', '6179', '6180', '6182', '6183', '6184', '6185', '6187', '6189', '6190', '6192', '6193', '6194', '6195', '6197', '6198', '6201', '6203', '6204', '6205', '6207', '6208', '6209', '6210', '6213', '6214', '6215', '6217', '6218', '6219', '6230', '6231', '6234', '6235', '6237', '6238', '6239', '6240', '6241', '6243', '6245', '6247', '6248', '6249', '6250', '6251', '6253', '6254', '6257', '6258', '6259', '6270', '6271', '6273', '6274', '6275', '6278', '6279', '6280', '6281', '6283', '6284', '6285', '6287', '6289', '6290', '6291', '6293', '6294', '6295', '6297', '6298', '6301', '6302', '6304', '6305', '6307', '6308', '6309', '6310', '6312', '6314', '6315', '6317', '6318', '6319', '6320', '6321', '6324', '6325', '6327', '6328', '6329', '6340', '6341', '6342', '6345', '6347', '6348', '6349', '6350', '6351', '6352', '6354', '6357', '6358', '6359', '6370', '6371', '6372', '6374', '6375', '6378', '6379', '6380', '6381', '6382', '6384', '6385', '6387', '6389', '6390', '6391', '6392', '6394', '6395', '6397', '6398', '6401', '6402', '6403', '6405', '6407', '6408', '6409', '6410', '6412', '6413', '6415', '6417', '6418', '6419', '6420', '6421', '6423', '6425', '6427', '6428', '6429', '6430', '6431', '6432', '6435', '6437', '6438', '6439', '6450', '6451', '6452', '6453', '6457', '6458', '6459', '6470', '6471', '6472', '6473', '6475', '6478', '6479', '6480', '6481', '6482', '6483', '6485', '6487', '6489', '6490', '6491', '6492', '6493', '6495', '6497', '6498', '6501', '6502', '6503', '6504', '6507', '6508', '6509', '6510', '6512', '6513', '6514', '6517', '6518', '6519', '6520', '6521', '6523', '6524', '6527', '6528', '6529', '6530', '6531', '6532', '6534', '6537', '6538', '6539', '6540', '6541', '6542', '6543', '6547', '6548', '6549', '6570', '6571', '6572', '6573', '6574', '6578', '6579', '6580', '6581', '6582', '6583', '6584', '6587', '6589', '6590', '6591', '6592', '6593', '6594', '6597', '6598', '6701', '6702', '6703', '6704', '6705', '6708', '6709', '6710', '6712', '6713', '6714', '6715', '6718', '6719', '6720', '6721', '6723', '6724', '6725', '6728', '6729', '6730', '6731', '6732', '6734', '6735', '6738', '6739', '6740', '6741', '6742', '6743', '6745', '6748', '6749', '6750', '6751', '6752', '6753', '6754', '6758', '6759', '6780', '6781', '6782', '6783', '6784', '6785', '6789', '6790', '6791', '6792', '6793', '6794', '6795', '6798', '6801', '6802', '6803', '6804', '6805', '6807', '6809', '6810', '6812', '6813', '6814', '6815', '6817', '6819', '6820', '6821', '6823', '6824', '6825', '6827', '6829', '6830', '6831', '6832', '6834', '6835', '6837', '6839', '6840', '6841', '6842', '6843', '6845', '6847', '6849', '6850', '6851', '6852', '6853', '6854', '6857', '6859', '6870', '6871', '6872', '6873', '6874', '6875', '6879', '6890', '6891', '6892', '6893', '6894', '6895', '6897', '6901', '6902', '6903', '6904', '6905', '6907', '6908', '6910', '6912', '6913', '6914', '6915', '6917', '6918', '6920', '6921', '6923', '6924', '6925', '6927', '6928', '6930', '6931', '6932', '6934', '6935', '6937', '6938', '6940', '6941', '6942', '6943', '6945', '6947', '6948', '6950', '6951', '6952', '6953', '6954', '6957', '6958', '6970', '6971', '6972', '6973', '6974', '6975', '6978', '6980', '6981', '6982', '6983', '6984', '6985', '6987', '7012', '7013', '7014', '7015', '7016', '7018', '7019', '7021', '7023', '7024', '7025', '7026', '7028', '7029', '7031', '7032', '7034', '7035', '7036', '7038', '7039', '7041', '7042', '7043', '7045', '7046', '7048', '7049', '7051', '7052', '7053', '7054', '7056', '7058', '7059', '7061', '7062', '7063', '7064', '7065', '7068', '7069', '7081', '7082', '7083', '7084', '7085', '7086', '7089', '7091', '7092', '7093', '7094', '7095', '7096', '7098', '7102', '7103', '7104', '7105', '7106', '7108', '7109', '7120', '7123', '7124', '7125', '7126', '7128', '7129', '7130', '7132', '7134', '7135', '7136', '7138', '7139', '7140', '7142', '7143', '7145', '7146', '7148', '7149', '7150', '7152', '7153', '7154', '7156', '7158', '7159', '7160', '7162', '7163', '7164', '7165', '7168', '7169', '7180', '7182', '7183', '7184', '7185', '7186', '7189', '7190', '7192', '7193', '7194', '7195', '7196', '7198', '7201', '7203', '7204', '7205', '7206', '7208', '7209', '7210', '7213', '7214', '7215', '7216', '7218', '7219', '7230', '7231', '7234', '7235', '7236', '7238', '7239', '7240', '7241', '7243', '7245', '7246', '7248', '7249', '7250', '7251', '7253', '7254', '7256', '7258', '7259', '7260', '7261', '7263', '7264', '7265', '7268', '7269', '7280', '7281', '7283', '7284', '7285', '7286', '7289', '7290', '7291', '7293', '7294', '7295', '7296', '7298', '7301', '7302', '7304', '7305', '7306', '7308', '7309', '7310', '7312', '7314', '7315', '7316', '7318', '7319', '7320', '7321', '7324', '7325', '7326', '7328', '7329', '7340', '7341', '7342', '7345', '7346', '7348', '7349', '7350', '7351', '7352', '7354', '7356', '7358', '7359', '7360', '7361', '7362', '7364', '7365', '7368', '7369', '7380', '7381', '7382', '7384', '7385', '7386', '7389', '7390', '7391', '7392', '7394', '7395', '7396', '7398', '7401', '7402', '7403', '7405', '7406', '7408', '7409', '7410', '7412', '7413', '7415', '7416', '7418', '7419', '7420', '7421', '7423', '7425', '7426', '7428', '7429', '7430', '7431', '7432', '7435', '7436', '7438', '7439', '7450', '7451', '7452', '7453', '7456', '7458', '7459', '7460', '7461', '7462', '7463', '7465', '7468', '7469', '7480', '7481', '7482', '7483', '7485', '7486', '7489', '7490', '7491', '7492', '7493', '7495', '7496', '7498', '7501', '7502', '7503', '7504', '7506', '7508', '7509', '7510', '7512', '7513', '7514', '7516', '7518', '7519', '7520', '7521', '7523', '7524', '7526', '7528', '7529', '7530', '7531', '7532', '7534', '7536', '7538', '7539', '7540', '7541', '7542', '7543', '7546', '7548', '7549', '7560', '7561', '7562', '7563', '7564', '7568', '7569', '7580', '7581', '7582', '7583', '7584', '7586', '7589', '7590', '7591', '7592', '7593', '7594', '7596', '7598', '7601', '7602', '7603', '7604', '7605', '7608', '7609', '7610', '7612', '7613', '7614', '7615', '7618', '7619', '7620', '7621', '7623', '7624', '7625', '7628', '7629', '7630', '7631', '7632', '7634', '7635', '7638', '7639', '7640', '7641', '7642', '7643', '7645', '7648', '7649', '7650', '7651', '7652', '7653', '7654', '7658', '7659', '7680', '7681', '7682', '7683', '7684', '7685', '7689', '7690', '7691', '7692', '7693', '7694', '7695', '7698', '7801', '7802', '7803', '7804', '7805', '7806', '7809', '7810', '7812', '7813', '7814', '7815', '7816', '7819', '7820', '7821', '7823', '7824', '7825', '7826', '7829', '7830', '7831', '7832', '7834', '7835', '7836', '7839', '7840', '7841', '7842', '7843', '7845', '7846', '7849', '7850', '7851', '7852', '7853', '7854', '7856', '7859', '7860', '7861', '7862', '7863', '7864', '7865', '7869', '7890', '7891', '7892', '7893', '7894', '7895', '7896', '7901', '7902', '7903', '7904', '7905', '7906', '7908', '7910', '7912', '7913', '7914', '7915', '7916', '7918', '7920', '7921', '7923', '7924', '7925', '7926', '7928', '7930', '7931', '7932', '7934', '7935', '7936', '7938', '7940', '7941', '7942', '7943', '7945', '7946', '7948', '7950', '7951', '7952', '7953', '7954', '7956', '7958', '7960', '7961', '7962', '7963', '7964', '7965', '7968', '7980', '7981', '7982', '7983', '7984', '7985', '7986', '8012', '8013', '8014', '8015', '8016', '8017', '8019', '8021', '8023', '8024', '8025', '8026', '8027', '8029', '8031', '8032', '8034', '8035', '8036', '8037', '8039', '8041', '8042', '8043', '8045', '8046', '8047', '8049', '8051', '8052', '8053', '8054', '8056', '8057', '8059', '8061', '8062', '8063', '8064', '8065', '8067', '8069', '8071', '8072', '8073', '8074', '8075', '8076', '8079', '8091', '8092', '8093', '8094', '8095', '8096', '8097', '8102', '8103', '8104', '8105', '8106', '8107', '8109', '8120', '8123', '8124', '8125', '8126', '8127', '8129', '8130', '8132', '8134', '8135', '8136', '8137', '8139', '8140', '8142', '8143', '8145', '8146', '8147', '8149', '8150', '8152', '8153', '8154', '8156', '8157', '8159', '8160', '8162', '8163', '8164', '8165', '8167', '8169', '8170', '8172', '8173', '8174', '8175', '8176', '8179', '8190', '8192', '8193', '8194', '8195', '8196', '8197', '8201', '8203', '8204', '8205', '8206', '8207', '8209', '8210', '8213', '8214', '8215', '8216', '8217', '8219', '8230', '8231', '8234', '8235', '8236', '8237', '8239', '8240', '8241', '8243', '8245', '8246', '8247', '8249', '8250', '8251', '8253', '8254', '8256', '8257', '8259', '8260', '8261', '8263', '8264', '8265', '8267', '8269', '8270', '8271', '8273', '8274', '8275', '8276', '8279', '8290', '8291', '8293', '8294', '8295', '8296', '8297', '8301', '8302', '8304', '8305', '8306', '8307', '8309', '8310', '8312', '8314', '8315', '8316', '8317', '8319', '8320', '8321', '8324', '8325', '8326', '8327', '8329', '8340', '8341', '8342', '8345', '8346', '8347', '8349', '8350', '8351', '8352', '8354', '8356', '8357', '8359', '8360', '8361', '8362', '8364', '8365', '8367', '8369', '8370', '8371', '8372', '8374', '8375', '8376', '8379', '8390', '8391', '8392', '8394', '8395', '8396', '8397', '8401', '8402', '8403', '8405', '8406', '8407', '8409', '8410', '8412', '8413', '8415', '8416', '8417', '8419', '8420', '8421', '8423', '8425', '8426', '8427', '8429', '8430', '8431', '8432', '8435', '8436', '8437', '8439', '8450', '8451', '8452', '8453', '8456', '8457', '8459', '8460', '8461', '8462', '8463', '8465', '8467', '8469', '8470', '8471', '8472', '8473', '8475', '8476', '8479', '8490', '8491', '8492', '8493', '8495', '8496', '8497', '8501', '8502', '8503', '8504', '8506', '8507', '8509', '8510', '8512', '8513', '8514', '8516', '8517', '8519', '8520', '8521', '8523', '8524', '8526', '8527', '8529', '8530', '8531', '8532', '8534', '8536', '8537', '8539', '8540', '8541', '8542', '8543', '8546', '8547', '8549', '8560', '8561', '8562', '8563', '8564', '8567', '8569', '8570', '8571', '8572', '8573', '8574', '8576', '8579', '8590', '8591', '8592', '8593', '8594', '8596', '8597', '8601', '8602', '8603', '8604', '8605', '8607', '8609', '8610', '8612', '8613', '8614', '8615', '8617', '8619', '8620', '8621', '8623', '8624', '8625', '8627', '8629', '8630', '8631', '8632', '8634', '8635', '8637', '8639', '8640', '8641', '8642', '8643', '8645', '8647', '8649', '8650', '8651', '8652', '8653', '8654', '8657', '8659', '8670', '8671', '8672', '8673', '8674', '8675', '8679', '8690', '8691', '8692', '8693', '8694', '8695', '8697', '8701', '8702', '8703', '8704', '8705', '8706', '8709', '8710', '8712', '8713', '8714', '8715', '8716', '8719', '8720', '8721', '8723', '8724', '8725', '8726', '8729', '8730', '8731', '8732', '8734', '8735', '8736', '8739', '8740', '8741', '8742', '8743', '8745', '8746', '8749', '8750', '8751', '8752', '8753', '8754', '8756', '8759', '8760', '8761', '8762', '8763', '8764', '8765', '8769', '8790', '8791', '8792', '8793', '8794', '8795', '8796', '8901', '8902', '8903', '8904', '8905', '8906', '8907', '8910', '8912', '8913', '8914', '8915', '8916', '8917', '8920', '8921', '8923', '8924', '8925', '8926', '8927', '8930', '8931', '8932', '8934', '8935', '8936', '8937', '8940', '8941', '8942', '8943', '8945', '8946', '8947', '8950', '8951', '8952', '8953', '8954', '8956', '8957', '8960', '8961', '8962', '8963', '8964', '8965', '8967', '8970', '8971', '8972', '8973', '8974', '8975', '8976', '9012', '9013', '9014', '9015', '9016', '9017', '9018', '9021', '9023', '9024', '9025', '9026', '9027', '9028', '9031', '9032', '9034', '9035', '9036', '9037', '9038', '9041', '9042', '9043', '9045', '9046', '9047', '9048', '9051', '9052', '9053', '9054', '9056', '9057', '9058', '9061', '9062', '9063', '9064', '9065', '9067', '9068', '9071', '9072', '9073', '9074', '9075', '9076', '9078', '9081', '9082', '9083', '9084', '9085', '9086', '9087', '9102', '9103', '9104', '9105', '9106', '9107', '9108', '9120', '9123', '9124', '9125', '9126', '9127', '9128', '9130', '9132', '9134', '9135', '9136', '9137', '9138', '9140', '9142', '9143', '9145', '9146', '9147', '9148', '9150', '9152', '9153', '9154', '9156', '9157', '9158', '9160', '9162', '9163', '9164', '9165', '9167', '9168', '9170', '9172', '9173', '9174', '9175', '9176', '9178', '9180', '9182', '9183', '9184', '9185', '9186', '9187', '9201', '9203', '9204', '9205', '9206', '9207', '9208', '9210', '9213', '9214', '9215', '9216', '9217', '9218', '9230', '9231', '9234', '9235', '9236', '9237', '9238', '9240', '9241', '9243', '9245', '9246', '9247', '9248', '9250', '9251', '9253', '9254', '9256', '9257', '9258', '9260', '9261', '9263', '9264', '9265', '9267', '9268', '9270', '9271', '9273', '9274', '9275', '9276', '9278', '9280', '9281', '9283', '9284', '9285', '9286', '9287', '9301', '9302', '9304', '9305', '9306', '9307', '9308', '9310', '9312', '9314', '9315', '9316', '9317', '9318', '9320', '9321', '9324', '9325', '9326', '9327', '9328', '9340', '9341', '9342', '9345', '9346', '9347', '9348', '9350', '9351', '9352', '9354', '9356', '9357', '9358', '9360', '9361', '9362', '9364', '9365', '9367', '9368', '9370', '9371', '9372', '9374', '9375', '9376', '9378', '9380', '9381', '9382', '9384', '9385', '9386', '9387', '9401', '9402', '9403', '9405', '9406', '9407', '9408', '9410', '9412', '9413', '9415', '9416', '9417', '9418', '9420', '9421', '9423', '9425', '9426', '9427', '9428', '9430', '9431', '9432', '9435', '9436', '9437', '9438', '9450', '9451', '9452', '9453', '9456', '9457', '9458', '9460', '9461', '9462', '9463', '9465', '9467', '9468', '9470', '9471', '9472', '9473', '9475', '9476', '9478', '9480', '9481', '9482', '9483', '9485', '9486', '9487', '9501', '9502', '9503', '9504', '9506', '9507', '9508', '9510', '9512', '9513', '9514', '9516', '9517', '9518', '9520', '9521', '9523', '9524', '9526', '9527', '9528', '9530', '9531', '9532', '9534', '9536', '9537', '9538', '9540', '9541', '9542', '9543', '9546', '9547', '9548', '9560', '9561', '9562', '9563', '9564', '9567', '9568', '9570', '9571', '9572', '9573', '9574', '9576', '9578', '9580', '9581', '9582', '9583', '9584', '9586', '9587', '9601', '9602', '9603', '9604', '9605', '9607', '9608', '9610', '9612', '9613', '9614', '9615', '9617', '9618', '9620', '9621', '9623', '9624', '9625', '9627', '9628', '9630', '9631', '9632', '9634', '9635', '9637', '9638', '9640', '9641', '9642', '9643', '9645', '9647', '9648', '9650', '9651', '9652', '9653', '9654', '9657', '9658', '9670', '9671', '9672', '9673', '9674', '9675', '9678', '9680', '9681', '9682', '9683', '9684', '9685', '9687', '9701', '9702', '9703', '9704', '9705', '9706', '9708', '9710', '9712', '9713', '9714', '9715', '9716', '9718', '9720', '9721', '9723', '9724', '9725', '9726', '9728', '9730', '9731', '9732', '9734', '9735', '9736', '9738', '9740', '9741', '9742', '9743', '9745', '9746', '9748', '9750', '9751', '9752', '9753', '9754', '9756', '9758', '9760', '9761', '9762', '9763', '9764', '9765', '9768', '9780', '9781', '9782', '9783', '9784', '9785', '9786', '9801', '9802', '9803', '9804', '9805', '9806', '9807', '9810', '9812', '9813', '9814', '9815', '9816', '9817', '9820', '9821', '9823', '9824', '9825', '9826', '9827', '9830', '9831', '9832', '9834', '9835', '9836', '9837', '9840', '9841', '9842', '9843', '9845', '9846', '9847', '9850', '9851', '9852', '9853', '9854', '9856', '9857', '9860', '9861', '9862', '9863', '9864', '9865', '9867', '9870', '9871', '9872', '9873', '9874', '9875', '9876']
rule0 = [("6403", "0A2B"), ("3659", "0A2B"), ("0197", "0A1B"), ("8964", "0A1B"), ("5830", "2A2B"),("1386", "0A2B")]
rule1 = [("3729", "2A0B"), ("1697", "0A2B"), ("7812", "0A2B"), ("4129", "2A0B"), ("5268", "0A1B"),("2931", "0A3B")]
rule2 = [("3419", "0A2B"), ("8345", "0A2B"), ("5974", "1A1B"), ("6723", "0A1B"), ("7081", "0A1B"),("9837", "0A2B")]
print main(s, rule0)
print main(s, rule1)
print main(s, rule2)
end = time.time()
print "time "+str(end-start)
代码中有一行“彩蛋”,有替代办法。
// @SpringSun
/*分析题干。
由题意,这四个数我们设为ABCD。
由题中给出数,推出限制条件为:
A不能等于6 3 0 8 1
B不能等于4 6 1 9 3
C不能等于0 5 9 6 8
D不能等于3 9 7 4 6
又由题干得知,整个题中尚未出现数字2。故2与本题无关。
(由于使用穷举法,故这个条件可用可不用。)
由倒数第二个条件可看出是决定性条件。
5830中,两个位置是对的。两个是位置不对的。
情况如下
AB CD
AC BD
AD BC
BC AD
BD A
CCD AB
对 反
由此缩小条件,采用穷举法。 */
#include<stdio.h>
void main()
{
int a = 0, b = 0, c = 0, d=0;
for (; 1; d++)
{
if (a==0 ||a==1 ||a==3 ||a==6 ||a ==8)
a++;
if (b == 1 || b == 3 || b == 4 || b == 6 || b == 9)
b++;
if (c == 0 || c == 5 || c == 6 || c == 8 || c == 9)
c++;
if (d == 3 || d == 4 || d == 6 | d == 7 || d == 9)
d++;
if (d == 10)
{
c++;
d = 0;
}
if (c == 10)
{
b++;
c = 0;
}
if (b == 10)
{
a++;
b = 0;
}
if (a==5&&b==8)
if (d == 3 && c == 0)
{
printf("%d,%d,%d,%d", a, b, c, d);
break;
}
if (a==5&&c==3)
if (b==0&&d==8)
{
printf("%d,%d,%d,%d", a, b, c, d);
break;
}
if (a==5&&d==0)
if (b==3&&c==8)
{
printf("%d,%d,%d,%d", a, b, c, d);
break;
}
if (b==8&&c==3)
if (a==0&&d==5)
{
printf("%d,%d,%d,%d", a, b, c, d);
break;
}
if (b==8&&d==0)
if (a==3&&c==5)
{
printf("%d,%d,%d,%d", a, b, c, d);
break;
}
if (c==3&&d==0)
if (a==8&&b==5)
{
printf("%d,%d,%d,%d", a, b, c, d);
break;
}
}
system("pause");
}
#include <stdio.h>
#include <stdlib.h>
char compare[3][6][4] = {
{{6,4,0,3},{3,6,5,9},{0,1,9,7},{8,9,6,4},{5,8,3,0},{1,3,8,6}},
{{3,7,2,9},{1,6,9,7},{7,8,1,2},{4,1,2,9},{5,2,6,8},{2,9,3,1}},
{{3,4,1,9},{8,3,4,5},{5,9,7,4},{6,7,2,3},{7,0,8,1},{9,8,3,7}}
};
char compare_index[3][6][2] = {
{{0,2},{0,2},{0,1},{0,1},{2,2},{0,2}},
{{2,0},{0,2},{0,2},{2,0},{0,1},{0,3}},
{{0,2},{0,2},{1,1},{0,1},{0,1},{0,2}}
};
char num[10000][4];
void main(void)
{
int x;
char y,m,n,i,A,B;
for(x=0;x<10000;x++)
{
num[x][0]=x/1000;
num[x][1]=(x%1000)/100;
num[x][2]=(x%100)/10;
num[x][3]=x%10;
}
for(i=0;i<3;i++)
{
printf("%d :", i+1);
for(x=0;x<10000;x++)
{
for(y=0;y<6;y++)
{
A=0;
B=0;
for(m=0;m<4;m++)
{
for(n=0;n<4;n++)
{
if(num[x][m] == compare[i][y][n])
{
if(m == n)
A++;
else
B++;
}
}
}
if((A !=compare_index[i][y][0]) || (B != compare_index[i][y][1]))
break;
else if (y == 5)
{
for(m=0;m<4;m++)
printf("%d",num[x][m]);
printf("\n");
}
}
}
}
}
声明:本文归Kali吧线上交流群(310651219)所有,仅供学习交流,如需转载请联系本人。
网友评论