結果
| 問題 |
No.36 素数が嫌い!
|
| コンテスト | |
| ユーザー |
toshiro_yanagi
|
| 提出日時 | 2018-06-23 18:49:26 |
| 言語 | Nim (2.2.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 316 bytes |
| コンパイル時間 | 2,954 ms |
| コンパイル使用メモリ | 65,008 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-30 18:31:25 |
| 合計ジャッジ時間 | 4,071 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 17 WA * 9 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 18) Warning: imported and not used: 'math' [UnusedImport]
ソースコード
import strutils, math
let N = stdin.readLine.parseInt
proc isPrime(x: int): bool =
if x != 2:
if x == 1 or (x mod 2 == 0): return false
for i in countup(3, int.high, 2):
if i > (x + 1) div i: break
if x mod i == 0: return false
result = true
echo if N.isPrime or N == 1: "NO" else: "YES"
toshiro_yanagi