Submission #2852419


Source Code Expand

import strutils, math

proc calc(n: var int): int =
  var
    i = 2
    dic = newSeq[int]()

  while i ^ 2 <= n:
    if n mod i == 0:
      n = n div i
      if i notin dic:
        add dic, i
      i = 2
    else: i += 1

  add dic, n
  return max dic

while true:
  var n = parseInt readLine stdin
  if n == 0: break

  write stdout, calc n, "\n"

Submission Info

Submission Time
Task B - Working for the World
User ToshiroYanagi
Language Nim (0.13.0)
Score 100
Code Size 372 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Compile Error

Hint: system [Processing]
Hint: Main [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: math [Processing]
Hint: times [Processing]
Hint:  [Link]
Hint: operation successful (13980 lines compiled; 1.883 sec total; 15.153MB; Release Build) [SuccessX]

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 27
Set Name Test Cases
All 00-sample, 10-minimum, 11-maximum, 12-little, 13-large, 14-middle, 15-zero, 50-random00, 50-random01, 50-random02, 50-random03, 50-random04, 50-random05, 50-random06, 50-random07, 50-random08, 50-random09, 50-random10, 50-random11, 50-random12, 50-random13, 50-random14, 50-random15, 50-random16, 50-random17, 50-random18, 50-random19
Case Name Status Exec Time Memory
00-sample AC 1 ms 256 KB
10-minimum AC 1 ms 256 KB
11-maximum AC 1 ms 256 KB
12-little AC 1 ms 256 KB
13-large AC 1 ms 256 KB
14-middle AC 1 ms 256 KB
15-zero AC 1 ms 256 KB
50-random00 AC 1 ms 256 KB
50-random01 AC 1 ms 256 KB
50-random02 AC 1 ms 256 KB
50-random03 AC 1 ms 256 KB
50-random04 AC 1 ms 256 KB
50-random05 AC 1 ms 256 KB
50-random06 AC 1 ms 256 KB
50-random07 AC 1 ms 256 KB
50-random08 AC 1 ms 256 KB
50-random09 AC 1 ms 256 KB
50-random10 AC 1 ms 256 KB
50-random11 AC 1 ms 256 KB
50-random12 AC 1 ms 256 KB
50-random13 AC 1 ms 256 KB
50-random14 AC 1 ms 256 KB
50-random15 AC 1 ms 256 KB
50-random16 AC 1 ms 256 KB
50-random17 AC 1 ms 256 KB
50-random18 AC 1 ms 256 KB
50-random19 AC 1 ms 256 KB