結果

問題 No.2647 [Cherry 6th Tune A] Wind
ユーザー osada-yumosada-yum
提出日時 2024-03-13 16:12:37
言語 Fortran
(gFortran 13.2.0)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 764 bytes
コンパイル時間 1,962 ms
コンパイル使用メモリ 32,000 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-13 16:12:40
合計ジャッジ時間 3,129 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,676 KB
testcase_01 AC 3 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 4 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 4 ms
6,676 KB
testcase_06 AC 3 ms
6,676 KB
testcase_07 AC 3 ms
6,676 KB
testcase_08 AC 4 ms
6,676 KB
testcase_09 AC 6 ms
6,676 KB
testcase_10 AC 6 ms
6,676 KB
testcase_11 AC 7 ms
6,676 KB
testcase_12 AC 6 ms
6,676 KB
testcase_13 AC 1 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

program yukicoder_2647
  use, intrinsic :: iso_fortran_env
  implicit none
  integer(int32) :: t
  integer(int32) :: i
  read(input_unit, *) t
  do i = 1, t
     call calc_query()
  end do
contains
  impure subroutine calc_query()
    integer(int32) :: d
    integer(int64) :: a
    integer(int64), allocatable :: xs(:)
    read(input_unit, *) d, a
    allocate(xs(d))
    read(input_unit, *) xs(:)
    write(output_unit, '(*(i0, 1x))') round_div(xs, a)
  end subroutine calc_query
  pure elemental integer(int64) function round_div(x, y) result(res)
    integer(int64), intent(in) :: x, y
    integer(int64) :: rest
    res = x / y
    rest = x - res * y
    if (2 * rest >= y) &
         & res = res + 1_int64
  end function round_div
end program yukicoder_2647
0