結果

問題 No.279 木の数え上げ
ユーザー yozayoza
提出日時 2016-12-12 21:11:11
言語 Vim script
(v9.1)
結果
TLE  
実行時間 -
コード長 724 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 5,240 KB
実行使用メモリ 8,768 KB
最終ジャッジ日時 2023-08-19 21:43:45
合計ジャッジ時間 4,438 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
5,876 KB
testcase_01 AC 7 ms
5,644 KB
testcase_02 AC 13 ms
5,608 KB
testcase_03 AC 8 ms
5,660 KB
testcase_04 AC 5 ms
5,680 KB
testcase_05 AC 11 ms
5,696 KB
testcase_06 AC 5 ms
5,704 KB
testcase_07 AC 7 ms
5,680 KB
testcase_08 AC 14 ms
5,648 KB
testcase_09 AC 4 ms
5,708 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

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