結果

問題 No.192 合成数
ユーザー regeregeregerege
提出日時 2017-04-17 21:29:38
言語 F#
(F# 4.0)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 209 bytes
コンパイル時間 4,423 ms
コンパイル使用メモリ 154,696 KB
実行使用メモリ 25,288 KB
最終ジャッジ日時 2023-09-09 09:05:00
合計ジャッジ時間 8,105 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
22,972 KB
testcase_01 AC 79 ms
24,992 KB
testcase_02 AC 79 ms
24,956 KB
testcase_03 AC 79 ms
24,984 KB
testcase_04 AC 79 ms
20,908 KB
testcase_05 AC 83 ms
23,108 KB
testcase_06 AC 83 ms
23,140 KB
testcase_07 AC 85 ms
23,132 KB
testcase_08 AC 79 ms
23,020 KB
testcase_09 AC 79 ms
23,016 KB
testcase_10 AC 85 ms
23,048 KB
testcase_11 AC 79 ms
22,956 KB
testcase_12 AC 84 ms
20,996 KB
testcase_13 AC 78 ms
22,880 KB
testcase_14 AC 83 ms
23,224 KB
testcase_15 AC 78 ms
23,016 KB
testcase_16 AC 83 ms
21,100 KB
testcase_17 AC 85 ms
25,032 KB
testcase_18 AC 87 ms
25,092 KB
testcase_19 AC 84 ms
21,204 KB
testcase_20 AC 84 ms
25,288 KB
testcase_21 AC 78 ms
22,956 KB
testcase_22 AC 79 ms
24,944 KB
testcase_23 AC 84 ms
23,248 KB
testcase_24 AC 79 ms
20,984 KB
testcase_25 AC 84 ms
23,040 KB
testcase_26 AC 85 ms
23,144 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let N = stdin.ReadLine() |> int
if N % 2 = 0 then N
else
    Seq.initInfinite ((+)1 >> (*)2)
    |> Seq.map (fun n -> n*n)
    |> Seq.filter (fun n -> N-100 <= n && n <= N+100)
    |> Seq.head
|> printfn "%d"
0