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 results333 problems
| Title | Level | Topics | Solved | Time limit | Memory limit | Judge |
|---|---|---|---|---|---|---|
| Random Game~~~~~Output any integer between 1 and 2,147,483,647; the judge scores each of three runs by how close your number lands to a hidden random pick. | Easy1 | MathProbability+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Rock Paper ScissorsCompare the two players' winning chances from their move probabilities and print who is more likely to win each match. | Easy2 | ProbabilityMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Dice GameEach player rolls two dice with consecutive face ranges and the larger total wins, so compute both win probabilities from the four ranges. | Easy2 | ProbabilityBrute force | No attempts yet | 1s | 256 MB | Judgeable |
| HeadshotAfter a click on a circular cylinder, compare firing at once against spinning first and print which choice is safer. | Easy2 | ProbabilityString | No attempts yet | 1s | 64 MB | Judgeable |
| Suchan Is a Marine Boy!!Given N practice records, compute the ratio of their arithmetic mean to the expected value of a value drawn uniformly from them, or print divide by zero. | Easy2 | MathImplementation+2 | No attempts yet | 2s | 512 MB | Judgeable |
| LotteryGiven N, M, K, compute the probability that two random M-subsets of 1..N share at least K numbers using the hypergeometric distribution. | Easy3 | CombinatoricsMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| SmeechParse a prefix Smeech expression with probabilistic plus or minus operators and compute its expected value to two decimals. | Easy3 | RecursionMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| GymGiven an N by N matrix of card counts, compute the probability distribution over N baskets for the first 10 steps of a Markov process starting at basket 1. | Easy3 | MathMatrix+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Four QuartersFor each round count from 1 to 20, compute the probability that A wins, B wins, or the game ties after that many rounds of this four-coin game. | Easy3 | ProbabilityDynamic programming+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Bobby's BetDecide whether a bet pays off by computing the binomial chance of rolling at least R on at least X of Y rolls and comparing it to the odds W. | Easy3 | ProbabilityCombinatorics+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Password RetypingGiven per-character correctness odds, pick backspaces or a restart to minimize expected keystrokes to finish the password. | Easy3 | ProbabilityMath+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Commute War (Small)Walk the single chain of hourly rides from home to the office, adding each wait, ride time, and geometric checkpoint delay for the expected arrival time. | Easy3 | ProbabilitySimulation+1 | No attempts yet | 5s | 512 MB | Judgeable |
| World Cup BettingGiven N at most 10 matches with hit probabilities and odds, find the probability that a fixed-fraction bettor ends with more money than he started. | Easy3 | ProbabilityBrute force | No attempts yet | 1s | 32 MB | Judgeable |
| Secret SantaFor a uniformly random permutation of N names, compute the probability that at least one resident draws their own name, rounded to 8 decimals; N can reach 10^12. | Easy3 | ProbabilityMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Six SidesGiven the six faces of two dice, find the probability that the first die shows the higher value, ignoring ties by rethrowing. | Easy3 | ProbabilityMath+1 | No attempts yet | 1s | 512 MB | Judgeable |
| Vote (Small)Given N supporters of A and M of B, find the probability that A leads after every vote in a random arrival order. | Easy3 | MathProbability+1 | No attempts yet | 5s | 512 MB | Judgeable |
| What's Your Tier?Starting at 2000 points, play 20 games with given win, loss, and draw probabilities; compute the probability of ending in each of five tiers. | Easy3 | ProbabilityDynamic programming+2 | No attempts yet | 2s | 256 MB | Judgeable |
| ElectionGiven N total votes, M counted votes split as V1 and V2, and a threshold W, decide if the probability that candidate 1 wins (when each remaining vote is a fair coin) exceeds W%. | Easy3 | ProbabilityMath+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Password HackingGiven each password's probability of being correct, find the expected number of attempts when trying passwords in the order that minimizes it. | Easy3 | GreedySorting+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Good Day Bad DayGiven a two-state Markov chain's transition probabilities and a starting mood, compute the probability of each mood N days later and print each scaled by 1000. | Easy3 | ProbabilityDynamic programming+2 | No attempts yet | 1s | 256 MB | Judgeable |
| SoccerGiven per-interval scoring probabilities for two teams over 18 intervals, compute the probability that at least one team ends with a prime number of goals. | Medium4 | ProbabilityMath+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Tournament WinnerGiven all pairwise win probabilities among 8 players in a fixed single-elimination bracket, compute each player's probability of winning the whole tournament. | Medium4 | ProbabilityDynamic programming+2 | No attempts yet | 2s | 128 MB | Judgeable |
| CouponsCompute the expected number of purchases needed to collect all N coupon numbers, printing the result as an integer or reduced mixed fraction. | Medium4 | ProbabilityMath+1 | No attempts yet | 1s | 128 MB | Judgeable |
| HeadshotGiven a circular string of loaded/empty chambers, decide whether shooting immediately or re-spinning gives a lower chance of firing given the previous chamber was empty. | Medium4 | StringProbability+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Linear PachinkoFor each linear Pachinko string, compute the percentage chance that a ball dropped on a uniformly random character exits through a hole or off an end, truncated to an integer. | Medium4 | SimulationImplementation+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Suit DistributionFor each pair (a, b), compute the probability that the opponents' a+b cards of one suit split a and b between them. | Medium4 | CombinatoricsMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| BlackjackGiven n decks and three visible cards, compute the probability that the player's two-card hand beats the dealer's two-card hand. | Medium4 | MathCombinatorics+2 | No attempts yet | 1s | 128 MB | Judgeable |
| IndomieEach of the N people ahead takes a uniformly random remaining item among rice, sugar, and Indomie (Indomie limited to S). Find the probability Indomie remains for Felix, as a percentage. | Medium4 | ProbabilityCombinatorics+2 | No attempts yet | 1s | 128 MB | Judgeable |
| DartboardGiven ring radii and Gaussian spread, compute the expected dart score with averaged sector values and triple and double rings. | Medium4 | ProbabilityMath | No attempts yet | 1s | 128 MB | Judgeable |
| DrinksTwo players alternately draw balls without replacement until the first red ball appears, and you compute the chance the first player draws it. | Medium4 | ProbabilityDynamic programming+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Horn BlowingCompute the probability that the summed start-up delays of N vehicles with given discrete distributions total at most T seconds. | Medium4 | Dynamic programmingProbability | No attempts yet | 2s | 256 MB | Judgeable |
| Marketplace Board (Small)Free dice roll uniform faces while fixed dice stay put, and each cell scores from the longest equal run through it, so average the total over all outcomes. | Medium4 | Brute forceProbability+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Ball collisionsGiven N balls on a line, each picking a direction at random, find the expected number of collisions within time T. | Medium4 | ProbabilityBrute force+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Drawing PebblesGiven pebble counts per color, compute the probability that K randomly drawn distinct pebbles all share one color, printed to 10 decimals. | Medium4 | CombinatoricsMath+2 | No attempts yet | 2s | 512 MB | Judgeable |
| HamletGiven a DAG of plot states where each action gives a probability distribution over higher-numbered states, find the best expected value from state 1 and round it to two decimals. | Medium4 | Dynamic programmingProbability+2 | No attempts yet | 3s | 512 MB | Judgeable |
| DragsterGiven pairwise win probabilities and a binary elimination bracket, compute the probability that driver 1 wins the tournament. | Medium4 | ProbabilityTree+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Match PredictionGiven win/draw/loss probabilities for all six matches among four teams, compute each team's probability of finishing in the top two. | Medium4 | ProbabilityBrute force+2 | No attempts yet | 1s | 256 MB | Judgeable |
| Yogurt Expiration DatePick k yogurts with maximum total amount, break ties by minimizing the chance at least one is defective, and print that incident probability as a percentage. | Medium5 | GreedySorting+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Sevi GameGiven one roll of five dice, pick at least two dice to reroll so the expected score of a poker-dice scoring system is minimized, with ties broken lexicographically. | Medium5 | ProbabilityBrute force+2 | No attempts yet | 2s | 128 MB | Judgeable |
| Game, Set and MatchGiven the per-point win probability p, compute the probabilities of winning a tennis game, set, and match using the standard scoring rules. | Medium5 | Dynamic programmingProbability+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Minimal BackgammonSimulate turn by turn probability mass over board positions (with lose-a-turn and go-to-start squares, and bounce-back overshoot rule) to find probability of reaching the goal within T turns. | Medium5 | Dynamic programmingSimulation+1 | No attempts yet | 1s | 128 MB | Judgeable |
| PlinkoGiven rigged Plinko boards with per-peg right-move probabilities, compute for each start and end column the number of distinct paths and the truncated percentage chance. | Medium5 | Dynamic programmingProbability+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Great Geek Game-show 3000!Given a random permutation of N names, each contestant follows its cycle up to K steps; find the probability every cycle has length at most K. | Medium5 | CombinatoricsMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Yes or No?Pick between l and r questions to answer Yes, maximizing the sum of per-question expected correct probabilities, and report the maximum expectation to two decimals. | Medium5 | Dynamic programmingSorting+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SoccerCompute probability distribution of final scores after up to T seconds of a stochastic soccer simulation with passing, stealing, shooting, and absorbing states. | Medium5 | ProbabilityDynamic programming+2 | No attempts yet | 2s | 128 MB | Judgeable |
| MessageGiven error and succession probabilities for a Martian alphabet, find the most likely original word for each intercepted message using maximum likelihood. | Medium5 | Dynamic programmingProbability | No attempts yet | 1s | 128 MB | Judgeable |
| Hopeless CoachGiven past win, draw, and loss counts, find the probability that the team earns at least P points over the next N matches. | Medium5 | Dynamic programmingProbability+2 | No attempts yet | 1s | 128 MB | Judgeable |
| France '98Given win probabilities for every pair of 16 teams and a fixed bracket, compute each team's probability of winning the single-elimination tournament. | Medium5 | Dynamic programmingProbability+2 | No attempts yet | 1s | 128 MB | Judgeable |
| The Millionaire and the OrphansGiven three orphanages with fixed basket areas and children counts, compute the expected total gift value each orphanage catches as gifts are thrown in order. | Medium5 | ProbabilityMath+1 | No attempts yet | 1s | 1024 MB | Judgeable |
| Game DiceGiven up to 13 dice with various face counts and a target total, compute the probability of rolling exactly that sum, to five decimals. | Medium5 | Dynamic programmingProbability+1 | No attempts yet | 1s | 128 MB | Judgeable |
| FootballGiven pairwise win probabilities, find the team most likely to win a fixed single-elimination bracket of 2^n teams. | Medium5 | Dynamic programmingProbability+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Chocolate WholesalerGiven n independent bars with individual surprise probabilities, find the probability that a carton has at least k surprises. | Medium5 | ProbabilityDynamic programming | No attempts yet | 1s | 128 MB | Judgeable |
| Project staffingAssign at most n hired workers to m projects so the total expected profit from rewards, fines, and conditional wages is maximal. | Medium5 | Dynamic programmingProbability+1 | No attempts yet | 1s | 128 MB | Judgeable |
| ArcheryA ray from the origin fires in a uniform random direction, and the task asks the expected number of segments it pierces. | Medium5 | GeometryProbability | No attempts yet | 1s | 128 MB | Judgeable |
| The One Dollar GamblerStarting from one dollar, compute the expected capital after T fair coin bets of fraction F and round it to six decimal places. | Medium5 | ProbabilityMath | No attempts yet | 1s | 256 MB | Judgeable |
| Vampire DiceCompute the success probability of scoring at least y points from x exploding ten-sided dice where 8 to 10 score and 10 grants an extra roll. | Medium5 | ProbabilityDynamic programming | No attempts yet | 1s | 256 MB | Judgeable |
| RobberiesPick a subset of banks that maximizes the stolen money while the combined capture probability stays strictly below the given limit. | Medium5 | Dynamic programmingProbability | No attempts yet | 1s | 256 MB | Judgeable |
| Combat OddsGiven N independent battles with win chance p, compute the chance that a losing run of at least L occurs. | Medium5 | ProbabilityDynamic programming | No attempts yet | 1s | 256 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 |
| Typewriter Monkey (Small)Find the expected leftover bananas, which is the maximum achievable count of the target word minus its expected count in a random length S string. | Medium5 | ProbabilityBrute force+1 | No attempts yet | 5s | 512 MB | Judgeable |
| Typewriter MonkeyFrom keyboard letter frequencies, subtract the expected overlapping occurrences of a target word in a random length-S string from the maximum possible count. | Medium5 | ProbabilityString matching | No attempts yet | 5s | 512 MB | Judgeable |
| Password Problem (Large)Choose how many typed characters to keep or erase to minimize the expected keystrokes to finish a password with known per-character correctness odds. | Medium5 | ProbabilityPrefix sum+1 | No attempts yet | 5s | 512 MB | Judgeable |
| MazeBob moves through a multi-graph where each letter opens doors with that label; given the letter sequence, compute the probability he reaches room n, choosing uniformly among available matching doors. | Medium5 | ProbabilityDynamic programming+2 | No attempts yet | 2s | 512 MB | Judgeable |
| WindowPick a uniformly random axis-aligned subrectangle of an H by W grid; find the expected number of cells times 9, modulo 1e9+7. | Medium5 | MathCombinatorics+2 | No attempts yet | 1s | 512 MB | Judgeable |
| Spontaneous TripGiven flight counts between airports, find the most likely airport reached after exactly K random flights starting from ICN. | Medium5 | ProbabilityDynamic programming+1 | No attempts yet | 3s | 256 MB | Judgeable |
| EcologyCompute the probability that exactly M of N birds wear a tracker after D days of catching C random birds each day. | Medium5 | Dynamic programmingProbability+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Fleecing the RaffleAdd k slips with your name to a box of n slips so the chance your name is drawn exactly once among p draws is maximized. | Medium5 | MathCombinatorics+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Tri-duGiven two known card values, pick a third value from 1 to 13 that maximizes the chance of holding a winning triple or pair against one opponent. | Medium5 | MathProbability+1 | No attempts yet | 1s | 512 MB | Judgeable |
| VampiresGiven two life totals, a hit threshold and a fixed damage, find the probability that vampire 1 wins a turn-based drain fight. | Medium5 | ProbabilityDynamic programming+1 | No attempts yet | 2s | 512 MB | Judgeable |
| Vote (Large)Given N supporters of A and M of B in random arrival order, find the probability A leads after every vote; a ballot-problem computation. | Medium5 | CombinatoricsProbability+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Core Training (All Cores)With K = N, the AI works only if every core succeeds; split U training units among cores to maximize the product of final success probabilities. | Medium5 | GreedyMath+2 | No attempts yet | 5s | 512 MB | Judgeable |
| Front NineGiven a clamped random walk on [0,h] with step probabilities, compute the expected area under the piecewise-linear terrain over n steps. | Medium5 | ProbabilityDynamic programming+2 | No attempts yet | 6s | 512 MB | Judgeable |
| Probability that the knight stays on the boardA knight on an N by N board makes K random moves, each of the eight directions equally likely; find the probability it is still on the board after K moves. | Medium5 | Dynamic programmingProbability+2 | No attempts yet | 2s | 512 MB | Judgeable |
| Code CollectionGiven N possible codes and target K distinct codes, compute the expected number of independent uniform draws needed to collect at least K distinct codes, with N up to 10^18. | Medium6 | ProbabilityMath+1 | No attempts yet | 2s | 256 MB | Judgeable |
| Random RobotGiven move probabilities for E, W, S, N and up to 14 steps, compute the probability that the robot's random walk visits no grid cell twice. | Medium6 | Dynamic programmingBrute force+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Rock-Paper-ScissorsCompute, as a reduced fraction, the probability that Hangseung reaches K round wins before Dongju in at most N rounds of rock-paper-scissors with ties possible. | Medium6 | Dynamic programmingProbability+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Dice Battle GameGiven a defender count, simulate probabilistic dice battles to find the minimum starting attacker count achieving at least 50% win probability. | Medium6 | Dynamic programmingProbability+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Card GameGiven 9 piles of 4 cards, compute the probability that repeatedly removing a uniformly random matching-rank pair of top cards clears all cards. | Medium6 | ProbabilityDynamic programming+1 | No attempts yet | 2s | 128 MB | Judgeable |
| Choosing a PubSimulate probabilistic vote-following among n pubs (Pólya urn style) to compute exact final probability each pub wins, handling ties uniformly. | Medium6 | Dynamic programmingProbability+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Winning the MatchCompute the probability that team A wins a best-of-K volleyball match given per-serve win probabilities and a serve-switching rule between rounds and games. | Medium6 | Dynamic programmingProbability+1 | No attempts yet | 1s | 128 MB | Judgeable |
| Random WalkGiven n steps with probabilities of moving left, right, or staying, compute the expected value of the maximum position reached. | Medium6 | Dynamic programmingProbability+1 | No attempts yet | 10s | 128 MB | Judgeable |
| Cover UpGiven per-digit candidate lists with known-candidate probabilities, compute the win probability when the contestant plays optimally. | Medium6 | ProbabilityDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Up the AnteGiven per-round win probabilities, find the chance a capped martingale strategy shows a positive balance at some round from k through m. | Medium6 | ProbabilityDynamic programming+2 | No attempts yet | 1s | 128 MB | Judgeable |
| I'm Attacking the Darkness!Parse a dice expression with up to six dice and integer modifiers, then compute the reduced fraction of outcomes whose total meets or beats a target value. | Medium6 | Dynamic programmingProbability+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Monkeys at TypewritersGiven per-letter and space probabilities, find the probability that a random key sequence terminates at its first space in one of the given words. | Medium6 | ProbabilityTrie+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Orange BowlGiven plays with a yard gain and success probability, choose a sequence whose total gain reaches n yards while maximizing the product of probabilities. | Medium6 | Dynamic programmingMath+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Shut the Box IIGiven open cards and a rolled total, pick the set summing to the total that maximizes the probability of shutting every card under optimal play, and report that probability. | Medium6 | Dynamic programmingBacktracking+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Driving Out the PiggiesA bomb starts at city 1 of an undirected graph, detonates at each visit with probability P/Q and otherwise moves to a random neighbor; find the detonation probability for every city. | Medium6 | ProbabilityGraph+2 | No attempts yet | 1s | 128 MB | Judgeable |
| ChocolateFor C equally likely colors, after N draws where matching pairs are eaten, find the probability that exactly M colors remain on the table. | Medium6 | Dynamic programmingCombinatorics+2 | No attempts yet | 1s | 128 MB | Judgeable |
| To bet, or not to betGiven a board of movement and skip instructions, compute the probability the chip reaches End within T turns and decide the bet. | Medium6 | Dynamic programmingProbability+2 | No attempts yet | 1s | 128 MB | Judgeable |
| SoccerGiven 16 teams, a fixed bracket, and pairwise win probabilities, compute each team's probability of winning the single-elimination tournament. | Medium6 | Dynamic programmingProbability+2 | No attempts yet | 1s | 128 MB | Judgeable |
| Fare DodgingA commuter mixes per-track tickets priced from shortest distances with free rides that risk expected fines to minimize the expected cost from start to end. | Medium6 | Shortest pathGraph+1 | No attempts yet | 1s | 128 MB | Judgeable |
| WimbledonCompute the expected match length in minutes from each player's chance of winning a game on serve under best-of-five tennis scoring. | Medium6 | ProbabilityDynamic programming | No attempts yet | 1s | 128 MB | Judgeable |
| Colored Bead PlateRun up to 16 random bead drops and tilts on a 4x4 plate and report the probability that the final layout matches the target. | Medium6 | ProbabilitySimulation+1 | No attempts yet | 2s | 1024 MB | Judgeable |
| Expected Ultimate DamageThe champion casts the ultimate N times with random doubling or plus-one effects on attack and ability, and you compute the expected sum of their product. | Medium6 | ProbabilityMath | No attempts yet | 1s | 256 MB | Judgeable |
| Finding a LineDecide whether any single line passes through at least p percent of N given points. | Medium6 | ProbabilityGeometry+1 | No attempts yet | 4s | 256 MB | Judgeable |
| GG NO RE OMG CHEATZFind the fewest extra attacker units that lift the dice-battle win chance to at least 75 percent. | Medium6 | Dynamic programmingProbability+1 | No attempts yet | 3s | 256 MB | Judgeable |
| MonstersThree monster colors eat each other in a cycle when random mixed pairs meet, and you compute each color's chance to be the last one standing. | Medium6 | ProbabilityDynamic programming | No attempts yet | 2s | 256 MB | Judgeable |
| MillionaireDecide after each correct quiz answer whether to quit or continue so the expected log utility is maximal, then convert that utility into a dollar amount. | Medium6 | Dynamic programmingProbability+1 | No attempts yet | 2s | 256 MB | Judgeable |