結果

問題 No.2647 [Cherry 6th Tune A] Wind
コンテスト
ユーザー tanson
提出日時 2026-04-02 08:05:09
言語 Standard ML
(MLton 20241230)
コンパイル:
mlton_wrapper _filename_
実行:
./main
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 1,340 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 5,012 ms
コンパイル使用メモリ 709,000 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-04-03 10:39:53
合計ジャッジ時間 6,111 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge5_1
純コード判定待ち
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

fun readLargeInt () =
    valOf (TextIO.scanStream (LargeInt.scan StringCvt.DEC) TextIO.stdIn)


fun printList [] = print "\n"
  | printList [x] =
    (
      print (LargeInt.toString x);
      printList []
    )
  | printList (h :: tl) = 
    (
      print (LargeInt.toString h);
      print " ";
      printList tl
    )


fun printAns [] = ignore ()
  | printAns (h :: tl) = 
    (
      printList h;
      printAns tl
    )


val () =
    let
        val t = readInt ()
        val cases = List.tabulate (t, fn _ =>
                                         let
                                             val d = readInt()
                                             val a = readLargeInt()
                                             val x_s = List.tabulate (d, fn _ => readLargeInt())
                                         in
                                             (d, a, x_s)
                                         end
                                  )

        val ans = List.map (fn (d, a, x_s) =>
                               List.map (fn x =>
                                            (2 * x + a) div (2 * a))
                                        x_s)
                           cases
    in
        printAns ans
    end
0