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 results14,366 problems
TopicsJudge
It's Cold Here!Read city names with integer temperatures, one per line, and print the name of the city with the lowest temperature.Easy2ImplementationArray+2No attempts yet1s128 MBJudgeable
Who is in the middle?Given the weights of three bowls, print the middle value among the three weights.Easy2SortingImplementationNo attempts yet1s128 MBJudgeable
I Speak TXTMSGRead lines until TTYL, map each known short form through a fixed table, and echo other lines unchanged.Easy2Hash mapString+1No attempts yet1s128 MBJudgeable
Deal or No Deal CalculatorRead eliminated case numbers and a Banker's offer, compute the average of the remaining amounts, and print deal if the offer is higher, otherwise no deal.Easy2ImplementationArray+1No attempts yet1s128 MBJudgeable
Anagram CheckerDecide whether two phrases are anagrams, ignoring spaces and letters only.Easy2Hash mapString+1No attempts yet1s128 MBJudgeable
Federal Voting AgeFor each birth date, decide whether the person is at least 18 years old on February 27, 2007.Easy2ImplementationMathNo attempts yet1s128 MBJudgeable
The Cell SellGiven daytime, evening, and weekend minutes, compute the monthly cost under two phone plans and print the cheaper one.Easy2ImplementationMath+1No attempts yet1s128 MBJudgeable
Snow CallsConvert each alphanumeric phone number to digits, keep the first 10 digits, and print them in xxx-xxx-xxxx form.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
Mouse MoveThe cursor starts at (0,0) on a screen of width c and height r; each relative move is clamped to the screen edges, and the position after every move must be printed.Easy2SimulationImplementation+2No attempts yet1s128 MBJudgeable
SquaresGiven a number of tiles, find the largest integer side length whose square does not exceed that number.Easy2MathImplementation+1No attempts yet1s128 MBJudgeable
Terms of OfficePrint every year from X to Y in which all four offices change, which happens on multiples of lcm(4,2,3,5) = 60, formatted as a fixed sentence.Easy2MathImplementation+2No attempts yet1s128 MBJudgeable
Smile with SimilesGiven up to five adjectives and five nouns, print every phrase of the form "<adjective> as <noun>" in nested input order.Easy2ImplementationBrute force+2No attempts yet1s128 MBJudgeable
Simple EncryptionRemove non-letters from a message and shift each letter within its column by the alphabet position of the keyword letter above it.Easy2StringSimulation+1No attempts yet1s128 MBJudgeable
TridentPrint an ASCII trident with t tine rows, a crossbar, and h handle rows, using spacing s between the tines.Easy2ImplementationString+2No attempts yet1s128 MBJudgeable
Constrained PermutationsCount permutations of 1..n (n at most 9) that satisfy given ordering constraints x before y.Easy2Brute forceCombinatorics+2No attempts yet1s128 MBJudgeable
0123456789Read one digit from 0 to 9 and print it as a seven-segment display drawn with asterisks, three per segment, with no trailing whitespace.Easy2ImplementationSimulation+1No attempts yet1s128 MBJudgeable
AmeriCanadianRead words one per line until the line quit!, and for each word rewrite a trailing consonant followed by or as our when the word has at least five letters.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
Fraction ActionReduce a numerator and denominator to simplest form, then print it as a whole number, a proper fraction, or a mixed number.Easy2MathNumber theory+1No attempts yet1s128 MBJudgeable
Dressing UpRead an odd height H and print a bow tie of H rows where each side widens as rows approach the middle.Easy2ImplementationSimulation+1No attempts yet1s128 MBJudgeable
Mod InverseGiven x and m, find n with 0 < n < m such that x*n mod m equals 1, or report that none exists.Easy2Number theoryBrute forceNo attempts yet1s128 MBJudgeable
CalendarGiven the weekday of the 1st and the number of days, print a month calendar in a fixed weekly layout with right-aligned columns.Easy2ImplementationSimulation+1No attempts yet1s128 MBJudgeable
Cross-Number PuzzlePrint all perfect numbers from 1000 to 9999, then all three-digit numbers equal to the sum of their digits' cubes.Easy2Brute forceMath+1No attempts yet1s128 MBJudgeable
Shift LettersFor each test case, rotate the letters of a word right by n positions and print the result in a fixed sentence format.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
AnagramsGiven two lowercase words, decide whether one can be rearranged into the other, and print the result with the words.Easy2StringHash map+1No attempts yet1s128 MBJudgeable
StringCollapse every run of identical consecutive letters in a lowercase string into a single letter and print the result.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Making test data 8Print a specific fixed graph: 98 vertices, 1501 edges forming a complete bipartite graph, using the exact listed edge order.Easy2GraphImplementation+2No attempts yet1s128 MBJudgeable
NonogramGiven a grid of black and white squares, print the lengths of the consecutive black blocks in each row and then each column.Easy2ImplementationArray+2No attempts yet1s1024 MBJudgeable
Hidden Roman NumeralsFind which of the twelve Roman numerals from 1 to 12 appear as substrings of a given string over {I,V,X}.Easy2StringImplementation+1No attempts yet1s1024 MBJudgeable
NumbersGiven three distinct digits and one of their six permutations, find that number's 1-based rank when all six permutations are sorted ascending.Easy2MathSorting+2No attempts yet1s1024 MBJudgeable
Building BlocksGiven a target height N and three block heights, pick the kind whose multiples get closest to N, breaking ties by smaller block then shorter tower.Easy2MathBrute forceNo attempts yet1s1024 MBJudgeable
CardsA 52-card deck is missing exactly one card; given the other 51 cards as suit and value pairs, output the missing suit and value.Easy2ArrayHash map+2No attempts yet1s1024 MBJudgeable
The Worm TurnsSimulate a 20-cell worm on a 50x50 grid through a list of moves, stopping when it hits itself, leaves the board, or finishes.Easy2SimulationImplementation+2No attempts yet1s128 MBJudgeable
Counting SheepCount how many words in each list match the string "sheep" exactly, case-sensitive, and print the count per list with blank lines between cases.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
EntropyRead one line of text, count how often each character appears, and print the Shannon entropy rounded to three decimals.Easy2Hash mapMath+2No attempts yet1s128 MBJudgeable
ExpressionGiven N, build a fully parenthesized NAND (Sheffer stroke) expression for the carry-out bit by iterating a fixed string concatenation rule.Easy2StringImplementation+2No attempts yet1s128 MBJudgeable
Right Triangle CheckFor each of n triples of side lengths, decide whether the triangle is right by checking if the largest side squared equals the sum of the other two squared.Easy2MathGeometry+2No attempts yet1s128 MBJudgeable
Programming Contest PasswordsFor each test case, read a word list and participant index sequences, then print each password formed by concatenating the indexed words.Easy2ImplementationArray+1No attempts yet1s128 MBJudgeable
GaussFor each test case, compute the sum of all integers from n to m inclusive and print the test case number followed by the sum.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
StuPIdGiven an ID with one unknown digit, use the checksum rule to find the missing digit and print the corrected ID.Easy2MathImplementation+1No attempts yet3s128 MBJudgeable
Stacked BowlsGiven a string of parentheses, compute the total stack height where the first bowl adds 10 and each following bowl adds 5 if it matches the previous direction or 10 if it differs.Easy2StringSimulation+1No attempts yet1s128 MBJudgeable
Sexagenary Cycle (干支)Given a year, print its sexagenary cycle name as a branch letter A-L followed by a stem digit 0-9.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
CuboidsFor each cuboid row with one of the four values zeroed out, compute and print the missing length, width, height, or volume.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
Jumbled WordsFor each line of lowercase words, keep the first and last letter of every word and reverse the letters in between.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Untied AirlinesRead each flight's complaint codes, sum the points per passenger, and count how many passengers reach 200 points.Easy2ImplementationHash mapNo attempts yet1s128 MBJudgeable
MP3 SongsRead several lists of tune names and print each list sorted alphabetically while ignoring case and keeping input order for ties.Easy2SortingString+1No attempts yet1s128 MBJudgeable
BookingsRead a flight's booked-seat count, then apply booking and cancellation lines, ignoring any that would push the count outside 0 to 68, and print the final count.Easy2SimulationImplementationNo attempts yet1s128 MBJudgeable
How Many Distinct LettersFor each line until the terminator '#', count how many distinct alphabet letters appear, ignoring case and non-letters.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
ExerciseFor each machine, multiply each exercise level's energy rate by its duration and sum the totals per person.Easy2SimulationImplementation+1No attempts yet1s128 MBJudgeable
AAAAHH! Overbooked!Given N event time ranges in hh:mm-hh:mm format, check whether any two events overlap in time.Easy2IntervalsSortingNo attempts yet1s128 MBJudgeable
DivisibilityGiven a base-62 string, decide whether the number it represents is divisible by 61.Easy2MathNumber theory+1No attempts yet1s128 MBJudgeable
TeleprimeGiven a six-digit number and a digit to prepend, print Yes if both the original and the resulting seven-digit number are prime.Easy2Number theoryMath+2No attempts yet1s128 MBJudgeable
JokeCount how many times the substring 'joke' appears in the input text, with line breaks treated as part of the text.Easy2StringImplementationNo attempts yet2s128 MBJudgeable
Huffman TreeGiven Z characters and arity N, decode the stored digit string into the per-character encoding.Easy2TreeString+1No attempts yet3s128 MBJudgeable
ConcertRead 10 RGB triples per data set, average each channel, and print the average rounded to the nearest integer.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
The PaintingRead an n by m grid of . and # characters and print it rotated 90 degrees clockwise, producing m rows of n characters.Easy2ArrayMatrix+1No attempts yet1s128 MBJudgeable
Ways to Make RectanglesCount the number of unordered pairs (a, b) with a <= b and a*b <= n.Easy2MathBrute force+1No attempts yet1s256 MBJudgeable
A Cat on a KeyboardGiven a text, replace each character with the keyboard row number (1 to 5) where its key sits.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
PolynomialGiven a polynomial's coefficients and an integer x, print the last three digits of |W(x)|, padded with leading zeros.Easy2MathImplementation+1No attempts yet1s128 MBJudgeable
KamilGiven a word Kamil spoke, count the words he could have meant, since each position may map to one of several letters.Easy2MathCombinatorics+1No attempts yet1s128 MBJudgeable
JulkaGiven the total apples and how many more Klaudia has, compute each girl's count.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
Ant NamesGiven up to 100 lowercase names, print the maximum number of distinct letters found in any single name.Easy2StringImplementation+1No attempts yet1s128 MBJudgeable
Units Digit of a Power of TwoThe task is to print the units digit of 2 to the power n for a huge n.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
Rhyming VersesCount pairs of lines with the same number of vowels and identical last k letters ignoring spaces.Easy2StringImplementationNo attempts yet1s512 MBJudgeable
ParkFor each of up to one million heights in order, output the maximum height to its west and to its east, using its own height when no higher point exists.Easy2Prefix sumArrayNo attempts yet1s512 MBJudgeable
Bagels on a StickSlide a chosen bagel off one end of the stick after removing the fewest bagels it cannot slide through.Easy2ArrayNo attempts yet1s512 MBJudgeable
Hidden NumberSum every maximal run of digits in a word of letters and digits, ignoring leading zeros.Easy2StringImplementationNo attempts yet1s256 MBJudgeable
Caesar CipherDecode a Caesar-shifted uppercase message by matching its most frequent letter to the given original letter.Easy2StringArray+1No attempts yet1s512 MBJudgeable
WarehouseTally up to a million signed per-product shipment records and print the remaining stock of each product in alphabetical order.Easy2ArraySimulationNo attempts yet1s512 MBJudgeable
Non-DivisorsGiven n, print the smallest and the largest integers from 1 to n that do not divide n.Easy2Number theoryMathNo attempts yet1s128 MBJudgeable
Sums and DifferencesCount ordered pairs from distinct positions where the difference exceeds the sum, which holds exactly when the second element is negative.Easy2MathCombinatoricsNo attempts yet1s128 MBJudgeable
Step on the FootKozik and Adrian alternately shorten the gap by their foot lengths, and the first player facing a gap shorter than his foot wins.Easy2MathNo attempts yet1s128 MBJudgeable
KwadratDecide whether four given points are the vertices of a non-degenerate square with sides parallel to the axes.Easy2GeometryImplementationNo attempts yet1s128 MBJudgeable
Dividing the Chocolate BarTwo brothers split an a by b chocolate bar with one straight cut so the two pieces differ in area as little as possible.Easy2MathNo attempts yet1s128 MBJudgeable
Overlapping Rectangle AreaGiven two axis-aligned rectangles, compute the area of their overlapping region.Easy2GeometryNo attempts yet1s128 MBJudgeable
Little SnowmanChoose whether the fixed ball k is the bottom, middle, or top of a three-ball snowman with halved volumes to maximize total volume within x liters.Easy2MathBrute forceNo attempts yet1s128 MBJudgeable
Bouncing BallGiven drop height x and target w, find the smallest number of doublings that make x reach at least w.Easy2MathNo attempts yet1s512 MBJudgeable
Ranking ManipulationChoose weights on the tasks you solved so you finish first, then count the contestants tied with you.Easy2ArrayImplementationNo attempts yet1s128 MBJudgeable
Making Grid PaperPick the sheet that yields the most grid cells under the margin and spacing rules, breaking ties by area, and output its area.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
ThumbtacksFind the smallest jump that crosses the bridge using only planks without thumbtacks.Easy2ArrayNo attempts yet1s128 MBJudgeable
ChessEach row holds at most one rook, so take the largest value in every row with a positive maximum and add them.Easy2GreedyArrayNo attempts yet1s128 MBJudgeable
PaintsCompute the extra red, yellow, and blue paint to buy after splitting each mixed room amount evenly between its two base colors.Easy2MathNo attempts yet1s128 MBJudgeable
Pear Trees and Apple TreesFind the largest distance between any pear tree and any apple tree in a row of n trees.Easy2ArrayNo attempts yet1s128 MBJudgeable
TournamentFor each test case with n contestants and group size k, count how many contestants can reach the final survivors under some grouping.Easy2MathNo attempts yet1s128 MBJudgeable
Missing DigitsEach cipher hides one digit as x in A or B, and you try digits 0 to 9 to find the smallest that makes A divisible by B.Easy2Brute forceMathNo attempts yet1s128 MBJudgeable
Closing the CircuitShift every given upper pair forward by one position modulo n and print the sorted lower pairs after TAK.Easy2ImplementationSorting+1No attempts yet3s128 MBJudgeable
MondaysGiven year length N, week length M, and starting weekday L, count the days from 1 to N that fall on the first weekday.Easy2MathNo attempts yet1s128 MBJudgeable
KaraokeCount the starting positions where the next K characters of the song string are all vowels.Easy2Sliding windowStringNo attempts yet2s128 MBJudgeable
Palindrome ColoringSplit each A/B string into the fewest palindromic subsequences and output that count.Easy2StringTwo pointersNo attempts yet1s128 MBJudgeable
Rock Paper ScissorsCompare the two players' winning chances from their move probabilities and print who is more likely to win each match.Easy2ProbabilityMath+1No attempts yet1s128 MBJudgeable
Shoe FactoryChoose the price p from 1 to N that maximizes the count of buyers willing to pay p times the margin p minus K.Easy2Prefix sumBrute forceNo attempts yet1s128 MBJudgeable
BookmakersDecide whether stakes on both match outcomes can guarantee a profit given decimal odds X and Y.Easy2MathNo attempts yet1s128 MBJudgeable
Power StripsGiven N cords and strips that add K outlets each, compute how many free outlets remain after connecting everything.Easy2MathNo attempts yet1s128 MBJudgeable
Changing a Light BulbCompute the sum 1 + 4 + ... + 4^(A-1) modulo 500000009 for the given level count A.Easy2MathNo attempts yet1s128 MBJudgeable
Rock Paper ScissorsSimulate k rounds of rock-paper-scissors across N robots, removing round losers until one robot remains or all rounds end in a draw.Easy2SimulationNo attempts yet1s128 MBJudgeable
TurtleSimulate the turtle's moves from the origin and report the area of the axis-aligned bounding box of its path.Easy2SimulationNo attempts yet1s128 MBJudgeable
SalesFor each test case, count pairs of days where the earlier day sold no more than the later day and print the total.Easy2Brute forceArrayNo attempts yet1s128 MBJudgeable
Molar MassThe program parses each formula of C, H, O, and N with optional atom counts and prints its molar mass using the given weights.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Careless AdditionAdd two integers digit by digit from the right with no carries and print the column sums in order.Easy2ImplementationStringNo attempts yet1s128 MBJudgeable
Heeju's Math ExamSum the terms from position A to B in the sequence where each integer k appears k times in a row.Easy2SimulationImplementationNo attempts yet1s128 MBJudgeable
Guess the SongGiven the title words and the lyrics in order, find the earliest lyric position where at least half of the distinct title words have appeared.Easy2SimulationHash mapNo attempts yet1s128 MBJudgeable