結果
| 問題 | 
                            No.36 素数が嫌い!
                             | 
                    
| コンテスト | |
| ユーザー | 
                             toshiro_yanagi
                         | 
                    
| 提出日時 | 2019-01-05 01:10:30 | 
| 言語 | Nim  (2.2.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 445 bytes | 
| コンパイル時間 | 3,424 ms | 
| コンパイル使用メモリ | 68,764 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-07-01 06:21:35 | 
| 合計ジャッジ時間 | 5,769 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 24 WA * 2 | 
ソースコード
import strutils, tables
proc isUsableNum(a: int): bool =
  var
    x = a
    dic = initCountTable[int]()
    i = 2
  while i * i <= a:
    while x mod i == 0:
      inc dic, i
      x = x div i
    inc i
  if x != 1 and x != a: inc dic, x
  if dic.len >= 3: return true
  for k, v in dic:
    if v >= 2: return true
proc main: void =
  let n = parseInt readLine stdin
  ["NO", "YES"][n.isUsableNum.int].echo
when isMainModule:
  main()
            
            
            
        
            
toshiro_yanagi