結果

問題 No.889 素数!
ユーザー natoriusannatoriusan
提出日時 2023-08-01 18:38:45
言語 F#
(F# 4.0)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 652 bytes
コンパイル時間 9,348 ms
コンパイル使用メモリ 193,204 KB
実行使用メモリ 31,616 KB
最終ジャッジ日時 2024-04-19 17:49:23
合計ジャッジ時間 12,823 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
31,104 KB
testcase_01 AC 65 ms
31,360 KB
testcase_02 AC 63 ms
31,360 KB
testcase_03 AC 63 ms
31,360 KB
testcase_04 AC 63 ms
31,104 KB
testcase_05 AC 65 ms
30,976 KB
testcase_06 AC 64 ms
30,848 KB
testcase_07 AC 64 ms
31,104 KB
testcase_08 AC 62 ms
31,488 KB
testcase_09 AC 62 ms
31,488 KB
testcase_10 AC 60 ms
31,232 KB
testcase_11 AC 61 ms
31,360 KB
testcase_12 AC 63 ms
30,976 KB
testcase_13 AC 61 ms
31,488 KB
testcase_14 AC 63 ms
31,488 KB
testcase_15 AC 63 ms
31,360 KB
testcase_16 AC 61 ms
31,104 KB
testcase_17 AC 61 ms
31,616 KB
testcase_18 AC 64 ms
31,104 KB
testcase_19 AC 62 ms
31,232 KB
testcase_20 AC 60 ms
31,360 KB
testcase_21 AC 61 ms
31,104 KB
testcase_22 AC 62 ms
31,360 KB
testcase_23 AC 63 ms
31,480 KB
testcase_24 AC 62 ms
31,232 KB
testcase_25 AC 65 ms
31,468 KB
testcase_26 AC 64 ms
31,468 KB
testcase_27 AC 64 ms
31,360 KB
testcase_28 AC 61 ms
31,480 KB
testcase_29 AC 64 ms
31,488 KB
testcase_30 AC 62 ms
30,976 KB
testcase_31 AC 65 ms
30,976 KB
testcase_32 AC 63 ms
31,360 KB
testcase_33 AC 63 ms
31,360 KB
testcase_34 AC 62 ms
31,104 KB
testcase_35 AC 62 ms
31,488 KB
testcase_36 AC 62 ms
31,360 KB
testcase_37 AC 61 ms
31,104 KB
testcase_38 AC 62 ms
31,488 KB
testcase_39 AC 64 ms
31,104 KB
testcase_40 AC 64 ms
31,104 KB
testcase_41 AC 61 ms
30,976 KB
testcase_42 AC 60 ms
31,232 KB
testcase_43 AC 61 ms
31,344 KB
testcase_44 AC 61 ms
31,212 KB
testcase_45 AC 62 ms
31,352 KB
testcase_46 AC 62 ms
31,232 KB
testcase_47 AC 60 ms
31,232 KB
testcase_48 AC 62 ms
30,976 KB
testcase_49 AC 63 ms
31,360 KB
testcase_50 AC 61 ms
31,232 KB
testcase_51 AC 68 ms
31,232 KB
testcase_52 AC 68 ms
31,104 KB
testcase_53 AC 66 ms
31,348 KB
testcase_54 AC 64 ms
30,976 KB
testcase_55 AC 64 ms
31,232 KB
testcase_56 AC 63 ms
31,104 KB
testcase_57 AC 62 ms
31,360 KB
testcase_58 AC 63 ms
31,232 KB
testcase_59 AC 63 ms
31,232 KB
testcase_60 AC 63 ms
31,360 KB
testcase_61 AC 62 ms
30,848 KB
testcase_62 AC 61 ms
31,360 KB
testcase_63 AC 61 ms
31,360 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (239 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

open System.Reflection.Metadata

let n = stdin.ReadLine () |> int

let mutable primes = [||]

for i in 2..63 do
    let mutable modResult = 1
    for j in primes do
        modResult <- min modResult (i%j)
    if modResult = 1 then
        primes <- Array.append primes [|i|]

let square =
    [|
        for i in 2..7 ->
            i * i
    |]
let cubic =
    [|
        for i in 2..3 ->
            i * i * i
    |]
    
if Array.contains n primes then
    "Sosu!"
elif Array.contains n square then
    "Heihosu!"
elif Array.contains n cubic then
    "Ripposu!"
elif Array.contains n [|6; 28|] then
    "Kanzensu!"
else
    string n
|> printfn "%s"
0