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 results1,789 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| RunesFind the smallest digit that replaces every question mark so the addition, subtraction, or multiplication equation holds. | Medium4 | Brute forceString+1 | No attempts yet | 5s | 256 MB | Judgeable |
| Ambiguous EncodingsCount how many letter strings map to each digit string when A is 1 through Z at 26. | Medium4 | Dynamic programmingString | No attempts yet | 1s | 256 MB | Judgeable |
| Exact a to the power bPrint the exact value of a to the power b for a decimal base without rounding or dropping digits. | Medium4 | ImplementationMath+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Shortest string containing bothFind the length of the shortest string that has both given strings as subsequences. | Medium4 | Dynamic programmingString | No attempts yet | 1s | 256 MB | Judgeable |
| Talking MoneyConvert one currency amount from -$999999999999.99 to $999999999999.99 into English words under the given hyphen, and-placement, and plural rules. | Medium4 | ImplementationString | No attempts yet | 2s | 256 MB | Judgeable |
| Decimal to FractionConvert a decimal with an optional parenthesized repeating part into its irreducible numerator/denominator form. | Medium4 | MathNumber theory+1 | No attempts yet | 2s | 256 MB | Judgeable |
| RATS sequenceSimulate up to 60 RATS steps per data set and report the first creeper term, the first repeated term, or the last term. | Medium4 | SimulationString+1 | No attempts yet | 1s | 256 MB | Judgeable |
| MultigramDecide whether the word splits into two or more equal anagram blocks and print the shortest such block, or -1. | Medium4 | StringHash map | No attempts yet | 1s | 64 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 |
| Recycled Numbers (Small)Count pairs (n, m) in [A, B] with equal digits where m is a rotation of n with no leading zero. | Medium4 | Brute forceString | No attempts yet | 5s | 512 MB | Judgeable |
| Irregular Expressions (Small)Decide if any substring of each short lowercase string splits into matching outer words with two or more vowels around a middle word with at least one vowel. | Medium4 | Brute forceString | No attempts yet | 5s | 512 MB | Judgeable |
| Welcome to Code Jam (Small)Count how many ways the 19-character phrase "welcome to code jam" appears as a subsequence of the input line, and print the last four digits. | Medium4 | Dynamic programmingString | No attempts yet | 5s | 512 MB | Judgeable |
| Bit Friendship IndexGiven two equal-length binary strings, find the minimum number of digit changes and character swaps to make them identical. | Medium4 | StringGreedy+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Infinite stringGiven two strings of length at most 50, decide whether each repeated infinitely produces the same infinite string. | Medium4 | StringString matching | No attempts yet | 2s | 512 MB | Judgeable |
| DNA PasswordCount the length-|P| substrings of a DNA string that contain at least the required number of each of A, C, G, and T. | Medium4 | Sliding windowString+2 | No attempts yet | 2s | 512 MB | Judgeable |
| AB StringFind the length-N A/B string whose number of (A before B) pairs equals K, choosing the lexicographically smallest such string. | Medium4 | GreedyCombinatorics+1 | No attempts yet | 2s | 512 MB | Judgeable |
| North North WestA direction string is built from copies of north and west; each prefix copy shifts the angle by 90/2^n, so compute the resulting angle as an integer or reduced fraction. | Medium4 | MathString+2 | No attempts yet | 8s | 512 MB | Judgeable |
| Random Number CheckFor each of N numbers decide whether no digit repeats four times in a row and every divisor greater than 1 exceeds K. | Medium4 | MathNumber theory+2 | No attempts yet | 1s | 64 MB | Judgeable |
| Roman numeral conversionFor each of T inputs, convert a Roman numeral to its value in Arabic numerals or an Arabic numeral between 1 and 3999 to its Roman form. | Medium4 | StringImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Prefix ArraySort all prefixes of a string lexicographically and print the end index of each prefix in that order. | Medium4 | SortingString+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Card StringGiven uppercase letters taken left to right, each new card is placed at the front or back of the growing string; find the lexicographically smallest result. | Medium4 | GreedyString+2 | No attempts yet | 1s | 256 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 |
| SonnetsFor each poem, reduce every line to the vowel sequence after its last stressed syllable and label lines by first occurrence to build a rhyme scheme. | Medium4 | StringHash map+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Fridge MagnetsGiven a multiset of digit magnets, find the smallest positive integer that cannot be assembled from them, where the answer can exceed 64-bit range. | Medium4 | GreedyMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Periodic StringsGiven a string, find the smallest k such that cutting it into blocks of length k makes each block a one-step rotation of the previous block. | Medium4 | StringBrute force+2 | No attempts yet | 2s | 512 MB | Judgeable |
| PalindromesFor each string, find the leftmost single-character deletion that leaves a palindrome, or report that none exists. | Medium4 | StringTwo pointers+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Appearance AnalysisGiven a grid of brick separators and windows, count how many distinct window designs exist, where rotations by multiples of 90 degrees count as the same design. | Medium4 | ImplementationMatrix+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Hidden PalindromeGiven a word of at most 40 lowercase letters, find the longest palindromic subsequence obtainable by deleting letters from the front and back. | Medium4 | Dynamic programmingString+2 | No attempts yet | 2s | 512 MB | Judgeable |
| R9KRemove known nicknames and collapse whitespace in each message, then report whether the resulting text has appeared before. | Medium4 | StringHash map+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Close Match (Small)Fill in the question marks in two equal-length digit strings to minimize the absolute difference between the values, breaking ties by minimizing the first then the second. | Medium4 | Brute forceImplementation+2 | No attempts yet | 5s | 512 MB | Judgeable |
| The Last Word (Large)Insert each letter of S at the front or back of the growing word so the final string is as large as possible lexicographically. | Medium4 | GreedyString+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Revenge of the Pancakes (Small)Given a stack of pancakes as a + and - string, find the fewest top-prefix flips that make every pancake happy side up. | Medium4 | GreedyString | No attempts yet | 5s | 512 MB | Judgeable |
| Revenge of the Pancakes (Large)Given a stack of pancakes as a string of + and -, find the minimum number of top-prefix flips needed to make every pancake show its happy side. | Medium4 | GreedyString+1 | No attempts yet | 5s | 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 |
| Yin and Yang StonesGiven a circular string of black and white stones, decide whether repeated merges can reduce it to one black and one white stone. | Medium4 | StringGreedy+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Bovine Genomics (Silver)Count triples of genome positions where no spotty cow and plain cow share the same three characters. | Medium4 | Brute forceHash map+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Secret Chamber at Mount RushmoreGiven directed letter translations, decide for each pair of words whether every letter of the first can reach the matching letter of the second. | Medium4 | GraphDFS+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Party GamesFor each test case, find the shortest string that splits the sorted guest names into two equal halves, choosing the alphabetically first if several have that length. | Medium4 | StringSorting+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Almost Identical ProgramsGiven two program strings, decide whether they are identical, differ only in one string literal at the same position, or are otherwise different. | Medium4 | StringImplementation+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Clever TitleFor each uppercase word, count how many orderings of the n author names let you pick one uppercase letter from each name, left to right, to spell the word. | Medium4 | BacktrackingBrute force+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Programming ExamFor each query, decide whether two given substrings of S are anagrams, printing DA or NE. | Medium4 | Prefix sumHash map+1 | No attempts yet | 3s | 128 MB | Judgeable |
| Big Integer A+BRead two integers up to 10^10000 in magnitude and print their sum without using built-in big integer support. | Medium4 | ImplementationString+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Binary CountingGenerate the binary representation of each non-negative integer in order, concatenate the digits, and print every n-th digit starting at position k (five of them). | Medium4 | ImplementationMath+2 | No attempts yet | 1s | 32 MB | Judgeable |
| Human-Computer InteractionCount how often a given lowercase letter appears inside each query interval [l, r] of a fixed string S, answering up to 200,000 queries. | Medium4 | Prefix sumArray+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Repetitive PalindromeGiven a lowercase string s and integer k, decide if t formed by concatenating k copies of s is a palindrome. | Medium4 | StringMath+1 | No attempts yet | 1s | 1024 MB | Judgeable |
| Make the Largest NumberGiven up to 1000 non-negative integers, order the pieces so their concatenation is the largest possible number, and print it without leading zeros. | Medium4 | GreedySorting+1 | No attempts yet | 2s | 512 MB | Judgeable |
| String DiscriminationGiven a target string S and up to 100 words, decide whether S is a concatenation of words from the list, each reusable any number of times. | Medium4 | Dynamic programmingString+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Rational RatioConvert a decimal with a repeating rightmost digit block into a fully reduced fraction formed by integer subtraction. | Medium4 | MathNumber theory+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Devil GameFind a dictionary word containing the original word as a subsequence and maximize mood-killing degree per inserted letter, breaking ties by input order. | Medium4 | StringTwo pointers+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Digits Are Not Just CharactersCompare each name with s0 by splitting into letter and number items, then output "-" if it sorts before s0 or "+" otherwise. | Medium4 | StringSorting+1 | No attempts yet | 2s | 512 MB | Judgeable |
| GuruGuruCount disjoint substrings of an L/R command string that complete one full clockwise rotation from north with the required non-north directions visited. | Medium4 | StringGreedy+1 | No attempts yet | 2s | 512 MB | Judgeable |
| An I for an EyeApply a fixed table of text abbreviations to each line, scanning left to right and always taking the longest match at a position, with case handling. | Medium4 | StringSimulation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| SubtitlesParse a partial SRT file, add a given number of milliseconds to every timestamp, and reprint the blocks in the same format. | Medium4 | StringImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Cipher DecoderCheck whether the multiset of integers in the ciphertext matches the multiset of character codes of the given plaintext. | Medium4 | Hash mapSorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Jinwoo's PasswordGiven N and a lowercase password of length at most N, find its 1-based position among all strings of length 1 to N in lexicographic order. | Medium4 | StringMath+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Magician Nam JeonghunApply a sequence of up to 10 million suit-changing and rotation commands to 26 cards, printing the arrangement whenever a show command appears. | Medium4 | ImplementationString+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Making a PasswordGiven two uppercase strings, find the longest substring that appears in both strings; the answer is unique. | Medium4 | StringBrute force+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Taebo Taebo Punch BarrageReads an ASCII art scene of a face with fist afterimages and counts how many remain on the left and right sides. | Medium4 | StringImplementation | No attempts yet | 1s | 256 MB | Judgeable |
| EnigmaImplement a simplified Enigma machine whose two rotors advance together after each letter, and decrypt the given uppercase ciphertext using the rotor setting CHICKENS. | Medium4 | SimulationImplementation+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 |
| Jung's RestaurantDecide whether a customer's order satisfies the restaurant rules: special items need 20000+ in regular items, service items need 50000+ combined and at most one. | Medium4 | Hash mapImplementation+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Last WordGiven a string and a sequence of substring(start, length) operations, output the characters that survive after all operations are applied in order. | Medium4 | StringSimulation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| GPAGiven a catalog of courses with units, major requirements, and each student's grades, print each student's overall GPA and the GPA for every major whose requirements they completed. | Medium4 | Hash mapString+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Make America Grade AgainGiven category weights and a list of graded assignments, sum points per category, weight each fraction, and print the truncated final grade. | Medium4 | MathImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Problem ClassificationCount exact whole-word occurrences of each category's keywords in a statement, then print the categories with the highest total count in lexicographic order. | Medium4 | Hash mapString+2 | No attempts yet | 1s | 512 MB | Judgeable |
| ABBGiven a string of colors, find how many characters must be appended at the end so the resulting string becomes a palindrome. | Medium4 | StringString matching+2 | No attempts yet | 2s | 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 |
| Where Am I?Given a string of N mailbox colors, find the smallest K such that all length-K substrings are distinct. The answer is always at most N. | Medium4 | StringBrute force+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Valid EmailsNormalize each email by its rules, count how many are valid and distinct. | Medium4 | StringHash map+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Mad ScientistGiven two strings A and B of H and G, find the minimum number of substring flips (toggling all characters) needed to turn B into A. | Medium4 | GreedyString+2 | No attempts yet | 2s | 512 MB | Judgeable |
| RepetitionGiven a lowercase string S, find the smallest K such that S is a subsequence of the alphabet repeated K times. | Medium4 | GreedyString+1 | No attempts yet | 1s | 256 MB | Judgeable |
| Cyber Opening CeremonyGiven start, end, and stream-end times plus chat logs, count members who chatted at or before the start and again between the end and stream-end. | Medium4 | Hash mapImplementation+2 | No attempts yet | 1s | 1024 MB | Judgeable |
| Checking Answers to TestGiven the correct answers and each student's answers, find every pair of students whose correct and incorrect answers each match on more than half of the questions. | Medium4 | Brute forceImplementation+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Hamburger DistributionAlong a line of N positions holding people and hamburgers, each person can eat a hamburger within distance K; find the maximum number of people served. | Medium4 | GreedyTwo pointers+2 | No attempts yet | 0.5s | 256 MB | Judgeable |
| LampsGiven an N by M lamp grid where pressing a column switch exactly K times total flips columns, find the max number of rows that end up fully lit. | Medium5 | Hash mapString+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Base-36 NumberPick K base-36 digit symbols to replace with Z across N numbers so their sum is maximized, then output that sum in base 36. | Medium5 | GreedyMath+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Digit SwapGiven N and exactly K digit swaps that must never leave a leading zero, find the maximum resulting number or report -1 if impossible. | Medium5 | BFSBrute force+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Tower Floor DisplayGiven an N-digit floor number shown on a lamp display where off lamps may be broken, compute the average of every floor number consistent with the lit lamps. | Medium5 | MathCombinatorics+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Unknown SentencePartition a sentence into segments that are anagrams of given words, minimizing total letters moved from their original word positions. | Medium5 | Dynamic programmingString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Digit 8Given L and R up to 2*10^9, find the minimum number of times digit 8 appears in any integer within [L, R]. | Medium5 | MathGreedy+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Maximum SumAssign digits 0-9 to letters A-J that encode N numbers so that the sum of the numbers is maximized while no number has a leading zero. | Medium5 | GreedyMath+2 | No attempts yet | 2s | 128 MB | Judgeable |
| PrefixGiven up to 50 words, find the largest subset where no word is a prefix of another, using a trie and tree DP. | Medium5 | TrieDynamic programming+2 | No attempts yet | 2s | 128 MB | Judgeable |
| AdvertisementGiven the L characters currently visible on a scrolling sign showing an infinitely repeated text, find the minimum possible length of the original advertisement text. | Medium5 | String matchingString | No attempts yet | 2s | 128 MB | Judgeable |
| Two String MasksGiven two strings each containing one asterisk, find the shortest string obtainable by replacing the asterisks with (possibly empty) letter strings so both become equal, or report impossible. | Medium5 | StringSimulation+2 | No attempts yet | 2s | 128 MB | Judgeable |
| UnderscoresInsert underscores between N given words (counts differing by at most 1) to reach total length M, and output the lexicographically smallest resulting string under a custom character order. | Medium5 | GreedyString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Make a Periodic StringGiven a DNA string and a bound M, find the minimum number of character edits to make the string periodic with some period length at most M. | Medium5 | StringGreedy+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Substring Picking GamePlayers alternately subtract a value formed by a proper substring of the current number's digits, and you must find the smallest first move that forces a win, or -1 if none exists. | Medium5 | Game theoryDynamic programming+2 | No attempts yet | 2s | 256 MB | Judgeable |
| String ExchangeGiven a circular string of a's and b's, find the minimum number of swaps to make all a's form one consecutive block. | Medium5 | Sliding windowString+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Making a PalindromeFind the minimum number of integers to insert into a sequence so it becomes a palindrome, using interval or LCS-based dynamic programming. | Medium5 | Dynamic programmingArray+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Text FormalizationExpand every contraction and the first occurrence of each acronym in a text, following case rules and leftmost-earliest matching priority. | Medium5 | StringString matching+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Word ExtensionGiven a dictionary and a starting 3-letter word, find the longest word reachable by repeatedly inserting one letter such that each intermediate word exists in the dictionary. | Medium5 | Dynamic programmingString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Removing ParenthesesGiven an arithmetic expression with letters and +,-,*,/,() parse it and print an equivalent expression using the fewest parentheses, applying sign/operator flips when parentheses are removed. | Medium5 | RecursionString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Similar WordsGiven up to 20,000 distinct words, find the pair with the longest common prefix, breaking ties by input order. | Medium5 | StringSorting+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Letter BoardCount the number of paths on an N by M letter grid that spell a given word, moving 1 to K cells in one straight direction per step. | Medium5 | Dynamic programmingMatrix+1 | No attempts yet | 2s | 128 MB | Judgeable |
| String CopyFind the minimum number of substring-copy operations from S needed to reconstruct P using greedy/DP over matching positions. | Medium5 | Dynamic programmingString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Fax CompressionChoose a quantization of a sequence into 4 levels with run-length style bit encoding to minimize error plus weighted code length. | Medium5 | Dynamic programmingString+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Crossing the Stone BridgesCount ways to match a scroll string to positions across two parallel bridge strings, alternating bridges and strictly increasing positions. | Medium5 | Dynamic programmingString | No attempts yet | 1s | 128 MB | Judgeable |
| Submarine IdentificationDecide whether a binary string can be split into pieces of '01' or '1' followed by at least two 0s and at least one 1, using pattern matching or DP. | Medium5 | Dynamic programmingString matching+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 |