Problems
Pick a problem and write your solution in the built-in editor. The judge runs it against real test cases while you watch, and the wider archive is open to read whenever you like.
Total results288 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Postfix Expression Evaluation 2Evaluate a postfix expression using given operand values and print the result rounded to two decimal places. | Easy3 | StackString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Hal's CalculatorSimulate a stack-like list of expressions under six commands (HASH, DOLLAR, SWAP, DROP, DUP, ROT), enforcing size and availability constraints, and output the final list or ERROR. | Easy3 | StackSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Bug KingRepeatedly remove all occurrences of the substring "BUG" from each input line, using a stack-like scan since removals can form new matches, until none remain. | Easy3 | StackString | No attempts yet | 1s | 128 MB | Judgeable |
| Working at the RestaurantSimulate a two-pile plate stacking strategy that always drops on pile 2 and serves from pile 1, moving plates when pile 1 runs out, and output the exact operation transcript. | Easy3 | StackSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Car RacingGiven the order in which cars arrive, decide whether a single FIFO bypass lane can reorder them to increasing order. | Easy3 | StackSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| A Balanced WorldFor each line ending in a period, decide whether its round and square brackets are properly matched and nested, printing yes or no. | Easy3 | StackString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Cow CotillionGiven strings of '<' and '>', decide for each whether every character can be paired as a properly nested '><' bow, i.e. whether the brackets are balanced. | Easy3 | StackString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| BFedInterpret a Brainfuck program read from stdin up to '#', supporting the seven pointer, arithmetic, loop, and output commands on a 30000-cell byte tape. | Easy3 | SimulationStack+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Web NavigationSimulate browser back and forward navigation using two stacks, printing the current URL after each command. | Easy3 | StackSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| BracketsFor each line of code until the '#' line, decide whether its round, square, and curly brackets are matched and correctly nested. | Easy3 | StackString | No attempts yet | 1s | 128 MB | Judgeable |
| ProgramCheck whether the bracket string is correct and print its maximum nesting depth, or NIE when it is not. | Easy3 | Stack | No attempts yet | 1s | 512 MB | Judgeable |
| Stock PriceFor each position find the index of the first later price that is higher, or -1 when no such price exists. | Easy3 | StackArray | No attempts yet | 2s | 128 MB | Judgeable |
| ParenthesesDecide for each parenthesis string of length 2 to 50 whether its brackets match correctly and print YES or NO. | Easy3 | Stack | No attempts yet | 1s | 128 MB | Judgeable |
| Islands in the Data StreamCount the nested islands, contiguous blocks higher than both neighbors, in each 15-number stream that starts and ends at zero. | Easy3 | SimulationStack | No attempts yet | 1s | 128 MB | Judgeable |
| LVMSimulate the stack machine program and print the value shown by the first DONE instruction. | Easy3 | SimulationStack | No attempts yet | 2s | 512 MB | Judgeable |
| The Geneva ConfectionDecide if cars arriving top to bottom can be released in order 1 to N using a side branch as a stack. | Easy3 | Stack | No attempts yet | 1s | 256 MB | Judgeable |
| Even Up SolitaireRepeatedly remove adjacent card pairs with an even sum so that as few cards as possible remain. | Easy3 | StackGreedy | No attempts yet | 2s | 256 MB | Judgeable |
| Zero StackNumbers are pushed onto a ledger and each zero erases the most recent entry, so report the sum of the remaining numbers. | Easy3 | Stack | No attempts yet | 1s | 256 MB | Judgeable |
| Iron BarsGiven a parenthesis string encoding bars and lasers, count the total bar pieces cut by the lasers. | Easy3 | Stack | No attempts yet | 1s | 256 MB | Judgeable |
| StackProcess push, pop, size, empty, and top commands on an integer stack and print each result. | Easy3 | Stack | No attempts yet | 0.5s | 256 MB | Judgeable |
| Simple ArithmeticEvaluate single-digit expressions with usual precedence and floor division, printing WRONG INPUT for bad forms or division by zero. | Easy3 | StackSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Hydraulic ArmDecide whether each given box sequence can reach the right belt in increasing height using one shelf as a stack. | Easy3 | StackSimulation | No attempts yet | 1s | 256 MB | Judgeable |
| Boolean PostfixEvaluate each postfix Boolean formula with AND, OR, XOR, and NOT using a stack and print 1 for true and 0 for false. | Easy3 | Stack | No attempts yet | 1s | 256 MB | Judgeable |
| Padding a bracket stringAdd the fewest opening brackets at the front and closing brackets at the back to turn the given parenthesis string into a correct bracket sequence. | Easy3 | StackGreedy | No attempts yet | 1s | 32 MB | Judgeable |
| Pretty printing arraysReprint the given brace array so each word and brace sits on its own line with two-space indent per nesting level. | Easy3 | StackSimulation | No attempts yet | 1s | 64 MB | Judgeable |
| Resistor CircuitCompute the equivalent resistance of a nested series-parallel resistor circuit described by a bracketed string. | Easy3 | StackMath | No attempts yet | 1s | 64 MB | Judgeable |
| Magicka (Small)Simulate invocations in order, combining the last two list elements when a rule matches and clearing the whole list when opposed elements meet. | Easy3 | SimulationStack | No attempts yet | 5s | 512 MB | Judgeable |
| Magicka Element CombiningInvoke each base element in order, merging the last two entries when they combine and clearing the list when opposed elements meet, then report the final list. | Easy3 | SimulationStack | No attempts yet | 5s | 512 MB | Judgeable |
| Game of ThrownsTrack a token around a circle of children through clockwise or counterclockwise throws, undoing the last m throws on command. | Easy3 | StackSimulation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Star in ParenthesesGiven balanced parentheses with one star, count the matching pairs that enclose the star's position. | Easy3 | StackString+1 | No attempts yet | 2s | 512 MB | Judgeable |
| The Deeper, The BetterGiven a correct bracket string with digits inside, score each digit by the brackets enclosing it and print the highest score. | Easy3 | StackString+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Circuit MathEvaluate a valid postfix boolean circuit over up to 26 variables and print T or F for the given input assignment. | Easy3 | StackString+1 | No attempts yet | 1s | 1024 MB | Judgeable |
| SticksGiven the heights of N sticks in a row, count how many sticks are visible when the row is viewed from the right, where a stick is visible only if it is strictly taller than every stick to its right. | Easy3 | ArrayImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Text EditorSimulate a line editor with cursor movement, character deletion, and insertion commands, printing the final string. | Medium4 | StackSimulation+2 | No attempts yet | 0.3s | 512 MB | Judgeable |
| Decompressed String LengthCompute the total length of a string after fully expanding nested K(Q) compression patterns, where K is a single digit repeat count. | Medium4 | StackString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Stack SequenceDetermine if a target permutation of 1 to n can be produced by a stack pushing values in increasing order, and output the push/pop sequence if possible. | Medium4 | StackSimulation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Postfix NotationConvert a fully parenthesized-or-not infix arithmetic expression with single-letter operands into its postfix notation. | Medium4 | StackString | No attempts yet | 2s | 128 MB | Judgeable |
| Chemical Formula MassParse a chemical formula with nested parentheses and digit multipliers to compute the total atomic mass using H=1, C=12, O=16. | Medium4 | StackString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| TowersFor each tower in a line, find the nearest tower to its left with height at least as large, using a monotonic stack approach. | Medium4 | StackArray | No attempts yet | 1.5s | 128 MB | Judgeable |
| Bracket ValueParse a bracket string with two bracket types and compute its defined nested value, or output 0 if it is invalid. | Medium4 | StackString+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Brainf*ck InterpreterImplement a Brainfsck interpreter that parses a program per test case, checks bracket matching, and executes it printing output or a compile error. | Medium4 | StackSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Make the Largest NumberGiven an N-digit number, remove exactly K digits while keeping relative order to form the largest possible remaining number. | Medium4 | StackGreedy | No attempts yet | 1s | 128 MB | Judgeable |
| Molecular MassParse a nested chemical formula with parentheses and repeat counts, then compute the total molecular mass from atomic weights. | Medium4 | StackRecursion+1 | No attempts yet | 1s | 128 MB | Judgeable |
| A Smart Brain is a Tasty BrainParse each of up to 10000 Boolean expressions, evaluate it, and report whether the brain's given answer matches. | Medium4 | StringStack+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Tree GraftingGiven a depth-first traversal string of an ordered tree, report its height and the height after converting it to a left-child/right-sibling binary tree. | Medium4 | TreeStack+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Stable StringGiven a string of braces, find the minimum number of single-character flips that make all brackets correctly balanced. | Medium4 | StackGreedy+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Web PagesFor each line of HTML-looking text, decide whether every opening tag has a matching closing tag and all tags nest properly. | Medium4 | StackString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Look UpFor each cow, find the smallest index j > i with H_j > H_i, or print 0 if none exists. | Medium4 | StackArray+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Matrix Chain MultiplicationGiven matrices with dimensions and fully parenthesized products, report the elementary multiplication count or an error if dimensions mismatch. | Medium4 | StackRecursion+1 | No attempts yet | 1s | 128 MB | Judgeable |
| From Prefix to PostfixTranslate each prefix arithmetic expression over + and - into its equivalent postfix form, stopping at the terminating 0. | Medium4 | StackTree+2 | No attempts yet | 1s | 128 MB | Judgeable |
| LotteryInsert parentheses into arithmetic expressions so that multiplication is grouped before addition and subtraction, keeping the original spaces. | Medium4 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Chemical ReactionsParse chemical formulas with nested parentheses and multipliers, then compare element counts between the left side and each candidate right side. | Medium4 | StringStack+1 | No attempts yet | 1s | 128 MB | Judgeable |
| BankerSimulate deposits stacked as envelopes and withdrawals taken from the top of the pile, then report the final till and remaining pile totals. | Medium4 | StackSimulation | No attempts yet | 1s | 128 MB | Judgeable |
| Single Digit AdderEvaluate each line as an arithmetic expression of single digits with plus, minus, and parentheses. | Medium4 | StackRecursion | No attempts yet | 1s | 128 MB | Judgeable |
| Uncompressing Compressed WordsExpand each nested compressed word by concatenating its parts and repeating the group n times. | Medium4 | RecursionStack+1 | No attempts yet | 1s | 256 MB | Judgeable |
| ShipuraEvaluate expressions that combine floor division by powers of two with squaring modulo 1,000,000,007 and nested brackets. | Medium4 | StackRecursion+1 | No attempts yet | 8s | 512 MB | Judgeable |
| Robotic EncryptionSimulate a robot that runs nested-loop command lines on a character grid and read the square it stops on after each line to decode the message. | Medium4 | SimulationStack | No attempts yet | 1s | 256 MB | Judgeable |
| Ignore all my comments (Small)Remove every nested /* */ comment block from the document with a single left to right scan and print the rest unchanged. | Medium4 | StackString+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Ignore all my comments (Large)Remove every nested /* */ comment block from the document in a single left-to-right pass and print the remaining text unchanged. | Medium4 | StackString+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Wolves and Proper WordsGiven a word of w, o, l, f, decide whether it is a concatenation of blocks w^n o^n l^n f^n for n >= 1. | Medium4 | StackGreedy | No attempts yet | 2s | 512 MB | Judgeable |
| Battle SimulationRead a monster attack string and output the mech's counters, merging each earliest triple of R, B, L into one C. | Medium4 | StackString+1 | No attempts yet | 2s | 512 MB | Judgeable |
| OvertimeGiven timestamped enter and leave records, count overtime as unmatched leaves plus unmatched enters per name after pairing. | Medium4 | Hash mapStack+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Railway StationDecide for each target permutation whether coaches arriving as 1..N can leave a single dead-end siding in that order. | Medium4 | StackSimulation | No attempts yet | 10s | 512 MB | Judgeable |
| Genius mathematician SeongpilEvaluate a postfix expression of single digits and the operators +, -, *, / with no spaces. | Medium4 | StackImplementation | No attempts yet | 1s | 128 MB | Judgeable |
| Lining UpGiven N lines of 5 people each, decide whether everyone can pass through a single LIFO waiting area in increasing ticket order. | Medium4 | StackSimulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Homework Never Ends!Each minute either adds homework (value A, work time T) or nothing; a new task preempts the current one, and finished tasks are submitted at the minute they finish. Sum the values of tasks completed within N minutes. | Medium4 | StackSimulation+2 | No attempts yet | 2s | 256 MB | Judgeable |
| Parliamentary ProcedureGiven a record of Add and Vote events for 26 parties, decide whether the events can be ordered consistently with a stack-like bill discussion rule. | Medium4 | StackSimulation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Nasty CalculationsEvaluate a postfix arithmetic formula modulo B for up to 100000 given base-B values of x and print only the last digit each time. | Medium5 | StackMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| GoStackSimulate a custom stack-based virtual machine with arithmetic operations and specific division rules, detecting errors and printing results for many inputs. | Medium5 | StackSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| EquationEvaluate a postfix expression containing at most one occurrence of variable X as a linear function a*x+b, then solve a*x+b=0 for x as a reduced fraction, handling no-solution and infinite-solution cases. | Medium5 | StackMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Good WordsA word of A's and B's is good when its letters can be paired by equal letters with non-crossing arcs; count how many of the given words are good. | Medium5 | StackString+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Reverse Roman NotationSimulate a stack calculator where operands are Roman numerals; parse and print them, and handle underflow, division by zero, and out-of-range errors. | Medium5 | ImplementationStack+2 | No attempts yet | 1s | 128 MB | Judgeable |
| KeyloggerA log of typed keys, arrow moves, and backspaces in a text field must be replayed to recover the final password. | Medium5 | Linked listSimulation+1 | No attempts yet | 1s | 256 MB | Judgeable |
| RBY Pop!Change exactly one ball's color, then repeatedly remove any run of 4 or more equal adjacent balls; minimize the number left. | Medium5 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Arranging Go StonesStones are added one by one; each even-indexed stone of a new color replaces the trailing run of the opposite color, and we count the white stones that remain. | Medium5 | StackSimulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Clumsy CowsGiven an even-length string of parentheses, find the minimum number of characters to flip so the string becomes balanced. | Medium5 | GreedyString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Cleaning the DishesSimulate two stacks where each wash or dry command reverses the order of the dishes it moves, then print the final cleaned pile top to bottom. | Medium5 | SimulationStack+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Best ParenthesisGiven a balanced parenthesis string encoded as 0/1 values, compute its recursively defined score modulo 12345678910. | Medium5 | StackRecursion+2 | No attempts yet | 1s | 256 MB | Judgeable |
| FriendsEvaluate set expressions over uppercase letters using union, intersection, and difference, where * binds tighter than + and - and equal operators left-associate. | Medium5 | StringStack+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Parentheses Encoding ConversionGiven the P-sequence encoding of a well-formed parenthesis string, compute its W-sequence encoding. | Medium5 | StackSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Take-outA white block is 'b' and a black block is 'c'. Scan a row of blocks with a stack; whenever the top k+1 blocks hold k white and one black, pop and record them, then print the recorded groups in reverse order. | Medium5 | StackSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| SawmillsGiven a string of g and t points along a line, pair every g with a distinct t using non-crossing north-side arcs so the summed distance is minimal, or report NIE. | Medium5 | GreedyStack+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Triangular MatricesEvaluate a postfix expression over triangular matrices with custom addition and template-match multiplication, or report an invalid expression. | Medium5 | SimulationStack+1 | No attempts yet | 1s | 128 MB | Judgeable |
| CarpetFind the largest area axis-aligned rectangle covering only clear cells in a grid with pillars. | Medium5 | StackMatrix | No attempts yet | 2s | 1024 MB | Judgeable |
| String ExplosionRepeatedly delete every occurrence of the explosion string until none remains, printing FRULA when nothing is left. | Medium5 | StackString matching | No attempts yet | 2s | 128 MB | Judgeable |
| Senior PostmenThe program replays the given stack walk on the street graph and prints each cycle it extracts in order. | Medium5 | SimulationGraph+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Salad BarFind the longest contiguous block of apples and oranges where oranges never fall behind apples when added from either end. | Medium5 | Prefix sumStack+1 | No attempts yet | 3s | 256 MB | Judgeable |
| Preorder TraversalsDecide whether each given number list is the preorder traversal of some binary search tree. | Medium5 | StackTree | No attempts yet | 1s | 256 MB | Judgeable |
| Follower of I 1Sum, over every distinct ordering of the push, add, and multiply cards, the entries in the top K stack positions after evaluating the RPN process. | Medium5 | Brute forceStack+1 | No attempts yet | 3s | 256 MB | Judgeable |
| CensoringRepeatedly delete the first occurrence of T from S, including matches formed by earlier deletions, and print what remains. | Medium5 | String matchingStack | No attempts yet | 1s | 256 MB | Judgeable |
| CensoringRepeatedly delete the first occurrence of pattern T from string S until none remains and print the result. | Medium5 | StackString matching | No attempts yet | 1s | 256 MB | Judgeable |
| Maximal AreaGiven N column heights, find the area of the largest rectangle formed by whole unit squares. | Medium5 | StackArray | No attempts yet | 2s | 256 MB | Judgeable |
| Building a House (Small)Find the area of the largest axis-aligned rectangle containing only grass and shrub cells on each grid map. | Medium5 | StackMatrix | No attempts yet | 5s | 512 MB | Judgeable |
| Doki Doki Snack HandoutGiven a queue of numbered students, check whether they can be passed out in order 1 to N using one last-in-first-out holding spot. | Medium5 | StackSimulation | No attempts yet | 1s | 128 MB | Judgeable |
| Erasing and WinningGiven an N-digit number and D, erase exactly D digits so the remaining digits, in order, form the largest possible number. Multiple test cases until 0 0. | Medium5 | GreedyStack+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Broadcast TowerPlace a tower of height H in a row of buildings; a building west of it receives its signal if no taller building blocks the path. Maximize receivers. | Medium5 | StackArray | No attempts yet | 2s | 512 MB | Judgeable |
| Archers of the Geumgang RangeEach archer's dragon moves right and eats peaks lower than its start until it meets a taller peak; find the largest count any archer can eat. | Medium5 | StackArray+2 | No attempts yet | 2s | 256 MB | Judgeable |
| PPAPDecide whether a length-1000000 string of P and A is generated from P by replacing a P with PPAP at each step. | Medium5 | StackString+1 | No attempts yet | 1s | 512 MB | Judgeable |
| GCC Min Max ExpressionEvaluate an expression containing the <? (min) and >? (max) operators plus + and -, respecting precedence, left associativity, and parentheses. | Medium5 | StackImplementation+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Passport ControlDecide whether a given exit permutation can arise from a FIFO arrival line feeding k desk queues, each holding an arrival-ordered subsequence. | Medium5 | QueueStack+2 | No attempts yet | 0.2s | 512 MB | Judgeable |