Euler Project question in Python

Source: Internet
Author: User

# This Python file uses the following encoding:utf-8
# in England the currency was made up of pound,£, and Pence, p, and there were eight coins in general circulation:

# 1p, 2p, 5p, 10p, 20p, 50p,£1 (100p) and£2 (200p).
# It's possible to make£2 in the following,

# 1x£1 + 1x50p + 2x20p + 1x5p + 1x2p + 3x1p
# How many different ways can£2 is made using any number of coins?
Import time
Start = Time.time ()
Print '%s ways is found in%s seconds '% (4 + 2*len ([(I, J, K, L, m) for me in range (0, mm) for J in range (0, a) for K in Range (0, one) for L in range (0, 6) for M in range (0, 3) if i*1 + j*2 + k*5 + l*10 + m*20 =]) + 2*len ([(I, J, K, L, M) For I in range (0, 101) for J in range (0, Wuyi) for K in range (0,) for L in range (0, one) for M in range (0, 6) if i*1 + j*2 + k*5 + l*10 + m*20 = [+]) + len ([(I, J, K, L, m) for I in range (0, 151) for J in range (0, $) for K in range (0) fo R L in range (0,.) for M in range (0, 8) if i*1 + j*2 + k*5 + l*10 + m*20 = [[]]) + Len ([(I, J, K, L, m) for I in range (0 , 201) for J in range (0, 101) for K in range (0, kt) for L in range (0, +) for M in range (0, one) if i*1 + j*2 + k*5 + l*10 + m*20 = = +]), Time.time ()-start)

Just too long, nees some improvement

Euler Project question in Python

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.