DWITE '07 R5 #2 - Number of factors

View as PDF

Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 64M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
DWITE Online Computer Programming Contest, February 2008, Problem 2

Integer numbers are made up of factors, smallest numbers that when multiplied together form the original number. Factors are always prime. 1 and the original number itself don't count as factors. If a number has no factors, then that number is itself prime. For example, 12 is made up of three factors: 2\times2\times3 (even though 4\times3 is 12, 4 itself has two factors: 2\times2).

We care about this because factors are often involved in cryptography:

When the numbers are very large, no efficient integer factorization algorithm is publicly known; a recent effort which factored a 200-digit number (RSA-200) took eighteen months and used over half a century of computer time.

Though we'll be dealing with much smaller numbers for now.

The input will contain 5 lines, integers 2 \le N \le 32

The output will contain 5 lines -- a total number of factors in a number.

Sample Input


Sample Output


Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) Problem Resource: DWITE


  • -5
    Super_User  commented on Feb. 1, 2020, 9:17 p.m.

    This comment is hidden due to too much negative feedback. Click here to view it.