結果

問題 No.431 死亡フラグ
ユーザー yozayoza
提出日時 2016-12-13 19:09:55
言語 Vim script
(v9.1)
結果
WA  
実行時間 -
コード長 534 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 7,072 KB
実行使用メモリ 11,776 KB
最終ジャッジ日時 2024-05-07 09:47:44
合計ジャッジ時間 1,158 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 11 ms
11,520 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 10 ms
11,392 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 10 ms
11,648 KB
testcase_09 WA -
testcase_10 AC 10 ms
11,520 KB
testcase_11 AC 10 ms
11,520 KB
testcase_12 AC 10 ms
11,392 KB
testcase_13 WA -
testcase_14 AC 10 ms
11,648 KB
testcase_15 AC 10 ms
11,520 KB
権限があれば一括ダウンロードができます

ソースコード

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 [d1, d2, d3, s] = map(split(a:input[0], ' '), 'str2nr(v:val)')
  let r = (d1 + d2 + d3 >= 2 || s) ? 'SURVIVED' : 'DEAD'

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

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