結果

問題 No.49 算数の宿題
ユーザー むらためむらため
提出日時 2017-08-12 21:45:08
言語 Nim
(2.0.2)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 392 bytes
コンパイル時間 811 ms
コンパイル使用メモリ 59,484 KB
最終ジャッジ日時 2023-08-24 17:38:12
合計ジャッジ時間 1,254 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 50) Warning: Use the new 'sugar' module instead; future is deprecated [Deprecated]
/home/judge/data/code/Main.nim(2, 13) Error: cannot open file: queues

ソースコード

diff #

import sequtils,strutils,strscans,algorithm,math,future,macros
import sets,queues,tables,nre,pegs

#let words = stdin.readLine().findAll(re"\d+|\+|\*")
let words = stdin.readLine().findAll(peg"\d+ / '+' / '*'")
var
  ans = 0
  isPlus = true
for w in words:
  if w == "*" : isPlus = true
  elif w == "+" : isPlus = false
  elif isPlus: ans += w.parseInt()
  else : ans *= w.parseInt()
echo ans
0