結果
問題 |
No.300 平方数
|
ユーザー |
![]() |
提出日時 | 2016-04-05 18:37:59 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 13 ms / 1,000 ms |
コード長 | 412 bytes |
コンパイル時間 | 3,651 ms |
コンパイル使用メモリ | 68,992 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-29 13:30:51 |
合計ジャッジ時間 | 5,242 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(8, 14) Warning: Deprecated since v1.4; it was more confusing than useful, use `[]=`; add is deprecated [Deprecated] /home/judge/data/code/Main.nim(13, 12) Warning: Deprecated since v1.4; it was more confusing than useful, use `[]=`; add is deprecated [Deprecated]
ソースコード
import strutils, math, tables var X = stdin.readline.parseBiggestInt divisors = initTable[int64, int]() for i in 2..X.float.sqrt.int+1: if X mod i.int64 == 0: divisors.add(i.int64, 0) while X mod i.int64 == 0: divisors[i.int64].inc X = X div i.int64 if X > 1: divisors.add(X, 1) var ans = 1.int64 for p in pairs(divisors): var (k, v) = p if v mod 2 == 1: ans *= k echo(ans)