oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

lvm_ex Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

lvm_ex.html

Problem Description

Remember the problem “lvm” from NOI 2008?  (Link here.)  With the recent advancements in computing technology, virtual machines now generally run at a much faster speed.  Although the Lombok Virtual Machine was state-of-the-art technology then, its slow computing speed, as well as small limits for stack and integer sizes, has made it virtually unusable by the modern user.

Unfortunately, Squeaky the Rat had written many programs in the Lombok programming language back in its heyday, and porting those programs to another language is a very tedious task.  Squeaky has tasked you to upgrade the Lombok Virtual Machine, so that his programs can be run faster and with larger constraints.

Help him make a faster version of the Lombok Virtual Machine which will work with the following constraints instead:

  • The stack does not grow bigger than 50000 elements
  • Every element in the stack will always have a value between -10^9 and 10^9 inclusive
  • The input program contains no more than 50000 instructions

Limits

Subtask 1 (1%): At most 40000000 instructions are executed before the program terminates

Subtask 2 (9%): At most 200000000 instructions are executed before the program terminates

Subtask 3 (90%): At most 2000000000 instructions are executed before the program terminates

Subtask 4 (0%): Sample testcases

Sample Testcase 1

Input

14
PUSH 5
STORE
LOAD
LOAD
PUSH -1
PLUS
STORE
LOAD
IFZERO 13
LOAD
TIMES
PUSH 0
IFZERO 3
DONE

Output

120

hci16lvmex.en.pdf

Your browser does not support embedded PDF files. Please download the PDF instead.

Tags

Ad Hoc

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
1131.5s32MBMinimum
2931.5s32MBMinimum
39031.5s32MBMinimum
4011.5s32MBMinimum

Judge Compile Command

g++-8 ans.cpp -o lvm_ex -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.