結果

問題 No.279 木の数え上げ
ユーザー yoza
提出日時 2016-12-12 21:11:11
言語 Vim script
(v9.1)
結果
TLE  
実行時間 -
コード長 724 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 24,768 KB
最終ジャッジ日時 2024-11-29 17:56:44
合計ジャッジ時間 33,975 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 TLE * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

function! s:output()
  let this = {'lines': []}

  function! this.append(line) abort
    call add(self.lines, a:line)
  endfunction

  function! this.build() abort
    return join(self.lines, "\n")
  endfunction

  return this
endfunction

function! s:main(input) abort
  let o = s:output()

  let [c_t, c_r, c_e] = [0, 0, 0]
  let l = len(a:input[0])
  let i = 0
  while i < l
    let c = a:input[0][i]
    if c ==# 't'
      let c_t += 1
    elseif c ==# 'r'
      let c_r += 1
    elseif c ==# 'e'
      let c_e += 1
    endif
    let i += 1
  endwhile

  let c_e = c_e / 2
  let r = min([c_t, c_r, c_e])

  call o.append(r)
  return o.build()
endfunction

let s:input = getline(1, '$')
enew
put =s:main(s:input)
2,$print
0