先粘实现代码,以后需要再慢慢补充思路

s = '''
73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
85861560789112949495459501737958331952853208805511
12540698747158523863050715693290963295227443043557
66896648950445244523161731856403098711121722383113
62229893423380308135336276614282806444486645238749
30358907296290491560440772390713810515859307960866
70172427121883998797908792274921901699720888093776
65727333001053367881220235421809751254540594752243
52584907711670556013604839586446706324415722155397
53697817977846174064955149290862569321978468622482
83972241375657056057490261407972968652414535100474
82166370484403199890008895243450658541227588666881
16427171479924442928230863465674813919123162824586
17866458359124566529476545682848912883142607690042
24219022671055626321111109370544217506941658960408
07198403850962455444362981230987879927244284909188
84580156166097919133875499200524063689912560717606
05886116467109405077541002256983155200055935729725
71636269561882670428252483600823257530420752963450
'''.replace('\n','')
l = 13
max1 = 0
for i in range(len(s)-l):
m = 1
for j in s[i:i+l]:
m*=int(j)
if max1 < m:
max1 = m
print(max1)

  

Problem 8: Largest product in a series的更多相关文章

  1. projecteuler Problem 8 Largest product in a series

    The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = ...

  2. Largest product in a series

    这个我开始理解错了,算错了. 我以为是求连续5个数的最大值,结果,是连接5个数相乘的最大值. 英语不好,容易吃亏啊. Find the greatest product of five consecu ...

  3. 【Project Euler 8】Largest product in a series

    题目要求是: The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × ...

  4. Project Euler 8 Largest product in a series

    题意:寻找这 1000 个数中相邻 13 个数相乘积最大的值 思路:首先想到的是暴力,但是还可以利用之前记录过的数值,什么意思呢?即在计算 2 - 14 后,再计算 3 - 15 时完全可以利用之前计 ...

  5. Largest product from 3 integers

    https://github.com/Premiumlab/Python-for-Algorithms--Data-Structures--and-Interviews/blob/master/Moc ...

  6. Problem 4: Largest palindrome product

    A palindromic number reads the same both ways. The largest palindrome made from the product of two 2 ...

  7. projecteuler----&gt;problem=8----Largest product in a series

    title: The four adjacent digits in the 1000-digit number that have the greatest product are 9 9 8 9 ...

  8. Project Euler Problem 8-Largest product in a series

    直接暴力 写完才想到,代码写矬了,扫一遍就出结果了,哪还用我写的这么麻烦 ss = '''73167176531330624919225119674426574742355349194934 9698 ...

  9. R语言学习——欧拉计划(11)Largest product in a grid

    Problem 11 In the 20×20 grid below, four numbers along a diagonal line have been marked in red. 08 0 ...

随机推荐

  1. Maven项目下的Mybatis逆向工程

    IDEA Maven项目的Mybatis逆向工程 1.配置.pom 如果是在多模块开发下,该文件逆向工程要生成的那个模块下的pom文件. <build> <plugins> & ...

  2. 「Python」数据清洗常用正则

    对爬虫数据进行自然语言清洗时用到的一些正则表达式 标签中的所有属性匹配(排除src,href等指定参数) 参考链接 # \b(?!src|href)\w+=[\'\"].*?[\'\&quo ...

  3. C++_day8pm_多态

    1.什么是多态 2. 示例代码: #include <iostream> using namespace std; //形状:位置.绘制 //+--圆形:半径.(绘制) //+--矩形:长 ...

  4. 合并K个排序链表(java实现)

    题目: 合并 k 个排序链表,返回合并后的排序链表.请分析和描述算法的复杂度. 示例: 输入: [   1->4->5,   1->3->4,   2->6 ] 输出: ...

  5. Python实现:汉诺塔问题

    汉诺塔问题不管在任何编程语言里都是经典问题,是采用递归算法的经典案例,该问题可以抽象如下: 一 .3根圆柱A,B,C,其中A上面串了n个圆盘 二 .这些圆盘从上到下是按从小到大顺序排列的,大的圆盘任何 ...

  6. AEM上的一个图片转换工具

    目的: 不同情况下,同样一张图片,需要不一样大小/背景/尺寸显示. 例子: dam下面有一张940 x 300 的图片: http://localhost:4502/content/dam/geome ...

  7. 毕业设计《项目管理》总结06之ajax的初步使用经验

    1.ajax页面时不能实现下载功能,因为后台下载功能返回的是一个流,而ajax得到后台的数据只能是字符串或字符,所以实现的方法可以: 例如:用js生成一个form,用这个form提交参数,并返回“流” ...

  8. [luogu P2521] [HAOI2011]防线修建

    [luogu P2521] [HAOI2011]防线修建 题目描述 近来A国和B国的矛盾激化,为了预防不测,A国准备修建一条长长的防线,当然修建防线的话,肯定要把需要保护的城市修在防线内部了.可是A国 ...

  9. hive的排序,分組练习

    hive的排序,分組练习 数据: 添加表和插入数据(数据在Linux本地中) create table if not exists tab1( IP string, SOURCE string, TY ...

  10. idea springboot jrebel hotreloaded

    http://127.0.0.1:8888/88414687-3b91-4286-89ba-2dc813b107ce