結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
![]() |
提出日時 | 2018-06-23 18:21:35 |
言語 | Nim (2.2.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 305 bytes |
コンパイル時間 | 3,218 ms |
コンパイル使用メモリ | 65,004 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 18:30:17 |
合計ジャッジ時間 | 4,141 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 WA * 9 |
ソースコード
import strutils, math let N = stdin.readLine.parseInt proc isPrime(x: int): bool = if x != 2: if x < 2 or x mod 2 == 0: return false for i in countup(3, int.high, 2): if i ^ 2 > x: break if x mod i == 0: return false result = true echo if N.isPrime or N == 1: "NO" else: "YES"