結果

問題 No.3012 岩井星人グラフ
ユーザー osada-yum
提出日時 2025-01-25 19:04:09
言語 Fortran
(gFortran 14.2.0)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 1,205 bytes
コンパイル時間 3,401 ms
コンパイル使用メモリ 45,104 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2025-01-26 00:02:18
合計ジャッジ時間 9,192 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

!> This file was processed by `fypp`.
!> Today's fortune: "Bad AC", really OK?
!> ランダムウォーク猿「'Union Find' で はっぴー.」
program yukicoder_3012
  use, intrinsic :: iso_fortran_env
  !> auto use module
  implicit none
  integer(int32) :: x, y
  integer(int32), allocatable :: deg1(:), deg2(:), deg3(:)
  integer(int32) :: i, j
  read(input_unit, *) x, y
  allocate(deg1(x), deg2((y - 2) * x), deg3(x))
  deg3(1:x) = [(i, i = 1, x)]
  deg1(1:x) = [(i, i = (y - 1) * x + 1, y * x)]
  deg2(1 : (y - 2) * x) = [(i, i = x + 1, (y - 1) * x)]

  write(error_unit, '(*(i0, 1x))') deg3(:)
  write(error_unit, '(*(i0, 1x))') deg1(:)
  write(error_unit, '(*(i0, 1x))') deg2(:)

  write(output_unit, '(*(i0, 1x))') x * y, x * y
  do i = 1, x
     write(output_unit, '(*(i0, 1x))') deg3(i), deg3(mod(i, x) + 1)
  end do
  do i = 1, x
     write(output_unit, '(*(i0, 1x))') deg3(i), deg2((y - 2) * (i - 1) + 1)
  end do
  do i = 1, x
     write(output_unit, '(*(i0, 1x))') deg2((y - 2) * i), deg1(i)
  end do
  do i = 1, x
     do j = 1, y - 3
        write(output_unit, '(*(i0, 1x))') deg2((y - 2) * (i - 1) + j), deg2((y - 2) * (i - 1) + j + 1)
     end do
  end do
end program yukicoder_3012
0