結果

問題 No.1622 三角形の面積
コンテスト
ユーザー tanson
提出日時 2026-01-31 01:16:53
言語 Standard ML
(MLton 20241230)
コンパイル:
mlton_wrapper _filename_
実行:
./main
結果
AC  
実行時間 1 ms / 2,000 ms
+ 64µs
コード長 498 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 5,309 ms
コンパイル使用メモリ 708,968 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-21 00:02:32
合計ジャッジ時間 6,682 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

fun readInt () =
    valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn)
              

fun printAns [] = ignore ()
  | printAns (h::tl) =
    let
        val hReal = Real.fromInt h
        val area = 3.0 * hReal * hReal * (Math.sqrt 3.0) / 4.0
    in
        (
          print (Real.toString area ^ "\n");
          printAns tl
        )
    end


val () =
    let
        val t = readInt ()
        val r_s = List.tabulate (t, fn _ => readInt ())
    in
        printAns r_s
    end
0