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 results907 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| RIPEMD-160Compute the RIPEMD-160 hash of an alphanumeric string of length at most 50 and print it as 40 lowercase hexadecimal digits. | Medium4 | ImplementationBit manipulation | No attempts yet | 1s | 256 MB | Judgeable |
| SHA-1 HashPrint the SHA-1 hash of the given alphanumeric string as lowercase hexadecimal. | Medium4 | ImplementationBit manipulation | No attempts yet | 1s | 256 MB | Judgeable |
| CivilizationPick the smallest subset of at most 18 regions whose total workforce, tax income, and farm count all reach the required thresholds, or print game over. | Medium4 | Brute forceBit manipulation | No attempts yet | 1s | 256 MB | Judgeable |
| 2-SAT AssignmentDetermine whether a 2-CNF formula with up to 20 variables is satisfiable and output the lexicographically smallest satisfying assignment. | Medium4 | Brute forceBit manipulation | No attempts yet | 1s | 256 MB | Judgeable |
| Longest Prefix MatchGiven X bit prefixes with ids and Y destination addresses, print the id of the longest matching prefix for each address or -1. | Medium4 | TrieBit manipulation | No attempts yet | 1s | 256 MB | Judgeable |
| Geppetto's PizzaCount the subsets of up to 20 ingredients that contain none of the given incompatible pairs, including the empty pizza. | Medium4 | Brute forceBit manipulation | No attempts yet | 1s | 64 MB | Judgeable |
| Death StarRecover the lexicographically smallest sequence whose pairwise bitwise AND values match the given off-diagonal matrix. | Medium4 | Bit manipulation | No attempts yet | 1s | 256 MB | Judgeable |
| Nim Game 2Two players alternately remove stones from one of N piles and the player taking the last stone wins, so decide the winner under optimal play. | Medium4 | Game theoryBit manipulation | No attempts yet | 2s | 512 MB | Judgeable |
| English and French (Small)Assign each unknown sentence to English or French so the number of words appearing in both languages is as small as possible. | Medium4 | Brute forceBit manipulation+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Noisy NeighborsPlace N tenants on an R by C grid to minimize the number of shared walls between occupied neighbors. | Medium4 | Brute forceBit manipulation | No attempts yet | 5s | 512 MB | Judgeable |
| EnclosurePlace the fewest stones on an N by M grid of at most 20 cells so at least K points are cut off from the border. | Medium4 | Brute forceBFS+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Charging Chaos (Small)Find the fewest bit positions to flip so the outlet strings match the device strings after reordering. | Medium4 | Brute forceBit manipulation+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Snapper Chain (Large)You daisy-chain N snappers that toggle when powered and report whether the bulb at the end is lit after K snaps. | Medium4 | Bit manipulationMath | No attempts yet | 5s | 512 MB | Judgeable |
| Snapper ChainGiven N chained snappers acting as a binary counter and K snaps, decide whether the lamp on the last snapper receives power. | Medium4 | Bit manipulationMath | No attempts yet | 5s | 512 MB | Judgeable |
| Odd Man OutGiven an odd-length list where every number appears twice except one, find the number that appears once. | Medium4 | Bit manipulationHash map | No attempts yet | 5s | 512 MB | Judgeable |
| Idempotent FilterGiven a 128-bit lookup table describing a hexagonal cellular automaton filter, decide whether applying the filter twice always equals applying it once. | Medium4 | SimulationBrute force+2 | No attempts yet | 8s | 512 MB | Judgeable |
| Fast ExponentiationCompute A raised to the power X modulo 1,000,000,007, where A and X can be up to 10^18. | Medium4 | MathBit manipulation+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Harps and TailsFlip any subset of columns of an H/T grid; find the maximum number of rows that can be made all-H. | Medium4 | Hash mapGreedy+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Remove DuplicatesRead a space-separated list whose length is not given, keep each value only at its first occurrence, and print the surviving values in order. | Medium4 | Hash mapArray+2 | No attempts yet | 5s | 8 MB | Judgeable |
| Boolean Product of Boolean MatricesCompute the Boolean product of two N by N 0/1 matrices and count how many entries in the result are 1. | Medium4 | MatrixBrute force+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Byte Me!Given N data bytes and a parity byte, find the parity type, the one data byte with wrong popcount parity, and the flipped bit position. | Medium4 | Bit manipulationImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Wizard of OddsGiven N possible secret numbers and K yes/no questions, decide whether K adaptive questions always identify the number, where K questions distinguish at most 2^K outcomes. | Medium4 | MathBinary search+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Trains crossing the Milky WaySimulate four seat operations across N trains, then count how many trains have a seating state that appears for the first time. | Medium4 | SimulationHash map+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Zebras and OcelotsGiven a stack of zebras and ocelots, each bell ring flips the lowest ocelot and all zebras beneath it; count rings until no ocelots remain. | Medium4 | Bit manipulationMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Generic QueriesGiven an array and range queries, compute each interval XOR and output the XOR of all answers mixed with the given k values. | Medium4 | Prefix sumBit manipulation+2 | No attempts yet | 2.5s | 512 MB | Judgeable |
| Wonyoung Wants to Stay with ZOAC ForeverFor each t from 1 to N, the number of participants is the largest power of two dividing 2t; find the sum over all t. | Medium4 | MathNumber theory+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Bit OverflowGiven an N-digit binary number K, count how many times the operation K = K - (K & ((~K)+1)) can be applied before K becomes 0. | Medium4 | Bit manipulationMath+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Bus LogicGiven a starting stop and bus routes as bit strings of length s, find the maximum number of other stops reachable by choosing exactly one bus that serves the starting stop. | Medium4 | Bit manipulationImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Umm CodeConcatenate u and m characters from words made only of u, m, and punctuation, then decode each 7-bit chunk as ASCII. | Medium4 | StringImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Water BottlesGiven N one-liter bottles and capacity K, find the minimum number of extra one-liter bottles so that merging equal amounts leaves at most K non-empty bottles. | Medium5 | MathGreedy+1 | No attempts yet | 1s | 512 MB | Judgeable |
| X and KGiven X and K, find the K-th smallest positive integer Y such that X+Y equals X OR Y, which requires placing K's bits into the zero-bit positions of X. | Medium5 | Bit manipulationMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Traveling Salesperson TourFind the minimum cost Hamiltonian cycle in a directed graph with up to 16 cities using bitmask dynamic programming. | Medium5 | Dynamic programmingBit manipulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Final Team MatchGiven up to 1000 students each mastering a subset of at most 15 problem types, find the largest group whose combined skill set covers at most K types. | Medium5 | Bit manipulationBrute force+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Height OrderGiven pairwise shorter-than relations between students, count how many students have their exact height rank fully determined by transitivity. | Medium5 | GraphDFS+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Building EDSAC InstructionsConvert a decimal fraction into two's-complement binary and print it as an EDSAC assembly instruction, rounding toward zero and detecting out-of-range values. | Medium5 | Bit manipulationString+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Remove ParenthesesGiven an expression with up to 10 matching parenthesis pairs, output every distinct string formed by removing one or more full pairs, sorted lexicographically. | Medium5 | StringBit manipulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Counting Sanggeun's Digit FriendsGiven up to a million large integers, count pairs that share at least one decimal digit, requiring bitmask digit sets and efficient counting over 1024 subsets. | Medium5 | Bit manipulationCombinatorics+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Truth-Tellers and LiarsCount all ways to label N people as truth-tellers or liars so that every statement matches the truth-and-lies rule. | Medium5 | Brute forceBit manipulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Friends Calling PlanGiven call minutes between up to 16 employees, pair them all up to minimize total billing cost using bitmask DP over perfect matchings. | Medium5 | Dynamic programmingBit manipulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| MisLEDGiven two observed 7-segment displays with the same unknown burnt-out segments, find the second observed time in 12-hour format. | Medium5 | Brute forceBit manipulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| The Turn of the ShrewEach child's code must differ from the bitwise OR of some male and female adult code; find the minimum Hamming distance over all pairs. | Medium5 | Bit manipulationBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Going to the MoviesGiven M movies each covering a subset of P preferences, find the smallest number of movies whose coverage includes all P preferences. | Medium5 | Bit manipulationBrute force+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Problem-Free Problem SetGiven N problems, each covering some of M required algorithms, find the smallest subset of problems covering all M algorithms, breaking ties by lexicographic order of problem names. | Medium5 | Bit manipulationBrute force+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Bad WiringEach switch toggles a window of 2D+1 lights; find the fewest flips that turn every light off, or report impossibility. | Medium5 | GreedyBit manipulation | No attempts yet | 3s | 128 MB | Judgeable |
| Cow IDsFind the N-th smallest binary number that has exactly K one-bits and no leading zeros, then print it in binary. | Medium5 | CombinatoricsMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Escaping the FarmAmong up to 20 cow weights, find the largest subset whose base-10 sum produces no carry in any digit position. | Medium5 | Bit manipulationBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Hexadecimal to Octal ConversionConvert a hexadecimal number of up to 100,000 digits into its octal form with no leading zeros, using binary as the intermediate step. | Medium5 | StringMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Extended Lights OutGiven a 5 by 6 Lights Out board, find the unique set of button presses that turns every light off, then print the press grid. | Medium5 | Brute forceBit manipulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| In DangerGiven n people in a circle where every second person is eliminated starting from person 1, report the final surviving position; n arrives encoded as xyez. | Medium5 | MathRecursion+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Quad TreeDecode a quad tree string into an n by n black and white image, then print each row as XBM hexadecimal bytes. | Medium5 | RecursionDivide and conquer+2 | No attempts yet | 1s | 128 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 |
| Pattern GeneratorFor each (n, k) pair, print all n-bit strings with exactly k ones in decreasing numeric order, separated by blank lines. | Medium5 | BacktrackingRecursion+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Betting SetsPartition an N by M table of probabilities into groups of one cell per column to maximize the expected number of all-heads groups. | Medium5 | Dynamic programmingBit manipulation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| NimGiven a Nim position, count how many single-pile moves lead to a losing position (XOR of the remaining piles equals zero). | Medium5 | Game theoryBit manipulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| PassageSplit n people into groups whose total weight is at most W, minimizing the sum of each group's slowest crossing time. | Medium5 | Dynamic programmingBit manipulation+1 | No attempts yet | 3s | 128 MB | Judgeable |
| ATMsFor each amount under 10^30, find a subset of the 100 ATMs whose signed sum equals the amount and another equal to its negation. | Medium5 | Bit manipulationGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| MatchesGiven m match lineups that each split n boys into two teams, decide whether every pair of boys is separated at least once. | Medium5 | Bit manipulationCombinatorics+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Logarithmic PaprikaGiven counts of paprika weighing 1, 2, 4, ..., 2^k grams, find the smallest positive weight that cannot be formed from whole pieces. | Medium5 | GreedyMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Balls in a Binary TreeFollow the n-th ball down h levels of toggling switches, going left on odd visits and right on even visits, to find its leaf number. | Medium5 | Bit manipulationSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Binary SumGiven k, print in binary the sum of all integers from 1 to the largest k-digit binary number. | Medium5 | MathBit manipulation | No attempts yet | 1s | 128 MB | Judgeable |
| BoardsFrom the smallest power of two at least K, find the fewest board halvings so some pieces sum to exactly K. | Medium5 | Bit manipulationGreedy | No attempts yet | 1s | 128 MB | Judgeable |
| Social AdvertisingPick the fewest users so that every user is picked or is a friend of someone picked. | Medium5 | Brute forceBit manipulation+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Counting Ones in a RangeAdd up the number of 1 bits in the binary form of every integer from A to B. | Medium5 | Bit manipulationMath | No attempts yet | 1s | 128 MB | Judgeable |
| N-QueenCount the ways to place N non-attacking queens on an N by N board for N under 15. | Medium5 | BacktrackingBit manipulation | No attempts yet | 10s | 128 MB | Judgeable |
| One Move from Towers of HanoiGiven n disks and an index k, report the disk and the source and destination posts of the kth move in the classic recursive Hanoi solution. | Medium5 | RecursionBit manipulation+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Removing pieces so none attackRemove the fewest chess pieces from each board of up to 15 pieces so no two remaining pieces attack each other. | Medium5 | Brute forceGraph+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ShopsPick cells with no shared side in an N by 5 profit grid to maximize the summed profit. | Medium5 | Dynamic programmingBit manipulation | No attempts yet | 2s | 256 MB | Judgeable |
| Floating-Point Format ConversionConvert each 8-digit hex Gould floating-point value to its IEEE 754 single-precision hex form with truncation and overflow rules. | Medium5 | Bit manipulationMath+1 | No attempts yet | 1s | 256 MB | Judgeable |
| NicolePick at least two locations with no hearing pair among them to maximize total satisfaction. | Medium5 | Brute forceBit manipulation+1 | No attempts yet | 1s | 256 MB | Judgeable |
| XOR TriplesChoose the largest subset of 1 to N with no three distinct values xoring to zero, breaking ties by smallest lexicographic order. | Medium5 | Brute forceBit manipulation | No attempts yet | 5s | 256 MB | Judgeable |
| Traveling Salesman Tour 2Find the cheapest tour that starts at one city, visits each of N cities exactly once, and returns to the start using the given directed costs. | Medium5 | Dynamic programmingBit manipulation+1 | No attempts yet | 2s | 256 MB | Judgeable |
| The Sorting HatFind the department of student n by counting the set bits in n-1 and taking the remainder modulo p. | Medium5 | Bit manipulationMath | No attempts yet | 1s | 256 MB | Judgeable |
| Base-2 PalindromesFind the M-th positive integer whose binary representation reads the same forward and backward and print it in decimal. | Medium5 | Bit manipulationMath | No attempts yet | 1s | 256 MB | Judgeable |
| Atomic ComputerCount the length-y signed-binary strings over -1, 0 and 1 whose digits weighted by powers of two sum to x. | Medium5 | Dynamic programmingBit manipulation | No attempts yet | 1s | 256 MB | Judgeable |
| A Rational SequenceGiven a reduced fraction p/q from the Calkin-Wilf tree, compute its position n in breadth-first order. | Medium5 | MathTree+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Pyro TubesFor each value in a sorted list, count larger list values whose 18-bit patterns differ in at most two bits. | Medium5 | Bit manipulationHash map | No attempts yet | 13s | 256 MB | Judgeable |
| Sheldon NumbersCount numbers between X and Y whose binary form starts with ones and alternates blocks of N ones and M zeros. | Medium5 | Brute forceBit manipulation+1 | No attempts yet | 1s | 256 MB | Judgeable |
| DeceptionYou divide the numbers into two nonempty groups with equal XOR to make the first group's sum as large as possible. | Medium5 | Bit manipulationGreedy | No attempts yet | 1s | 256 MB | Judgeable |
| Robot Rock Band (Large)Count quadruples with one element from each of four lists whose bitwise XOR equals K. | Medium5 | Hash mapBit manipulation | No attempts yet | 7s | 512 MB | Judgeable |
| Not So RandomFeed X through N stages that each apply bitwise AND, OR, or XOR with K at given probabilities and report the expected final value. | Medium5 | ProbabilityBit manipulation+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Not So Random (Large)N machines each apply AND, OR, or XOR with K at given probabilities, and the expected output after chaining them must be computed. | Medium5 | Bit manipulationProbability+1 | No attempts yet | 10s | 512 MB | Judgeable |
| Googol String (Large)Answer the Kth character of a recursively defined binary string for each query with K up to 10^18. | Medium5 | RecursionBit manipulation | No attempts yet | 5s | 512 MB | Judgeable |
| Broken Seven-segment DisplayFrom N consecutive seven-segment readings with unknown start digit and dead segments, infer the next reading, or print ERROR when consistent readings disagree. | Medium5 | Brute forceBit manipulation | No attempts yet | 5s | 512 MB | Judgeable |
| Broken Seven-segment DisplayFrom N recorded seven-segment states of a countdown with unknown start digit and stuck-off segments, find the single possible next state or report ERROR!. | Medium5 | Brute forceBit manipulation+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Part Elf (Large)Given a claimed elf fraction P/Q, decide whether 40 generations of averaging can produce it and report the closest possible generation of a full elf ancestor. | Medium5 | Number theoryMath+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Bit Count (Small)Given N, split it into nonnegative a and b with a plus b equal to N to maximize the total count of 1 bits in a and b. | Medium5 | Bit manipulationDynamic programming | No attempts yet | 5s | 512 MB | Judgeable |
| Bit Count (Large)For each N, choose nonnegative a and b with a plus b equal to N to maximize the total number of 1 bits in a and b. | Medium5 | Bit manipulationGreedy | No attempts yet | 5s | 512 MB | Judgeable |
| Candy SplittingDivide the candies into two nonempty piles that look equal under addition without carries and keep the largest possible true sum for yourself. | Medium5 | Bit manipulationGreedy | No attempts yet | 5s | 512 MB | Judgeable |
| Candy Splitting (Large)Split the candies into two nonempty piles with equal xor totals and keep the pile with the largest ordinary sum. | Medium5 | Bit manipulationGreedy | No attempts yet | 5s | 512 MB | Judgeable |
| Snapper Chain (Large)After K snaps on a chain of N toggling snappers, decide whether power reaches the light plugged into the last one. | Medium5 | Bit manipulationMath | No attempts yet | 5s | 512 MB | Judgeable |
| Double and AddStarting from an all-zero array, find the minimum number of single-element increments and whole-array doublings that produce the target array B. | Medium5 | GreedyBit manipulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Palindromic substringsCount length-N uppercase strings whose length-M substrings include at least K palindromes. | Medium5 | Brute forceString+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Movement 3Decide whether (x, y) is reachable by moving 3^k right or up on each step k, starting at the origin. | Medium5 | MathBit manipulation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Powers of Three WalkGiven a target point, decide whether it is reachable if stage k moves exactly 3^k in one of the four axis directions. | Medium5 | MathNumber theory+1 | No attempts yet | 2s | 512 MB | Judgeable |
| LoteriaDecide whether K target parities can be chosen so that no non-empty subset of the given rows has column sums matching all of them. | Medium5 | MathBit manipulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Block GameFor each letter, find the minimum number of blocks needed so any choice of one word per board can be spelled at once. | Medium5 | Brute forceBit manipulation | No attempts yet | 2s | 512 MB | Judgeable |
| Paper PiecesCut an N x M digit grid into horizontal or vertical strips and maximize the sum of the numbers those strips form. | Medium5 | Brute forceBit manipulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Integer SequenceGiven x, y, the last two digits of A0 and A1, and a large index n, print the last two digits of An where An = x*An-1 + y*An-2. | Medium5 | MathDynamic programming+2 | No attempts yet | 0.25s | 512 MB | Judgeable |
| Hamming distance queriesGiven binary strings a and b, answer queries asking for the Hamming distance between a substring of a and a substring of b. | Medium5 | Prefix sumString+2 | No attempts yet | 6s | 512 MB | Judgeable |
| Birthday CakeGiven up to 50 candle points and up to 15 cuts, decide whether the cuts carve the cake so that every resulting piece holds exactly one candle. | Medium5 | GeometryBit manipulation+2 | No attempts yet | 2s | 512 MB | Judgeable |