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 results6,410 problems
TitleLevelTopicsSolvedTime limitMemory limitJudge
What's the Second Baseman's NameGiven up to 1000 player names, check whether any name equals the string anj and print one of two fixed messages.Easy2ImplementationStringNo attempts yet1s512 MBJudgeable
Wagle Wagle SoongkohanGiven three distinct participation values, print OK if their sum is 100 or more, otherwise print Soongsil, Korea, or Hanyang for the smallest.Easy2ImplementationArray+2No attempts yet1s512 MBJudgeable
Bonus ScoreGiven a string of O and X for N problems, compute the total score where problem i gives i points plus a running bonus that grows on each O and resets on each X.Easy2ImplementationSimulation+1No attempts yet1s512 MBJudgeable
Buying SnacksGiven price and weight for three snacks, print the name of the one whose 10-bag weight per discounted price is highest.Easy2ImplementationMath+2No attempts yet1s1024 MBJudgeable
N! mod P (1)Given N and a prime P larger than N, compute N! modulo P.Easy2MathImplementation+2No attempts yet3s1024 MBJudgeable
What Is a Recursive Function?Given N, print the chatbot message 'What is a recursive function?' repeated with nested quotation marks for N levels of recursion.Easy2ImplementationString+1No attempts yet1s256 MBJudgeable
BuffoonGiven N vote counts in registration order, output S if the first candidate has the unique most votes, otherwise N.Easy2ImplementationArray+1No attempts yet1s512 MBJudgeable
Hour for a RunGiven laps V and signs per lap N, print the ceiling of V*N*i/10 signs for i = 1 through 9.Easy2MathImplementation+1No attempts yet0.5s512 MBJudgeable
Scores of Final ExaminationGiven m subjects and n students, with each subject's scores listed in a row, find the maximum total score across students.Easy2ArrayImplementation+1No attempts yet2s512 MBJudgeable
Missing NumbersGiven an increasing list of distinct numbers a child recited, print every integer from 1 up to the last recited number that is missing, or print "good job" if none are.Easy2ArrayImplementation+2No attempts yet1s1024 MBJudgeable
BagsGiven n waste pieces with identifiers, find the minimum number of bags so that each bag holds pieces of only one identifier.Easy2Hash mapImplementation+2No attempts yet1s512 MBJudgeable
369Count the total claps in the 369 game from 1 to N, where each number contributes one clap per digit that is 3, 6, or 9.Easy2ImplementationMath+2No attempts yet1s512 MBJudgeable
Mangling NamesGiven a table of pronunciation times by vowel and consonant counts, sum the times for each student name and report the total.Easy2ImplementationString+2No attempts yet2s512 MBJudgeable
TrolGiven an array where A[i] is the digital root of i for i from 1 to 260, answer Q queries asking for the sum over a range [l, r].Easy2Prefix sumMath+1No attempts yet1s512 MBJudgeable
What Is My Grade?Given 50 distinct scores sorted in descending order and Hongik's score, print the letter grade matching his rank using the fixed cutoffs.Easy2ArrayImplementation+2No attempts yet1s256 MBJudgeable
CommandFor each of T strings, decide whether it has length 7 and its characters follow the exact pattern AABBABB with exactly two distinct letters.Easy2StringImplementation+1No attempts yet0.5s256 MBJudgeable
This Problem’s a Slam DunkGiven the heights of five players on each of two teams, count how many State U players are taller than the opponent they guard after sorting both teams by height.Easy2SortingArray+1No attempts yet1s512 MBJudgeable
Simple Collatz SequenceSimulate the modified Collatz rule (halve even k, increment odd k) from n until reaching 1 and count the steps taken.Easy2SimulationImplementation+1No attempts yet1s512 MBJudgeable
Regional Team NamesDecide whether a string splits into an institution part of 2 to 8 characters, a hyphen, then a team name of 1 to 24 characters.Easy2StringImplementationNo attempts yet1s512 MBJudgeable
Piece of Cake!Given a square cake of side n and thickness 4, two cuts at distances h and v from the top and left, find the largest piece's volume.Easy2MathImplementation+1No attempts yet1s512 MBJudgeable
Mars WindowGiven a year between 2018 and 10000, decide whether a launch window occurs in it, where windows are 26 months apart starting April 2018.Easy2MathImplementationNo attempts yet1s512 MBJudgeable
Pea Soup and PancakesRead each restaurant's name and menu, then print the first one serving both pea soup and pancakes, or a fixed fallback line if none does.Easy2ImplementationString+2No attempts yet1s512 MBJudgeable
License to LaunchFind the earliest index of the minimum value in an array of n space-junk counts and print the zero-based day.Easy2ArrayImplementation+1No attempts yet1s512 MBJudgeable
ÖstgötskaCount how many space-separated words contain the substring "ae"; if that count is at least 40 percent of the words, print one fixed phrase, otherwise the other.Easy2StringImplementation+1No attempts yet1s512 MBJudgeable
Hanging Out on the TerraceTrack how many people are on a terrace with a limit L and count how many enter groups are turned away because they would exceed it.Easy2SimulationImplementationNo attempts yet1s512 MBJudgeable
The Commuting GodGiven integers A and B where x^2 + 2Ax + B = 0 has integer roots, print the distinct roots in ascending order.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
Even or Odd?Given n, decide whether the sum of any n consecutive positive integers is always even, always odd, or depends on the starting point.Easy2MathImplementation+1No attempts yet1s512 MBJudgeable
Bullet SpeedGiven Cheolsu's running speed A and the bullet's speed B relative to him, print the bullet's speed toward the target, which is A + B.Easy2MathImplementationNo attempts yet0.5s256 MBJudgeable
Hot HikePick a start day for a 3-day trip so the maximum temperature on the first and third days is as low as possible, breaking ties by smallest start day.Easy2Brute forceArray+1No attempts yet2s512 MBJudgeable
Jazz EnthusiastAdd up the lengths of n songs, subtract the crossfade time once for each pair of adjacent songs, and print the total as hh:mm:ss.Easy2MathImplementation+1No attempts yet2s512 MBJudgeable
Arithmetic MagicGiven N, compute (x+1)(y+1) - x - y - xy for chosen numbers x and y, which simplifies to 1, and raise it to N.Easy2MathImplementationNo attempts yet2s512 MBJudgeable
TapiokaGiven a three-word dish name, remove the words "bubble" and "tapioka", then print the remaining words or "nothing" if none remain.Easy2StringImplementationNo attempts yet2s1024 MBJudgeable
I'll Pay, No I'll PayPeople take turns adding to their outstretched amount; find who first reaches the threshold K and on which of their turns.Easy2SimulationImplementation+1No attempts yet2s512 MBJudgeable
Frozen Ticket BookingGiven a theater with N rows and M seats per row numbered row by row, print the seat number of the fourth seat of row L, or -1 if row L has no fourth seat.Easy2MathImplementationNo attempts yet1s512 MBJudgeable
TimeCount how many clock times from 00:00:00 through N:59:59 contain the digit K at least once.Easy2Brute forceImplementation+2No attempts yet1s256 MBJudgeable
KBLTRNSGiven several routes, each with a time and a price, print the smallest time among the routes that reach the destination within the 12 hour limit.Easy2ImplementationArray+1No attempts yet2s512 MBJudgeable
KABISAGiven a list of years separated by commas, print the leap years among them, separated by spaces.Easy2MathImplementationNo attempts yet2s512 MBJudgeable
Lucky StraightGiven an even-length number, decide whether the sum of its left-half digits equals the sum of its right-half digits, printing LUCKY or READY.Easy2StringImplementation+2No attempts yet1s256 MBJudgeable
MergeMerge two sorted sequences into one sorted sequence using the given tie-breaking rule, which takes from A when the front elements are equal.Easy2Two pointersImplementation+2No attempts yet2s512 MBJudgeable
The Nearest Value to XGiven X, L, and R, print the integer in [L, R] whose absolute difference from X is smallest.Easy2ImplementationMathNo attempts yet2s512 MBJudgeable
CapitalizationReplace every occurrence of the substring "joi" in a lowercase string with "JOI" and print the result.Easy2StringImplementationNo attempts yet2s512 MBJudgeable
Longest Ascending Contiguous SubsequenceGiven a sequence of positive integers, find the length of the longest contiguous run whose elements are non-decreasing.Easy2ArrayImplementation+1No attempts yet2s512 MBJudgeable
BananaRead a dictionary mapping English words to Minionese words, then translate each of T sentences word by word.Easy2Hash mapString+2No attempts yet2s512 MBJudgeable
Pokemon BuddyGiven a Pokemon group with a fixed distance per candy and starting and required candy counts, find the total kilometers to walk.Easy2MathImplementationNo attempts yet2s512 MBJudgeable
A Problem for Testing a New Regrade MethodRead two integers A and B, print their sum, then read N numbers and print them sorted in ascending order.Easy2SortingImplementationNo attempts yet5s512 MBJudgeable
Divisionals SpellingGiven n words and a contest with m questions labeled A onward, count how many words use only distinct letters from the first m letters.Easy2ImplementationString+1No attempts yet1s512 MBJudgeable
Math Is an Online LectureGiven six integers defining two linear equations in two unknowns, solve the system and print the integer values of x and y.Easy2MathImplementationNo attempts yet1s1024 MBJudgeable
Frog 1Given target coordinates and a jump count, decide whether a frog starting at the origin can reach that cell in exactly that many unit grid jumps.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
ArtGiven N paint drop coordinates, find the smallest axis-aligned rectangle that strictly contains every point, and print its bottom-left and top-right corners.Easy2ImplementationMath+2No attempts yet2s512 MBJudgeable
ABCD CodeFor each four-digit code, check whether the square of its first two digits plus the square of its last two digits leaves remainder 1 modulo 7.Easy2MathImplementation+2No attempts yet2s512 MBJudgeable
Space PokerGiven fixed counts of red, green, and blue chips and two coefficients, pick which single chip color to add to maximize a quadratic payout formula.Easy2Brute forceMath+2No attempts yet2s512 MBJudgeable
RebusSplit the input into space-separated words, strip leading and trailing apostrophes by removing that many letters from each end, then concatenate the pieces.Easy2StringImplementationNo attempts yet2s512 MBJudgeable
The Pleasant WalkGiven a sequence of house colors, find the length of the longest contiguous segment in which no two adjacent houses share the same color.Easy2ArrayImplementationNo attempts yet1s512 MBJudgeable
New Language CCGiven an integer n, print how many bits CC needs to store it after dropping leading zeros, with 0 stored in 1 bit.Easy2Bit manipulationMath+1No attempts yet1s512 MBJudgeable
Chess PuzzleGiven a knight's square on an 8x8 board, place a rook and a bishop so each attacks the knight, they do not attack each other, and the knight attacks neither.Easy2Brute forceImplementation+2No attempts yet2s512 MBJudgeable
Santa ClausGiven two lists of children who already have presents, output the children from 1 to n who are missing from both lists.Easy2ArrayImplementation+1No attempts yet2s512 MBJudgeable
DivisorsGiven all proper divisors of an unknown number N, compute N using the fact that the smallest and largest proper divisors multiply to N.Easy3MathNumber theory+1No attempts yet2s512 MBJudgeable
LiesUsing union-find on party attendees, determine which parties can be exaggerated without conflicting with people who must always hear the truth.Easy3Union-findGraph+1No attempts yet2s128 MBJudgeable
Tournament Meeting RoundSimulate a single-elimination tournament where positions are halved each round to find when two specific players first face each other.Easy3SimulationMath+1No attempts yet1s512 MBJudgeable
KingMove a king on an 8x8 board by given commands; if it lands on the stone, the stone slides one square the same way unless it would leave the board.Easy3SimulationImplementationNo attempts yet2s128 MBJudgeable
Leaf Nodes in a TreeGiven a tree by parent array, delete a node and all its descendants, then count how many leaf nodes remain.Easy3TreeDFS+1No attempts yet2s128 MBJudgeable
UnderprimeCount integers in a range whose total number of prime factors (with multiplicity) is itself a prime number.Easy3Number theoryMath+1No attempts yet2s128 MBJudgeable
Josephus PermutationSimulate the Josephus elimination order for N people counting off every K-th person in a circle and print the removal sequence.Easy3QueueSimulation+1No attempts yet2s256 MBJudgeable
Finding the RankGiven a sorted list of scores with a capacity limit, compute the rank of a new score or return -1 if the list is full and the score is not higher than the last entry.Easy3ArrayImplementation+1No attempts yet2s128 MBJudgeable
Strange MultiplicationGiven two large numbers as digit strings, compute the sum of all pairwise products of their digits, which equals the product of their digit sums.Easy3MathString+1No attempts yet2s256 MBJudgeable
Castle GuardsGiven a grid of guards, compute the minimum number of guards to add so every row and column has at least one, which equals the max of empty-row count and empty-column count.Easy3ArrayGreedy+1No attempts yet2s128 MBJudgeable
Switches On and OffSimulate switch toggles where male students flip every multiple of their number and female students flip the largest symmetric interval centered on their number.Easy3SimulationArray+2No attempts yet2s128 MBJudgeable
Alphabet DiamondGiven a repeating diamond-pattern tile defined by N, print the characters inside a specified rectangular region of the infinite tiled plane.Easy3SimulationMath+1No attempts yet2s128 MBJudgeable
Shortcut Key AssignmentAssign each menu option an unused shortcut letter by checking word-initial letters first, then any letter in the string, following the options in order.Easy3SimulationString+1No attempts yet2s128 MBJudgeable
Lee-myeon and Im-hyeonClassify a number 1 to 2700 as Lee-myeon and/or Im-hyeon based on digit sum parity and prime factorization rules, then output one of four codes.Easy3Number theoryImplementation+1No attempts yet2s128 MBJudgeable
BestsellerGiven N book titles sold in a day, find the most frequent title, breaking ties by lexicographically smallest.Easy3Hash mapSorting+1No attempts yet2s128 MBJudgeable
D-DayCompute the number of days between two calendar dates accounting for leap years, printing 'gg' if the gap reaches 1000 years or more.Easy3MathImplementationNo attempts yet2s128 MBJudgeable
Decimal DigitSimulate long division of A by B to output the N-th digit after the decimal point.Easy3SimulationMath+1No attempts yet2s128 MBJudgeable
Missed CallSimulate an album of N songs with 5-second gaps and a phone ringing every D seconds to find the first ring Kangto can actually hear.Easy3SimulationImplementation+1No attempts yet2s128 MBJudgeable
Arithmetic ProgressionGiven a sequence S and starting value A0, find the smallest common difference d >= 0 of an arithmetic progression so that floor(A0+(i+1)d) equals S_i for every index.Easy3MathImplementationNo attempts yet2s128 MBJudgeable
Maze ConstructionSimulate a sequence of forward moves and turns on a grid, then print the smallest rectangular map marking visited cells as passable and the rest as walls.Easy3SimulationImplementation+1No attempts yet2s128 MBJudgeable
HockeyCount how many given points lie inside or on the boundary of a stadium shape formed by a rectangle and two semicircular ends.Easy3GeometryImplementationNo attempts yet2s128 MBJudgeable
Binary to Octal ConversionConvert a binary number with up to 1,000,000 digits into its octal representation.Easy3Bit manipulationMath+2No attempts yet1s128 MBJudgeable
MessagesGiven sheets of names passed around a circle with P/N marks, find who wrote each hurtful (N) message and about whom.Easy3SimulationArray+2No attempts yet1s128 MBJudgeable
Serial NumbersSort serial numbers by length, then digit-sum, then a custom lexicographic rule where digits precede letters.Easy3SortingString+1No attempts yet2s128 MBJudgeable
Youngsik and Friends' Ball TossSimulate a ball being passed clockwise or counterclockwise by L seats depending on parity of catch count, counting throws until someone catches it M times.Easy3SimulationImplementation+1No attempts yet2s128 MBJudgeable
I Am Pokemon Master DasomBuild a bidirectional mapping between Pokemon numbers and names, then answer up to 100,000 lookup queries either way.Easy3Hash mapImplementation+1No attempts yet2s256 MBJudgeable
DNA DecodingRepeatedly merge the last two bases of a DNA string using a fixed lookup table until one base remains, then output it.Easy3SimulationString+1No attempts yet5s16 MBJudgeable
Number of Trailing Zeros in a FactorialCount the trailing zeros of N! for N up to 500 by counting factors of 5.Easy3MathNumber theory+1No attempts yet2s128 MBJudgeable
Garbage CollectionSimulate a garbage truck visiting points in order, returning to the dump when its load is full or would overflow, and compute the total distance traveled.Easy3SimulationImplementation+2No attempts yet1s128 MBJudgeable
CrosswordGiven a filled crossword grid, extract every maximal horizontal or vertical run of letters of length at least two and output the lexicographically smallest such word.Easy3StringImplementation+1No attempts yet2s128 MBJudgeable
CipherEncrypt a lowercase text by shifting each letter backward in the alphabet by the position value of a repeating key letter, leaving spaces unchanged but still consuming a key character.Easy3StringSimulation+1No attempts yet2s256 MBJudgeable
Prime PalindromeFind the smallest number greater than or equal to N that is both a prime and a palindrome.Easy3MathBrute force+1No attempts yet2s256 MBJudgeable
Number Word SortSort integers from M to N by comparing their digits spelled out as English words rather than by numeric value, then print 10 per line.Easy3SortingString+1No attempts yet2s128 MBJudgeable
Extended Fibonacci NumbersCompute the sign and absolute value modulo 1e9 of the Fibonacci sequence extended to negative indices for a given n up to 1,000,000 in absolute value.Easy3MathImplementationNo attempts yet2s128 MBJudgeable
CipherGiven an encrypted string built by zigzag row reading of a column-filled table, reconstruct the original string for a given number of columns.Easy3SimulationMatrix+2No attempts yet2s128 MBJudgeable
Broken OdometerConvert an odometer reading that skips the digit 4 back into the real distance traveled, using a base-9-like digit mapping.Easy3MathImplementation+1No attempts yet0.5s128 MBJudgeable
TriangleGiven three points, classify the triangle they form as degenerate, equilateral, isosceles or scalene, and further by its largest angle type.Easy3GeometryImplementation+1No attempts yet2s128 MBJudgeable
Minimum HeapImplement a min-heap to support inserting natural numbers and repeatedly extracting the smallest, printing 0 when empty.Easy3HeapImplementationNo attempts yet1s128 MBJudgeable
Postfix Expression Evaluation 2Evaluate a postfix expression using given operand values and print the result rounded to two decimal places.Easy3StackString+1No attempts yet2s128 MBJudgeable
Snail 2Simulate a snail-like spiral fill on an M by N grid and count how many times the path turns before every cell is visited.Easy3SimulationMatrix+1No attempts yet2s128 MBJudgeable
DNAGiven N DNA strings of length M, construct the string minimizing total Hamming distance to all, breaking ties lexicographically, and output that distance.Easy3StringGreedy+1No attempts yet2s128 MBJudgeable
Surprising StringFor each string, check for every gap size whether all pairs of letters at that fixed distance are distinct, and report if the string is 'surprising'.Easy3StringBrute force+1No attempts yet2s128 MBJudgeable
MinesweeperGiven an N x N minesweeper grid with mine counts (possibly multi-mine cells), output each empty cell's summed adjacent mine count, capping at 'M' for 10+.Easy3MatrixSimulation+1No attempts yet2s128 MBJudgeable
RoundingGiven an integer up to 99,999,999, repeatedly round its digits at increasing place values (tens, hundreds, etc.) using standard rounding rules and print the final result.Easy3MathImplementation+1No attempts yet2s128 MBJudgeable