結果
| 問題 |
No.2647 [Cherry 6th Tune A] Wind
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-13 16:12:37 |
| 言語 | Fortran (gFortran 14.2.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 764 bytes |
| コンパイル時間 | 1,604 ms |
| コンパイル使用メモリ | 32,128 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-09-29 22:53:40 |
| 合計ジャッジ時間 | 2,275 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
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