結果

問題 No.537 ユーザーID
ユーザー むらためむらため
提出日時 2019-01-16 11:34:06
言語 Nim
(2.0.2)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,578 bytes
コンパイル時間 872 ms
コンパイル使用メモリ 72,872 KB
最終ジャッジ日時 2024-04-27 02:46:03
合計ジャッジ時間 1,320 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
/home/judge/data/code/Main.nim(29, 28) Error: cannot open file: queues

ソースコード

diff #

#[
import sequtils,strutils,algorithm,math,sugar,macros,strformat
import sets,tables,intsets,queues,heapqueue,bitops
template get*():string = stdin.readLine().strip()
macro unpack*(arr: auto,cnt: static[int]): auto =
  let t = genSym(); result = quote do:(let `t` = `arr`;())
  for i in 0..<cnt: result[1].add(quote do:`t`[`i`])
template times*(n:int,body) = (for _ in 0..<n: body)
template `max=`*(x,y) = x = max(x,y)
template `min=`*(x,y) = x = min(x,y)
proc getIsPrimes(n:int) :seq[bool] = # [0...n] O(n loglog n)
  result = newSeqWith(n+1,true)
  result[0] = false
  result[1] = false
  for i in 2..n.float.sqrt.int :
    if not result[i]: continue
    for j in countup(i*2,n,i):
      result[j] = false


let n = get().parseInt()
const isPrimes = getIsPrimes(1e6.int + 10)
for i in
let factorCounts = n.getFactorByProcess().toCountTable()
let factors = toSeq(factorCounts.values)
echo factors.mapIt(it + 1).foldl(a * b,1)
]#
import sequtils,strutils,algorithm,math,sugar,macros,strformat
import sets,tables,intsets,queues,heapqueue,bitops
template get*():string = stdin.readLine().strip()
macro unpack*(arr: auto,cnt: static[int]): auto =
  let t = genSym(); result = quote do:(let `t` = `arr`;())
  for i in 0..<cnt: result[1].add(quote do:`t`[`i`])
template times*(n:int,body) = (for _ in 0..<n: body)
template `max=`*(x,y) = x = max(x,y)
template `min=`*(x,y) = x = min(x,y)

let n = get().parseInt()
var results = initSet[string]()
for i in 1..n.float.sqrt.int:
  if n mod i != 0: continue
  results.incl $i & $(n div i)
  results.incl $(n div i) & $i
echo results.card
0