結果

問題 No.2997 Making YuzuKizu
ユーザー osada-yum
提出日時 2025-01-19 13:31:16
言語 Fortran
(gFortran 14.2.0)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 937 bytes
コンパイル時間 535 ms
コンパイル使用メモリ 42,368 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2025-01-19 13:31:20
合計ジャッジ時間 1,996 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

!> This file was processed by `fypp`.
!> Today's fortune: "Bad WA", really OK?
!> ランダムウォーク猿「'風呂ー' で はっぴー.」
program yukicoder_2997
  use, intrinsic :: iso_fortran_env
  !> auto use module
  implicit none
  integer(int32), parameter :: na = iachar("a"), nz = iachar("z")
  integer(int32), parameter :: maxi = 10 ** 6
  character(len=maxi) :: s
  integer(int32) :: n
  integer(int32) :: cnts(na:nz)
  integer(int32) :: i
  read(input_unit, *) s
  n = len_trim(s)
  cnts(:) = 0
  do i = 1, n
     cnts(iachar(s(i:i))) = cnts(iachar(s(i:i))) + 1
  end do
  block
    integer(int32) :: y, a, x
    y = minval(cnts(iachar(["y", "u", "k", "a", "r", "i"])))
    a = minval([cnts(iachar("a")) / 2, cnts(iachar(["k", "r", "i"]))])
    x = minval([cnts(iachar("u")) / 3, cnts(iachar("z")) / 2, cnts(iachar(["y", "k", "i"]))])
    write(output_unit, '(*(i0, 1x))') y, a, x
  end block
end program yukicoder_2997
0