欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

小学奥数编程题(4)

程序员文章站 2022-04-01 08:53:25
...
小学奥数编程题(4)
            
    
    博客分类: 写给喜欢编程的小朋友 java奥数排列组合  题目:
ABCDE FGHIJ 为0~9的不同数字组成的两个数,首数字不为零,具有两倍关系, 即FGHIJ=2*ABCDE,问ABCDE在所有可能数里,最大和最小数是多少?小学奥数编程题(4)
            
    
    博客分类: 写给喜欢编程的小朋友 java奥数排列组合 

需要的类库可以从 https://github.com/raistlic/raistlic-lib-commons-core 下载

编程解法:小学奥数编程题(4)
            
    
    博客分类: 写给喜欢编程的小朋友 java奥数排列组合  小学奥数编程题(4)
            
    
    博客分类: 写给喜欢编程的小朋友 java奥数排列组合 

import org.raistlic.common.permutation.Combination;
import org.raistlic.common.permutation.Permutation;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * ABCDE FGHIJ 为0~9的不同数字组成的两个数,首数字不为零,具有两倍关系, 即FGHIJ=2XABCDE,问ABCDE在所有可能数里,最大和最小数是多少?
 * Created by xwx on 16/1/2.
 */
public class NumMax {

        static  long min = Long.MAX_VALUE;
        static  long max = Long.MIN_VALUE;

        public static void main(String[] args) {

            System.out.println("===== demo Combination :");

            final List<Integer> full_list = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);

            for(List<Integer> list : Combination.of(full_list,5)){

                List<Integer> list2 = new ArrayList<Integer>();
                list2.addAll(full_list);
                list2.removeAll(list);

                System.out.println(list+"-"+list2);

                for(List<Integer> slist1:Permutation.of(list))
                   for(List<Integer> slist2:Permutation.of(list2))
                      isAnswer(slist1, slist2);

            }

            System.out.println("min = " + min + " : " + (min * 2) + " max=" + max +" : "+ (max * 2));

        }

        public static int  sum( List<Integer> list){
            return  list.get(0)+
                    list.get(1)*10+
                    list.get(2)*100+
                    list.get(3)*1000+
                    list.get(4)*10000;
        }

        public static boolean isAnswer(List<Integer> list1, List<Integer> list2){
            if(list1.get(4)==0 || list2.get(4) ==0) return false;
            if(list1.get(4)>4 || list2.get(4) <2) return false;

            long presum  = sum(list1);
            long thissum = sum(list2);
            if(2*presum == thissum) {
                System.out.println("ABCDE=" + presum + " FGHIJ=" + thissum);
                if(min>presum) min = presum;
                if(max<presum) max = presum;
                return true;
            }
            return false;
        }

}




本程序采用maven进行编译
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>so.qsn</groupId>
    <artifactId>mathtests</artifactId>
    <version>1.0-SNAPSHOT</version>
<dependencies>
    <dependency>
        <groupId>org.raistlic.lib</groupId>
        <artifactId>commons-core</artifactId>
        <version>1.4-SNAPSHOT</version>
    </dependency>

</dependencies>
    
</project>



打印的结果为:
===== demo Combination :
[0, 1, 2, 3, 4]-[5, 6, 7, 8, 9]
[0, 1, 2, 3, 5]-[4, 6, 7, 8, 9]
[0, 1, 2, 3, 6]-[4, 5, 7, 8, 9]
[0, 1, 2, 3, 7]-[4, 5, 6, 8, 9]
[0, 1, 2, 3, 8]-[4, 5, 6, 7, 9]
[0, 1, 2, 3, 9]-[4, 5, 6, 7, 8]
[0, 1, 2, 4, 5]-[3, 6, 7, 8, 9]
[0, 1, 2, 4, 6]-[3, 5, 7, 8, 9]
[0, 1, 2, 4, 7]-[3, 5, 6, 8, 9]
[0, 1, 2, 4, 8]-[3, 5, 6, 7, 9]
[0, 1, 2, 4, 9]-[3, 5, 6, 7, 8]
[0, 1, 2, 5, 6]-[3, 4, 7, 8, 9]
[0, 1, 2, 5, 7]-[3, 4, 6, 8, 9]
[0, 1, 2, 5, 8]-[3, 4, 6, 7, 9]
[0, 1, 2, 5, 9]-[3, 4, 6, 7, 8]
[0, 1, 2, 6, 7]-[3, 4, 5, 8, 9]
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E=38451 FGHIJ=76902
ABCDE=34851 FGHIJ=69702
ABCDE=45381 FGHIJ=90762
ABCDE=35481 FGHIJ=70962
ABCDE=48513 FGHIJ=97026
ABCDE=14853 FGHIJ=29706
ABCDE=48135 FGHIJ=96270
ABCDE=14835 FGHIJ=29670
ABCDE=38145 FGHIJ=76290
ABCDE=13845 FGHIJ=27690
ABCDE=31485 FGHIJ=62970
ABCDE=13485 FGHIJ=26970
ABCDE=45138 FGHIJ=90276
ABCDE=14538 FGHIJ=29076
ABCDE=35148 FGHIJ=70296
ABCDE=13548 FGHIJ=27096
[1, 3, 4, 5, 9]-[0, 2, 6, 7, 8]
[1, 3, 4, 6, 7]-[0, 2, 5, 8, 9]
[1, 3, 4, 6, 8]-[0, 2, 5, 7, 9]
[1, 3, 4, 6, 9]-[0, 2, 5, 7, 8]
[1, 3, 4, 7, 8]-[0, 2, 5, 6, 9]
[1, 3, 4, 7, 9]-[0, 2, 5, 6, 8]
[1, 3, 4, 8, 9]-[0, 2, 5, 6, 7]
[1, 3, 5, 6, 7]-[0, 2, 4, 8, 9]
[1, 3, 5, 6, 8]-[0, 2, 4, 7, 9]
[1, 3, 5, 6, 9]-[0, 2, 4, 7, 8]
[1, 3, 5, 7, 8]-[0, 2, 4, 6, 9]
[1, 3, 5, 7, 9]-[0, 2, 4, 6, 8]
[1, 3, 5, 8, 9]-[0, 2, 4, 6, 7]
[1, 3, 6, 7, 8]-[0, 2, 4, 5, 9]
[1, 3, 6, 7, 9]-[0, 2, 4, 5, 8]
[1, 3, 6, 8, 9]-[0, 2, 4, 5, 7]
[1, 3, 7, 8, 9]-[0, 2, 4, 5, 6]
[1, 4, 5, 6, 7]-[0, 2, 3, 8, 9]
[1, 4, 5, 6, 8]-[0, 2, 3, 7, 9]
ABCDE=48651 FGHIJ=97302
ABCDE=46851 FGHIJ=93702
ABCDE=48615 FGHIJ=97230
ABCDE=18645 FGHIJ=37290
ABCDE=14865 FGHIJ=29730
ABCDE=46185 FGHIJ=92370
AB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