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,390 problems
TitleLevelTopicsSolvedTime limitMemory limitJudge
The n Days of ChristmasFor each n until 0, compute the total gifts when day k of n brings k gifts down to 1.Easy2MathImplementationNo attempts yet2s128 MBJudgeable
Long is a train, a train is fast, fast is a planeCompute the travel time gap between a slower train and a faster plane over M km and print each gap as rounded H:MM:SS.Easy2ImplementationMathNo attempts yet1s128 MBJudgeable
Perfect Number CheckDecide whether each given integer equals the sum of its proper divisors and print the equation or a negative verdict.Easy2Number theoryImplementationNo attempts yet2s128 MBJudgeable
Arithmetic with MorseYou sum each Morse number from its symbol values and evaluate the expression with multiplication before addition.Easy2ImplementationSimulationNo attempts yet1s128 MBJudgeable
Presidential ElectionEach voter ranks all candidates, and the program counts first-choice votes and then a top-two runoff to report the winner and the deciding round.Easy2SimulationImplementationNo attempts yet1s128 MBJudgeable
Contest Venue SetupCount the schools that have two of their teams seated in king-adjacent cells of an N by M grid with empty seats.Easy2MatrixImplementationNo attempts yet1s128 MBJudgeable
Show Me The OperatorsEvaluate each space-separated expression in two left-to-right sweeps and print the operators in execution order with the final value.Easy2SimulationImplementationNo attempts yet1s128 MBJudgeable
Qurban 2011Given buffalo part orders and sheep orders, round buffalo parts up by seven and pack the animals into trips of three buffaloes or six sheep.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
BeeThe program counts logged jobs under each of seven bee work codes and prints each count with its share of the total.Easy2ImplementationArray+1No attempts yet1s128 MBJudgeable
Easy EncryptionEach letter becomes its two-digit code and each digit gains a # prefix while other characters stay unchanged.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Form GuideParse home and away scorelines into win, draw, and loss marks, print the overall, home, and away form strings, and report the longest run of each mark.Easy2ImplementationStringNo attempts yet1s128 MBJudgeable
UndercutAdd up both players' scores across card rounds where the higher card scores unless the lower card is exactly one less.Easy2SimulationImplementationNo attempts yet1s128 MBJudgeable
CarsSimulate n cars adjusting speed by 5 m/s every 5 seconds to keep gaps within 80 to 100 meters, and output -1 on collision or the front car distance.Easy2SimulationImplementationNo attempts yet2s1024 MBJudgeable
Zeros in a FactorialCount how many zero digits appear in the decimal representation of n factorial for a given n below 100.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
RouteCount the maximal runs of level, uphill, and downhill metre sections along the looped jogging route starting at pole 1.Easy2ArrayImplementationNo attempts yet2s1024 MBJudgeable
Centroid of Point MassesCompute the mass-weighted average x and y over each point set and print each centroid rounded to two decimals.Easy2MathImplementationNo attempts yet3s128 MBJudgeable
Have you had your birthday yet?For each birth date, tell whether its 2007 birthday already passed relative to 4 August, with special outputs for 4 August and 29 February.Easy2ImplementationNo attempts yet1s128 MBJudgeable
Cedric's cypherDecrypt each Caesar-ciphered line using the trailing encrypted A to recover the shift and drop that marker.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
The Hardest Problem EverDecode each START/END block by shifting every uppercase letter five places back and leaving other characters unchanged.Easy2StringImplementationNo attempts yet1s128 MBJudgeable
Polar ExplorerGiven planet radius, fuel, and the angle to the crash site, decide if the round trip on the shorter arc fits and report leftover fuel or reachable miles.Easy2MathImplementationNo attempts yet1s128 MBJudgeable
HMs and TMsFind all of the first 151 Pokémon that can learn every HM or TM move on the given list and print their numbers in order.Easy2ImplementationBrute forceNo attempts yet1s128 MBJudgeable
Assigning PartnersYou check that every positional pairing is mutual and no student is paired with themselves.Easy2Hash mapImplementationNo attempts yet1s256 MBJudgeable
Focal Length of a LensGiven object and image distances for each test case, compute the lens focal length and print it rounded to one decimal place.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
Clean UpRecompute each of the nine batting averages after adding the new series and reorder the lineup around the new best average.Easy2SimulationImplementationNo attempts yet1s256 MBJudgeable
Word SwapSum the per-position letter differences between each pair of equal-length words and report the coins earned, paid, or free.Easy2ImplementationStringNo attempts yet1s256 MBJudgeable
Aligned CalendarConvert each Gregorian date into the 13-month calendar with 28-day months and report the leftover days as holidays.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
Odysseus and the SirensThe program scores every melody under each candidate key by summing note penalties and prints the numbered key with the smallest total.Easy2ImplementationString+1No attempts yet1s256 MBJudgeable
Toroidal gridPrint the given snake sweep of columns 0 to n-2 plus the climb up column n-1 to list a Hamiltonian cycle of the m by n toroidal grid.Easy2ImplementationGraphNo attempts yet1s256 MBJudgeable
Train PassengersDecide if per-station counts of passengers leaving, boarding, and left waiting fit the train capacity and boarding rules.Easy2SimulationImplementationNo attempts yet1s256 MBJudgeable
Runway PlanningGiven each heading in degrees, compute the two-digit runway number by rounding and folding to the range 1 to 18.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
Amino AcidParse each formula into element counts and print the molecular weight, or Invalid formula for other elements.Easy2StringImplementationNo attempts yet1s64 MBJudgeable
Alarm ClockPrint the earliest hh:mm time whose four digits use exactly n lit segments, or Impossible when no such time exists.Easy2Brute forceImplementationNo attempts yet2s256 MBJudgeable
Joy of FlightAdd up the wind drift over k seconds and, if the remaining distance fits the speed limit, print the evenly paced flight positions.Easy2ImplementationSimulation+1No attempts yet2s256 MBJudgeable
EligibilityDecide each student contest status from study start year, birth year, and completed courses under four ordered rules.Easy2ImplementationNo attempts yet2s256 MBJudgeable
Anniversary 1Starting from April 2, 2014 as day 1, add N-1 days with leap years and print the date as YYYY-MM-DD.Easy2SimulationImplementationNo attempts yet1s256 MBJudgeable
Anniversary 2Given a start date as day 1 and a number N, print the date N minus 1 days later following the given leap year rules.Easy2SimulationImplementationNo attempts yet1s256 MBJudgeable
TorusPrint 1 for each test case followed by the prescribed vertex order that visits every vertex of the toroidal lattice exactly once.Easy2ImplementationNo attempts yet1s256 MBJudgeable
Queens on Bad TermsCheck an 8x8 board holding eight queens and print valid only when no two queens share a row, column, or diagonal.Easy2ImplementationMatrixNo attempts yet1s256 MBJudgeable
Hitting the TargetsCount, for each of up to 100 shot points, how many of up to 30 given rectangles and circles contain it, boundaries included.Easy2GeometryImplementationNo attempts yet2s256 MBJudgeable
The Wet KeypadGiven a permuted phone keypad, encode a message of up to 100 letters into multi-tap presses with # separators.Easy2ImplementationSimulationNo attempts yet1s32 MBJudgeable
Most Chosen NumberPick the number that appears most often in each test case, breaking ties by the smaller number.Easy2ArrayImplementationNo attempts yet5s256 MBJudgeable
FilterThe program checks each Bloom filter against every queried user id and lists the files that may hold at least one of them.Easy2SimulationImplementationNo attempts yet1s256 MBJudgeable
Working HoursAdd signed hour and minute terms in a flexible format and print each total as H:MM.Easy2ImplementationString+1No attempts yet2s256 MBJudgeable
Urdu orthography verificationCheck whether each encoded Urdu letter uses the detached, initial, medial or final shape required by its position and the two special vowels.Easy2SimulationImplementationNo attempts yet1s256 MBJudgeable
Crossword Clue NumberingScan the grid for empty cells that begin a word of at least three cells across or down and print them in reading order.Easy2ImplementationMatrixNo attempts yet1s256 MBJudgeable
Cow RoutingFind the cheapest single flight route on which city A appears before city B, or report -1 when none exists.Easy2ImplementationArrayNo attempts yet1s256 MBJudgeable
Date in SeoulAdd nine hours to the given UTC date output and print the resulting Seoul calendar date as YYYY-MM-DD.Easy2ImplementationNo attempts yet1s256 MBJudgeable
RövarspråketTranslate one lowercase word by expanding each consonant into three letters under the given vowel and consonant rules.Easy2ImplementationStringNo attempts yet1s256 MBJudgeable
Four NumbersAdd the two numbers formed by writing B directly after A and D directly after C.Easy2ImplementationMathNo attempts yet1s256 MBJudgeable
International MeetingConvert a HH:MM meeting time from one UTC offset to N coworker offsets and print each local time of day.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
SHA-256Print the SHA-256 hash of the given string as 64 lowercase hexadecimal digits.Easy2ImplementationNo attempts yet1s256 MBJudgeable
Base Conversion 2Convert the decimal number N to base B, writing digits above 9 as uppercase letters.Easy2MathImplementationNo attempts yet0.5s256 MBJudgeable
Sieve of EratosthenesSimulate the sieve of Eratosthenes as described and print the K-th crossed-out number for each N and K pair.Easy2SimulationImplementationNo attempts yet1s256 MBJudgeable
Entrance ExaminationPick the cutoff n between nmin and nmax with a strict score split that maximizes the gap between the lowest passing and highest failing scores.Easy2ArrayImplementationNo attempts yet1s256 MBJudgeable
ICPC CalculatorEvaluate a dot-indented prefix expression where + sums its operands and * multiplies them.Easy2RecursionTree+1No attempts yet1s256 MBJudgeable
Pythagorean ExpectationAdd up each team's scored and allowed runs from the match records, apply the given formula, and print the largest and smallest values scaled by 1000.Easy2ImplementationMathNo attempts yet1s256 MBJudgeable
Painting FloorsPrint the leftmost cell of every horizontal bare run so the prescribed plan covers all bare squares.Easy2ImplementationNo attempts yet2s256 MBJudgeable
Kkung's Girlfriend PlanEach test case gives named condition times and AND-OR combos, and the answer is the smallest combo time where one combo takes its slowest condition.Easy2ImplementationHash map+1No attempts yet1s256 MBJudgeable
The Traveling OrienteererGiven point coordinates and lists of courses, compute each course total Euclidean length rounded to the nearest integer.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
Is It a Number?Check whether each line holds only digits with optional surrounding spaces and print the number without leading zeros or invalid input.Easy2StringImplementationNo attempts yet1s256 MBJudgeable
Decode the MessageThe program decodes each word into one character from its letter values modulo 27.Easy2StringMath+1No attempts yet1s256 MBJudgeable
ElectionFor each test case, count how many coins overlap each coin and print the top name or TIE on ties.Easy2GeometryBrute force+1No attempts yet1s256 MBJudgeable
Black FridayGiven each person's die roll, print the number of the person holding the highest roll that no one else rolled, or none.Easy2ArrayImplementationNo attempts yet1s256 MBJudgeable
Choosing an Exam SetYou compare exam sets by random-guess expected score and pick the highest, preferring fewer questions then the smaller number.Easy2ImplementationMathNo attempts yet1s256 MBJudgeable
ITAI VirusCount the initially infected cities plus every city directly joined to one by a single road.Easy2GraphImplementationNo attempts yet1s256 MBJudgeable
Minions' MasterFor each town, compute the average power and the percentage of residents above it, rounded to three decimals.Easy2ImplementationMathNo attempts yet3s256 MBJudgeable
Hangul 2Given one Hangul syllable, compute its one-based index in the ordered list of 11172 syllables.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
Initial, Medial, FinalDecompose one Hangul syllable into its initial, medial, and optional final jamo and print each on its own line.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
Compose a Hangul SyllableJoin the given choseong, jungseong, and optional jongseong into a single Hangul syllable and print it.Easy2ImplementationMathNo attempts yet1s256 MBJudgeable
Margaret's Minute Minute ManipulationDecode two binary-clock matrices into times, add them modulo 24 hours, and print the sum in the same matrix format.Easy2ImplementationMathNo attempts yet1s256 MBJudgeable
PasswordCheck whether the two letters typed into the blanked positions of a stored answer match the letters at those positions, ignoring spaces.Easy2StringImplementationNo attempts yet1s256 MBJudgeable
Creature Number SystemsConvert each given decimal number up to 5000 into the creature's base between 2 and 20, using letters A to J for digits above 9.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
PriceApply the sticker discount and then the optional coupon to each price, round to cents, and apply the extra cash rounding for cash payments.Easy2ImplementationMathNo attempts yet1s256 MBJudgeable
GraphsPrint the equation line and an 11-column asterisk grid showing the y axis, the x axis, and the line y = Ax + B for each test case.Easy2ImplementationSimulationNo attempts yet1s256 MBJudgeable
Time Limit CheckFor each case, evaluate f(N) times T from the named complexity and print TLE when it exceeds 10^8 times L.Easy2MathImplementationNo attempts yet2s256 MBJudgeable
Eakspay igpay atinlay?Translate each phrase into Pig Latin by moving each leading consonant cluster to the end with ay, or adding yay after vowel-initial words.Easy2StringImplementationNo attempts yet1s256 MBJudgeable
Crushing ConfectionsFind the lexicographically smallest row or column triple of equal candies in each grid and print its positions.Easy2MatrixImplementationNo attempts yet1s256 MBJudgeable
Orc PopulationGiven two consecutive yearly populations and c, print the population c years later where each year equals the sum of the two before it.Easy2ImplementationSimulationNo attempts yet1s256 MBJudgeable
Your weapon is kind of badEach fighter swaps to the other weapon bonus stats, recomputes combat power from the given formula, and reports whether it rises, falls, or stays the same.Easy2ImplementationNo attempts yet1s512 MBJudgeable
DistributionYou split the integers from 0 to 2^N - 1 into 2^K boxes of equal size with equal total popcount by pairing each x with its bitwise complement.Easy2Bit manipulationMath+1No attempts yet1s512 MBJudgeable
Mr. Gorbachev, Tear Down This Wall!Add up the lengths of the axis-aligned wall segments and report the total work hours split across the workers, rounded up.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
AmpelmännchenFor each item pick the West or East version that gives the larger population-weighted happiness total.Easy2GreedyImplementationNo attempts yet1s256 MBJudgeable
Black and White PanelPrint the fixed 101-column black and white grid whose isolated single tiles yield exactly b black areas and w white areas.Easy2ImplementationMatrixNo attempts yet2s256 MBJudgeable
Hash Code HackerThe program prints k distinct letter strings that share one Java hash code by mapping binary digits to Aa and BB blocks.Easy2StringImplementationNo attempts yet2s256 MBJudgeable
Lucky ChancesCount over every grid cell how many of the four directions contain only smaller numbers or reach the edge.Easy2Brute forceMatrix+1No attempts yet2s256 MBJudgeable
Base ConversionConvert the given number written in base A into base B and print its digits separated by spaces.Easy2MathImplementationNo attempts yet2s256 MBJudgeable
Egg Drop LogFrom the logged safe and broken drops, compute the lowest floor that could break and the highest floor that could stay safe.Easy2IntervalsImplementationNo attempts yet2s256 MBJudgeable
Stand on ZanzibarThe program adds yearly increases beyond twice the previous count to bound the number of imported turtles.Easy2MathImplementationNo attempts yet1s256 MBJudgeable
Scaling RecipesScale each recipe from the main ingredient weight and baker percentages, then print every scaled weight rounded half up to one decimal.Easy2ImplementationMathNo attempts yet3s256 MBJudgeable
Lost ExponentsSplit each integer into a base from all but the last digit and an exponent from the last digit, then print the sum of the powers.Easy2MathImplementationNo attempts yet1s64 MBJudgeable
Tiling recordGiven a floor tiled with 1 by n tiles labeled by number, list each tile as h or v in row-major order of its first cell.Easy2SimulationMatrix+1No attempts yet1s256 MBJudgeable
Hex Code DecoderDecode each line of hexadecimal digit pairs into its printable ASCII message.Easy2ImplementationNo attempts yet1s256 MBJudgeable
Octal, Decimal, HexadecimalConvert one integer given in octal, decimal, or hexadecimal notation to its decimal value.Easy2ImplementationMathNo attempts yet1s256 MBJudgeable
Bear in the TrapFind the smallest and largest integers between L and D whose digits sum to X.Easy2Brute forceImplementationNo attempts yet1s64 MBJudgeable
FloodFollow the given greedy procedure to build a permutation histogram with trapped-water capacity X, or print -1 when it fails.Easy2GreedyImplementationNo attempts yet1s64 MBJudgeable
Belote PointsSum the scores of all 4N cards using the value table where J and 9 score more in the dominant suit.Easy2ImplementationNo attempts yet1s64 MBJudgeable
Number tag exchangeSimulate M bubble passes over the line, swapping neighbors when the front tag has the larger remainder modulo the pass number.Easy2SimulationImplementationNo attempts yet2s512 MBJudgeable
gMatrix (Small)Build the matrix from the given formula and add the largest entry of every K by K consecutive submatrix.Easy2Brute forceMatrix+1No attempts yet5s512 MBJudgeable
Hangul Initial ConsonantsPrint the initial consonant of each Hangul syllable in the given string in order.Easy2MathString+1No attempts yet1s512 MBJudgeable
#include <Google I/O.h>Decode each block of eight I and O letters as one ASCII byte and print the message for every test case.Easy2ImplementationString+1No attempts yet5s512 MBJudgeable