Lyndon's Golf Contest 1 P7 - Fun Factoring

View as PDF

Submit solution


Points: 0 (partial)
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
Python

Your friend likes factoring numbers. In fact, your friend's favourite activity is coming up with numbers, and calculating its factors. One day, they decide that factoring numbers by hand takes too much effort, and entrusts you to write a program for them to do so.

Given an integer n (1 \le n \le 10^9), you must output all of the factors of n, including 1 and n. However, your friend demands that your code be short. Very short. Bytes take up space, after all.

Note: You may only submit to this problem in Python 3.

Input Specification

The first line of input contains a single integer n.

Output Specification

Output the factors of n, each on a separate line in any order, so long as there are no duplicates and all factors of n are outputted.

Scoring

Your score will be computed based on the length of your source code, the shorter the better. For an L-byte program,

  • if L \le 54, you will receive the full 100 points.
  • if 55 \le L \le 63, you will receive 80-2 \times (L-55) points.
  • if 64 \le L, you will receive \lfloor 2^{0.16(100-L)} \rfloor points.

Sample Input

70

Sample Output

1
2
5
7
10
14
35
70

Comments


  • 0
    PhoenixCoolIce  commented on May 8, 2024, 2:26 p.m.

    solved this on Feb 9th apparently, but no submissions on Feb 9th?