結果
| 問題 |
No.49 算数の宿題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-12 21:45:08 |
| 言語 | Nim (2.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 392 bytes |
| コンパイル時間 | 961 ms |
| コンパイル使用メモリ | 68,480 KB |
| 最終ジャッジ日時 | 2024-11-15 04:45:47 |
| 合計ジャッジ時間 | 1,335 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、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
ソースコード
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