问题描述:
Consider all integer combinations of ab for 2 a 5 and 2 b 5:
22=4, 23=8, 24=16, 25=32
32=9, 33=27, 34=81, 35=243
42=16, 43=64, 44=256, 45=1024
52=25, 53=125, 54=625, 55=3125
If they are then placed in numerical order, with any repeats removed, we get the following sequence of 15 distinct terms:
4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125
How many distinct terms are in the sequence generated by ab for 2 a 100 and 2 b 100?
解决问题:
java里有set,每次计算出来,都将值放入其中,然后统计。
public static int count(){
int total = 0;
Set<Double> all = new HashSet<Double>();
for(int i=DOWN; i<=UP; i++){
for(int j=DOWN; j<=UP; j++){
double value = Math.pow(i, j);
all.add(value);
}
}
return all.size();
}
分享到:
相关推荐
21.5 FMS related problem 29 21.6 Alarm Panel 29 21.7 IPN problem 29 21.8 Alarm routing problem 30 21.9 Charging related problem 30 21.10 FTP related problem 30 21.11 Command restrict problem 31 22. ...
Computer Networking: A Top-Down Approach, 6th Edition Solutions to Review Questions and Problems Version Date: May 2012 ...This document contains the solutions to review questions ...Problem 1 There...
0-1-knapsack-problem-master (29).zip
0-1-knapsack-problem-master (29)c.zip
于2019.7.29考的一套题目。主要是贪心,搜索(迭代加深搜索的优化),排序等等算法的结合。算是一套好题吧。欢迎来本人博客看本人做题记录,不要忘记点赞哦!
1 CHAPTER 2 The Economic Problem 29 CHAPTER 3 CHAPTER 4 CHAPTER 5 CHAPTER 6 CHAPTER 7 Demand and Supply 55 Elasticity 83 Efficiency and Equity 105 Government Actions in Markets 127 Global Markets in...
ISO IEC TR 29181-9:2017 Information technology - Future Network - Problem statement and requirements - Part 9:Networking of everything - 完整英文版(29页).pdf
Delphi VCLSkin 5.30 ... VCLSkin is a component to create skinnable user interface for Delphi/C++Builder application, It is easy to use, just put one component on mainform, ...* fix caption paint problem...
radiobutton,checkbox.News in 3.35 2005.9.5*Support TGroupbox font color.News in 3.34 2005.8.31*Fix paint problem in Trackbar when skin file change.News in 3.33 2005.8.29*Fix problem in TcxDBCheckbox....
Volume 29. April 1992 CONCURRENT VALIDITY OF THE SCHOOL PROBLEM SCREENING INVENTORY FOR BEHAVIOR-DISORDERED STUDENTS WILLIAM S. NODRICK Wood’s Homes, Calgary, Alberta ANITA K.F. LI ...
29, 30, , 32, , , , 36, , , , , 41, , , 44, 45, , , , , , 51, 52, , , , , 57, , , , , , , , 65, , , 68, , , , , , , , 76, , , , , 81, , , 84, 85, , 87, , , , 91, , 93, , , , 97, , 99, , , , , , 105, ...
29.08.2008 AlphaControls v5.63 beta released * A lot of small improvements and bug-fixes 13.08.2008 AlphaControls v5.62 beta released * Improved design-time editor for the SkinManager.ThirdParty ...
Accepted Ratio:29.86% (2926/9766) Problem Description Given two integers n and m, count the number of pairs of integers (a,b) such that 0 (a^2+b^2 +m)/(ab) is an integer. This problem contains ...
使用 ASP.NET Core 3.x 构建 RESTful Web API(2020-2-7更新) P29_自定义错误信息和错误报告_Routine.Api2020_2_13.rar P29 自定义错误信息和错误报告 ...Problem details for HttP APIs RFC(7807)
29 3.5.5 Deadlock #3 . . . . . . . . . . . . . . . . . . . . . . . . . 31 3.6 Reusable barrier . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 3.6.1 Reusable barrier non-solution #1 . . . . ...
Machine Learning, Optimization, and Big Data: Second International Workshop, MOD 2016, Volterra, Italy, August 26-29, 2016, Revised Selected Papers (Lecture Notes in Computer Science) This book ...
解决问题课程: 适用于初学者的Python:通过解决29个问题来提高技能
第29章二分一体.md 3个最长的子字符串,没有重复的字符.md 33.在旋转排序数组中搜索.md 34在排序数组中找到元素的第一个和最后一个位置.md 35-搜索插入位置.md 36-有效的数独.md 38计数与说.md 39-组合-sum....
problem 7 heuristic可以自己调整使用模糊算法来算两个点的距离(7502 expanded nodes,25秒内出结果.满分是9000以下,7000以下多一分额外分),或者直接用 bfs/ucs来算(376 expanded nodes,2.5秒出结果),之前改...
29/4/20 6 馅饼规则 简单的DP(递归) 6/6/20 7 难题 简单DP(制表) 6/6/20 8 乔治和乔布 简单DP(制表) 6/6/20 9 密码 拉宾卡普/KMP 11/6/20 10 好子串 拉宾卡普(哈希) 11/6/20 11 DP 修订 修订 23/8/20 添加者...