UVa 10924

From Algorithmist
Jump to navigation Jump to search

10924 - Prime Words[edit]

Summary[edit]

Sum up the value of a word by mapping it from , and then check if that sum is a prime number.

Explanation[edit]

The straightforward approach for checking primes is good enough for this problem.

Gotcha's[edit]

  • 1 is considered a prime in this problem, though it isn't normally.

Solutions[edit]

Input[edit]

UFRN
contest
AcM
a

Output[edit]

It is a prime word.
It is not a prime word.
It is not a prime word.
It is a prime word.