結果

問題 No.2216 Pa1indr0me
ユーザー itt828itt828
提出日時 2023-02-17 21:51:09
言語 F#
(F# 4.0)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 809 bytes
コンパイル時間 6,336 ms
コンパイル使用メモリ 160,512 KB
実行使用メモリ 23,072 KB
最終ジャッジ日時 2023-09-26 19:08:05
合計ジャッジ時間 6,870 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
23,072 KB
testcase_01 AC 89 ms
22,988 KB
testcase_02 AC 89 ms
22,996 KB
testcase_03 AC 89 ms
21,096 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

/home/judge/data/code/Main.fs(35,1): warning FS0020: The result of this expression has type 'unit []' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.

ソースコード

diff #

// template

// template.IO
let read = fun () -> stdin.ReadLine()
let readf f = stdin.ReadLine() |> f
let readarr = fun () -> stdin.ReadLine().Split(' ')

let readarrf f =
    stdin.ReadLine().Split(' ') |> Array.map f

// template.algorithms
let rec binarySearch f (ng, ok) =
    let mid = (ok + ng) / 2

    if abs (ok - ng) > 1 then
        if f mid then
            binarySearch f (ng, mid)
        else
            binarySearch f (mid, ok)
    else
        ok

let lowerBound (arr: 'a[]) x =
    binarySearch (fun i -> arr.[i] >= x) (-1, arr.Length)

let upperBound (arr: 'a[]) x =
    binarySearch (fun i -> arr.[i] > x) (-1, arr.Length)



// solution

let t = readf int

seq { 1..t }
|> Seq.map (fun _ ->
    let n = readf int64
    n * (n + 1L))
|> Array.ofSeq
|> Array.map (fun i -> printfn "%d" i)
0