結果

問題 No.781 円周上の格子点の数え上げ
ユーザー taktak
提出日時 2019-03-06 16:10:54
言語 F#
(F# 4.0)
結果
TLE  
実行時間 -
コード長 402 bytes
コンパイル時間 3,448 ms
コンパイル使用メモリ 164,244 KB
実行使用メモリ 50,876 KB
最終ジャッジ日時 2023-09-05 19:09:31
合計ジャッジ時間 8,932 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
24,348 KB
testcase_01 AC 64 ms
22,344 KB
testcase_02 AC 66 ms
24,236 KB
testcase_03 AC 66 ms
22,256 KB
testcase_04 AC 66 ms
22,272 KB
testcase_05 AC 65 ms
20,360 KB
testcase_06 AC 65 ms
22,352 KB
testcase_07 AC 66 ms
24,324 KB
testcase_08 AC 66 ms
22,288 KB
testcase_09 AC 66 ms
22,244 KB
testcase_10 AC 190 ms
26,740 KB
testcase_11 AC 546 ms
30,428 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System

let f r =
  let sqrt' = float >> sqrt >> int
  let isSquare x =
      let t = sqrt' x
      t * t = x
  [ for i in 1 .. sqrt' r -> r - i * i ]
  |> List.where isSquare
  |> List.length
  |> (*) 4
  
let solve min max =
  [ for i in min .. max -> f i ]
  |> List.max
  
let X, Y =
    let t = Console.ReadLine().Split() |> Array.map int
    t.[0], t.[1]
    
solve X Y
|> Console.WriteLine
0