結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
![]() |
提出日時 | 2018-03-24 11:01:19 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 185 bytes |
コンパイル時間 | 453 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 24,192 KB |
最終ジャッジ日時 | 2024-06-25 02:44:30 |
合計ジャッジ時間 | 7,218 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | AC * 3 WA * 2 TLE * 1 -- * 20 |
コンパイルメッセージ
Main.rb:5: warning: `if' at the end of line without an expression Syntax OK
ソースコード
n = gets.to_i c = 0 n.times do |i| c += 1 if n % (i+1) == 0 if c > 2 break end end if n == 1 puts "YES" elsif n == 2 puts "NO" elsif c == 3 puts "YES" elsif c == 2 puts "NO" end