結果

問題 No.457 (^^*)
コンテスト
ユーザー むらため
提出日時 2019-01-20 20:40:26
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 573 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,994 ms
コンパイル使用メモリ 69,684 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-03-22 09:00:22
合計ジャッジ時間 3,315 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sequtils
proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}
# (((*((^^*)))))
var x = newSeqWith(5,0) # ( * ^ ^ を満たした数
var y = newSeqWith(5,0) # ( ^ ^ *を満たした数
while true:
  let c = getchar_unlocked()
  if c == '(':
    x[0] += 1
    y[0] += 1
  elif c == '^':
    x[3] += x[2]
    x[2] = x[1]
    x[1] = 0
    y[2] += y[1]
    y[1] = y[0]
    y[0] = 0
  elif c == '*':
    x[1] += x[0]
    x[0] = 0
    y[3] += y[2]
    y[2] = 0
  elif c == ')':
    x[4] += x[3]
    y[4] += y[3]
  else: break
echo y[4]," ",x[4]
0