Arithmetic expressions Sergey Svistunov

Evaluate 100 arithmetic expressions as fast as possible.

Input

One expression per line on STDIN. Each expression contains 50,000 int16 numbers with operators +, -, *, / (integer division) and parentheses (, ).

-19550 - ((-14208 / (13583 + -19215)) + (-16832 / 797 + (9060 / -23627)) + ((-6060) + 24953))
30835 - 3703 - (-20089 * -6261 + ((-28985 - 29627) + (-17828 - (22773 / -4014) * 1630)))

Output

Print the int64 result of each expression, one per line, to STDOUT.

Back to listNov 29, 2024 13:17E SequeiraE SequeiraError
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 29, 2024 13:1700000Error: Exit with code 2: panic: runtime error: index out of range [493032] with length 493032 goroutine 1 [running]: main.(*Parser).parseNumber(0x5b4245ab26cb?) /tmp/solution337208112/main.go:46 +0x38d main.(*Parser).factor(0x5b4245bb6f60?) /tmp/sol...stderr