Nyoj 517-least common multiple (Python range (start, end) range (length))

Source: Internet
Author: User

517-least common multiple

Memory limit: 64MB time limit: 1000ms Special Award: No
number of Passes: 2 commits: 3 difficulty:

Title Description: Why is 1 hours 60 minutes instead of 100 minutes? This is the result of historical habits. But it is not purely accidental: 60 is a good number, it has more factors. In fact, it is a multiple of each number from 1 to 6. That is, 1,2,3,4,5,6 can be 60 apart.
We want to find the smallest integer m of every number that can be removed from 1 to N. Input Description:
Multiple sets of test data (less than 500 groups). There is only one number n (1<=n<=100) per line.
Output Description:
Output the corresponding m.
Sample input:Copy
Sample output:

Python AC:

1X = [0, 1, 2, 6, 12]2 3  forIinchRange (5, 101):4j = 15      whileTrue:6temp = J * X[i-1]7         ifTemp% i = =0:8 x.append (temp);9              Break;TenJ + = 1 One  A Try: -      whileTrue: -n =int (input ()) the         Print(X[n]) - exceptEoferror: -     Pass

Nyoj 517-least common multiple (Python range (start, end) range (length))

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.