Uploaded by miromostafa97

Problems Sheet

advertisement
Solving Paradigms
Brute Force
Iterative Brute Force
CF - 31A
Worms Evolution
very easy
UVa - 10041 Vito's Family
easy
UVa - 102
easy
Ecological Bin Packing
3 nested loops
UVa - 10487 Closest Sums
easy
2 nested loops
CF - 106B
easy
2 nested loops
UVa - 10365 Blocks
easy
2 nested loops
CF - 7A
Choosing Laptop
Kalevitch and Chess
easy
UVa - 386
Perfect Cubes
easy
3 nested loops
UVa - 11621 Small Factors
easy
2 nested loops
UVa - 617
Nonstop Travel
easy
2 nested loops
UVa - 154
Recycling
easy
3 nested loops, input parsing
UVa - 703
Triple Ties: The Organizer's Nightmare
easy
3 nested loops, sortings
UVa - 10483 The Sum Equals the Product
easy
3 nested loops, pruning
UVa - 435
Block Voting
7.0
easy
2 nested loops, bitmasks
UVa - 10662 The Wedding
easy
3 nested loops
UVa - 11205 The broken pedometer
easy
2 nested loops, bitmasks
UVa - 11342 Three-square
easy
3 nested loops, preprocessing
UVa - 1237
Expert Enough?
easy
UVa - 1260
Sales
easy
UVa - 735
Dart-a-Mania
easy
CF - 25A
IQ test
easy
CF - 231A
Team
easy
CF - 214A
System of Equations
easy
CF - 520A
Pangram
easy
CF - 189A
Cut Ribbon
easy
UVa - 725
Division
easy
UVa - 441
Lotto
easy
solution without doubles
specialists
UVa - 11565 Simple Equations
easy
UVa - 11742 Social Constraints
easy
UVa - 12455 Bars
easy
UVa - 256
Quirksome Squares
easy
CF - 443B
Kolya and Tandem Repeat
easy
CF - 316E1
Summer Homework
easy
CF - 18C
Stripe
easy
CF - 698A
Bets
easy
CF - 94B
Friends
easy
CF - 38B
Chess
easy
CF - 30A
Accounting
easy
CF - 29A
Spit Problem
easy
CF - 32A
Reconnaissance
easy
CF - 88A
Chord
easy
CF - 38C
Blinds
easy
CF - 53A
Autocomplete
easy
UVa - 443
Humble Numbers
easy
generator
UVa - 640
Self Numbers
easy
generator, pruning
CF - 977B
Two-gram
easy
linear
CF - 908B
New Year and Buggy Bot
easy
grids, simulation
CF - 58C
Trees
O(1) solution exists
specialists
seenX
medium
specialists
UVa - 11959 Dice
medium
CF - 653C
Bear and Up-Down
medium
3 nested loops, dices
CF - 63C
Bulls and Cows
medium
CF - 300B
Coach
medium
UVa - 305
Joseph
medium
hardcoding, Josephus problem variant
CF - 231C
To Add or Not to Add
medium
sortings
CF - 1175C
Electrification
medium
greedy
specialists
UVa - 11548 Blackboard Bonanza
hard
4 nested loops
UVa - 11464 Even Parity
hard
plus greedy, bitmasks
UVa - 10309 Turn the Lights Off
hard
plus greedy
important
11.0
important, first row brute force and rest follows
specialists
important, first row brute force and rest follows
Recursive Brute Force (Backtracking)
UVa - 524
Prime Ring Problem
easy
UVa - 167
The Sultan's Successors
easy
UVa - 624
CD
easy
pupils
pupils
pupils
UVa - 10360 Rat Attack
easy
backward attack
pupils
UVa - 12346 Water Gate Management
easy
knapsack
pupils
UVa - 12249 Overlapping Scenes
easy
permutation
UVa - 487
easy
pruning, treemaps, comparator
UVa - 10475 Help the Leaders
easy
treemaps, sortings
UVa - 11515 Cranes
easy
bitmasks, geometry
UVa - 131
The Psychic Poker Player
easy
cards, bitmasks
UVa - 234
Switching Channels
easy
permutation
UVa - 639
Don't Get Rooked
easy
boards
UVa - 296
Safebreaker
easy
CF - 121A
Lucky Sum
easy
CF - 371C
Hamburgers
easy
UVa - 729
The Hamming Distance Problem
Boggle Blitz
max suffix matching prefix
specialists
filtered
nice: for larger N, solvable with bipartite matching
lucky numbers generation
solvable with binary search
easy
2.0
UVa - 10344 23 out of 5
easy
2.0
CF - 80C
Heroes
easy
CF - 55B
Smallest number
CF - 114B
PFAST Inc.
CF - 96B
Lucky Numbers (easy)
medium
UVa - 1251
Repeated Substitution with Sed
medium
easy
easy
bitmasks
pupils
UVa - 11201 The problem of the crazy linguist
medium
preprocessing
pupils
UVa - 1064
medium
permutation, simulation
pupils
Network
UVa - 12515 Movie Police
medium
UVa - 750
medium
8 Queens Chess Problem
pupils
hard
compact graph, bitmasks
UVa - 989
hard
pruning
UVa - 10957 So Doku Checker
hard
pruning
UVa - 165
Stamps
solvable with bfs, complexity analysis: factorial not exponential
pupils
UVa - 11065 A Gentlemen's Agreement
Sudoko
tedious implementation
hard
plus DP
UVa - 10890 Maze
hard
pruning
UVa - 10950 Bad Code
hard
UVa - 10582 ASCII Labyrinth
hard
count, input parsing, pruning
Week test cases. My solution TLEs in worst case
CF - 68C
hard
pruning
GYM - 100863 Exhibition
(E)
Hall
hard
pruning, geometry
CF - 285D
Synchrophasotron
hard
pruning, hardcoding
easy
bfs, sieve
specialists
Permutation Sum
complementary recursive functions, difficulty in proving complexity, solvable with DP
proof ans = 0 for even n
meet-in-the-middle solution
State-Space Search
UVa - 12101 Prime Path
UVa - 652
Eight
medium
preprocessing, bfs, backward attack, grids,
permutations
specialists
UVa - 321
The New Villa
medium
bfs, bitmasks
specialists
UVa - 1253
Infected Land
hard
bfs, grids
specialists
Greedy
CF - 1003A
Polycarp's Pockets
very easy
CF - 1148A
Another One Bites The Dust
very easy
CF - 597B
Restaurant
easy
classical problem
CF - 261A
Maxim and Discounts
easy
sortings
UVa - 11520 Fill the Square
easy
grids
CF - 159B
Matchmaker
easy
two pointers
CF - 154A
Hometask
easy
CF - 701A
Cards
easy
UVa - 10057 A mid-summer night's dream.
easy
median
UVa - 11240 Antimonotonicity
easy
sequences, permutations
UVa - 11824 A Minimum Land Price
easy
sortings
UVa - 11532 Simple Adjacency Maximization
easy
bit manipulation
UVa - 11039 Building designing
easy
sortings, two pointers
CF - 65B
easy
Harry Potter and the History of Magic
UVa - 11054 Wine trading in Gergovia
easy
UVa - 11389 The Bus Driver Problem
easy
CF - 3B
pupils
7.0
registeration
specialists
balabizoo^3
solvable with DP
has O(n * log maxDate) solution in case that dates can reach 1e9
10.2
Lorry
easy
sortings
UVa - 11292 Dragon of Loowater
easy
sortings, two pointers
CF - 673B
Problems for Round
easy
CF - 26B
Regular Bracket Sequence
easy
bracket matching
UVa - 673
Parentheses Balance
easy
bracket matching
UVa - 11111 Generalized Matrioshkas
easy
bracket matching
UVa - 551
Nesting a Bunch of Brackets
easy
bracket matching
CF - 350C
Bombs
easy
sortings, manhattan distance
CF - 33A
What is for dinner?
easy
CF - 27C
Unordered Subsequence
easy
CF - 17B
Hierarchy
easy
SPOJ - AMR10G
Christmas Play
easy
CF - 205B
Little Elephant and Sorting
easy
CF - 376B
I.O.U.
easy
CF - 215D
Hot Days
easy
CF - 413C
Jeopardy!
easy
sortings
CF - 22D
Segments
easy
intervals
CF - 769B
News About Credit
easy
sortings
CF - 777B
Game of Credit Cards
easy
sortings
CF - 1176B
Merge it!
nice
specialists
sortings
seenX
pupils
easy
UVa - 10440 Ferry Loading II
medium
CF - 250C
Movie Critics
medium
CF - 354A
Vasya and Robot
medium
UVa -1605
backward attack, simulation
cumulative sum, brute force
Building for UN
medium
UVa - 10382 Watering Grass
medium
interval covering
UVa - 410
Station Balance
medium
load balancing
CF - 253C
Text Editor
medium
CF - 67A
Partial Teacher
medium
CF - 93B
End of Exams
medium
CF - 95B
Lucky Numbers
medium
CF - 58D
Calendar
medium
CF - 515D
Drazil and Tiles
medium
CF - 427E
Police Patrol
medium
CF - 723C
Polycarp at the Radio
medium
CF - 313C
Ilya and Matrix
medium
CF - 219C
Color Stripe
medium
CF - 754D
Fedor and coupons
medium
intervals
CF - 137C
History
medium
intervals
CF - 291D
Parallel Programming
medium
CF - 223A
Bracket Sequence
medium
bracket matching
CF 746E
Numbers Exchange
medium
sets
CF - 257D
Sum
medium
math
needs careful double handling
sortings, comparator, strings
m > 1 is equivalent to the well-known problem m = 1 (see comments in editorial)
sortings
solution pattern: split into segments
important, new idea in printing the solution
specialists
GYM - 100016D
Group Stage
medium
GYM - 100247IMeteor Flow
medium
priorityqueues
CF - 863E
Turn Off The TV
medium
bracketing & events
CF - 557C
Arthur and Table
medium
sortings
CSA
Gerrymandering
medium
CF - 773C
Prairie Partition
medium
CF - 1148D
Dirty Deeds Done Dirt Cheap
medium
CF - 533E
Correcting Mistakes
hard
CF - 89A
Robbery
hard
CF - 496E
Distributing Parts
hard
sortings, sets, intervals
CF - 226B
Naughty Stone Piles
hard
sortings, preprocessing
↗
nice editorial solution with binary search
sortings
solvable with dp or hashing
experts
Binary Search
UVa - 10611 The Playboy Chimp
very easy
pupils
UVa - 12032 The Monkey and the Oiled Bamboo
easy
UVa - 11428 Cubes
easy
two pointers
UVa - 10566 Crossed Ladders
easy
bisection method
CF - 702C
Cellular Network
easy
two pointers
UVa - 1079
A Careful Approach
easy
brute force, greedy
UVa - 714
Copying Books
easy
greedy
CF - 79B
Colorful Field
easy
CF - 567D
One-Dimensional Battle Ships
UVa - 10170 The Hotel with Infinite Rooms
CF - 68B
Energy exchange
composite
easy
easy
medium
UVa - 10341 Solve it
medium
UVa - 12192 Grapevine
medium
UVa - 10372 Leaps Tall Buildings (in a single bound)
medium
CF - 817C
medium
Really Big Numbers
famous puzzle
pupils
observation: any extra can be discarded for k > 0 and will not be optimal for k = 0
physics
specialists
solvable with digit DP
GYM - 100247F
Battle Fury
medium
CF - 551C
GukiZ hates Boxes
medium
greedy predicate
CF - 535C
Tavas and Karafs
medium
math, induction proofs
pupils
CF - 140C
New Year Snowmen
medium
treemaps
CF - 1063C
Dwarves, Hats and Extrasensory Abilities
medium
CF - 377B
Preparing for the Contest
hard
CF - 590B
Chip 'n Dale Rescue Rangers
hard
CF - 343C
Read Time
hard
pupils
solvable with greedy
seen
interactive
pupils
Dynamic Programming
Max 1D Range Sum
CF - 75D
Big Maximum Sum
medium
CF - 331A2
Oh Sweet Beaverette
medium
prefix/suffix processing
specialists
nice editorial solution
specialists
solvable without treemaps by considering only leftmost and rightmost intervals
Max 2D Range Sum
UVa - 10667 Largest Block
easy
UVa - 10502 Counting Rectangles
easy
binary search
UVa - 10534 Wavio Sequence
easy
O(n log n) solution
Topcoder
IntegerSequence
easy
Topcoder
AutoMarket
easy
UVa - 340D
Bubble Sort Graph
easy
weak test cases
Longest Increasing Subsequence (LIS)
UVa - 10131 Is Bigger Smarter?
CF - 4D
Mysterious Present
similar to Wavio Sequence
treesets, inversion index
easy
easy
SPOJ - MSTICK
Wooden Sticks
medium
UVa - 11368 Nested dolls
medium
CF - 67D
Optical Experiment
specialists
sortings
LIS duality: sort all the pairs (W, H) W ascending, H descending, then find the longest non-increasing subsequence.
medium
LDS with binary search/segment tree (log n)
specialists
important
UVa - 11456 Trainsorting
medium
LIS and LDS
specialists
important
CF - 10D
LCIS
medium
dp, hashmaps
CF - 269C
Greenhouse Effect
medium
important, easily solvable with normal DP
SPOJ - SUPPER
Supernumbers in a permutation
hard
Topcoder
BridgeArrangement
hard
CF - 76F
Tourist
hard
geometric transformations
UVa - 1196
Tiling Up Blocks
hard
segment/fenwick tree
specialists
geometry, SSSP on DAG
specialists
SPOJ - MCARDS
Card Sorting
hard
Knapsack
UVa - 1250
Robot Challenge
easy
CF - 18D
Seller Bob
easy
SPOJ - FARIDA
Princess Farida
easy
ASC 11 - H
Saving Princess
medium
CF - 425A
Sereja and Swaps
medium
solvable with a greedy solution
flag
↗
solvable in O(n*h*s), p can be computed
from n and s, instead of checking if a valid answer exist (in such case, parameter m is need), you can minimize on m
dimension compression
specialists
GYM - 100016JTaxi
medium
printing the solution
SPOJ - LAZYCOWS
Lazy Cows
medium
coordinate compression
CF - 730J
Bottles
hard
plus greedy
CF - 95E
Lucky Country
hard
variant, items grouping, connected components
solvable in O(n^3 log n) using bruteDP
force
solution
and sortings
simple solution
O(n^3) Solution
Coin Change
UVa - 10626 Buying Coke
medium
dimension compression, state compression
important
Probabilities
Yandex 16
Table Tennis Tournament
easy
CF - 167B
Wizards and Huge Prize
easy
Numeric Compression
easy
↗
knapsack, offsets
add to specialists state can be optimized from (n * l * (2n)) to (n * l * n) by sorting tours
Bitmasks
Yandex 16
UVa - 11974 Switch The Lights
easy
UVa - 10503 The dominoes solitaire
easy
CF - 580D
Kefa and Dishes
↗
knapsack
easy
seenX
fact: enough to use switches at most once, solvable with bfs state-space search
seenX
UVa - 10364 Square
medium
dimension compression
specialists
solvable with backtracking
UVa - 10318 Security Panel
medium
grids
specialists
solvable with backtracking (CP hint)
UVa - 10149 Yahtzee
medium
dimension compression, tedious
UVa - 11472 Beautiful Numbers
medium
number systems, preprocessing
CF - 8C
medium
Looking for Order
SPOJ - HIST2 Histogram
specialists
specialists
dp body must be optimized to pass time limit
medium
UVa - 11832 Account Book
hard
offset, printing the solution
UVa - 10032 Tug of War
hard
knapsack variant, optimization with bitmasks
need bitmasks for printing the solution efficiently
Digits
UVa - 11258 String Partition
easy
CF - 509C
Sums of Digits
easy
CF - 58E
Expression
hard
heavy implementation
leading zeros handling as DP goes from right to left, solvable with dijkstra
CF - 431D
Random Task
hard
binary search, combinatorics
specialists
proving montonicity of binary search
nice
is critical
editorial solution
easy
DAGs
medium
DAGs
generate function that memoizes invalid paths so it won't try them again, solvable with greedy
Grids and Paths
UVa - 926
Walking Around Wisely
UVa - 10874 Segments
CF - 2B
The least round way
hard
print solution
easy
bfs, grids
specialists
zero special case
TSP
UVa - 10944 Nuts for nuts..
UVa - 11405 Can U Win?
medium
bfs, preprocessing
UVa - 10937 Blackbeard the Pirate
medium
bfs, grids
composite
balabizoo^1
Bitonic TSP
UVa - 1347
Tour
easy
UVa - 1096
The Islands
easy
Alyona and Strings
Strings
CF - 682D
easy
edit distance
UVa - 10405 Longest Common Subsequence
easy
LCS
UVa - 164
String Computer
easy
edit distance, print the solution
UVa - 526
String Distance and Transform Process
easy
edit distance, print the solution
CF - 56D
Changing a String
easy
edit distance, print the solution
UVa - 10100 Longest Match
easy
LCS
UVa - 10739 String to Palindrome
easy
edit distance, palindromes
UVa - 11151 Longest Palindrome
easy
palindromes, two pointers
UVa - 1207
easy
edit distance
UVa - 10453 Make Palindrome
AGTC
easy
palindromes, two pointers
UVa - 11552 Fewest Flops
easy
frequency count
UVa - 11022 String Factoring
easy
SPOJ - AIBOHP
Aibohphobia
easy
palindromes, two pointers
UVa - 10635 Prince and Princess
medium
LCS, LIS
CF - 137D
medium
palindromes, two pointers, printing the solution
Palindromes
10.4
composite
CF - 159D
Palindrome pairs
medium
CF - 835D
Palindromic characteristics
medium
palindromes (check and count)
Tiling (Counting)
UVa - 10918 Tri Tiling
UVa - 11471 Arrange the Tiles
ASC 10 - E
Long Dominoes
GYM - 100204BHexagon and Rhombic Dominoes
easy
medium
hard
(bitmasks)
balabizoo^1
bitmasks, tiling
solvable with backtracking by reducing search space by group tiles of the same type
base number systems
good problem to handle masks for ↗
base number systems > 2
hard
work on half and combine by counting
best solution
DP involving graphs
UVa - 976
Bridge Building
UVa - 868
Numerical Maze
SPOJ - CLEANRBT
Cleaning Robot
easy
flood fill, grids
easy
grids, bfs
important, fancy
bitmasks, bfs
composite
medium
11.1
DP speed-up with matrix power
UVa - 10229 Modular Fibonacci
easy
1D recurrence, basic
ASC 1 - E
easy
2D recurrence, bitmasks
UVa - 10518 How Many Calls?
easy
1D recurrence with constant term
UVa - 10870 Recurrences
Nice Patterns Strike Back
easy
1D recurrence, standard
easy
1D recurrence, standard
UVa - 12470 Tribonacci
CF - 222E
easy
2D recurrence
UVa - 10655 Contemplation! Algebra
Decoding Genome
medium
1D recurrence
UVa - 11486 Finding Paths in Grid
medium
2D recurrence, combinations
CF - 621E
medium
2D recurrence, modular arithmetic
Codechef - WW2
World War 2
medium
2D recurrence, different T matrices
CF - 582B
Once Again...
medium
maximization, paths in graph
SPOJ - SPP
Recursive Sequence (Version II)
medium
Wet Shark and Blocks
↗
solvable with lis and DP on DAGs
DP speed-up with convex hull
CF - 319C
Kalila and Dimna in the Logging Industry
ASC 43 - I
IQ Test
easy
easy
SPOJ - ACQUIRE
Land Acquistion
medium
SPOJ - APIO10A
Commando
medium
SPOJ-NKLEAVES
Leaves
medium
CF - 311B
medium
Cats Transport
solvable in O(n^2)
↗
NOTE: bad test data, to avoid overflow either use doubles (not recommended) or compare L3/L2 and L1/L2 instead of L3/L1 and L1/L2 (some kind of 7afraka though it's acceptable with such silly judge)
DP speed-up with Divide and Conquer Optimization
HackerRank
Guardians of the Lunatics
easy
CF - 321E
Ciel and Gondolas
easy
Codechef - CHEFAOR
Chef and Bitwise OR Operation
hard
WF 2016
hard
Branch Assignment
↗
must be solved in O(KN) for full score, observation: A function is monotonic row and column wise, so telescoping series can reduce search space (same idea of knuth's optimization but table must be filled in different order)
↗
graphs
DP speed-up with Knuth Optimization
UVa - 10304 Optimal Binary Search Tree
SPOJ - BRKSTRNG
Breaking String
ASC 10 - C
Order-Preserving Codes
easy
easy
TLE java
↗
medium
DP speed-up with Data Structures
HackerRank
Billboards
medium
priority queue
CF - 314C
Sereja and Subsequences
medium
fenwicktree, counting, sequences
↗
Non Classical
UVa - 11703 sqrt log sin
very easy
UVa - 10003 Cutting Sticks
easy
UVa - 104
easy
Arbitrage
UVa - 10482 The Candyman Can
easy
UVa - 11407 Squares
easy
UVa - 10069 Distinct Subsequences
easy
UVa - 222
easy
Budget Travel
preprocessing
8.2
solvable with floyd-warshall
dimension compression
counting
UVa - 10081 Tight Words
easy
counting, BigDecimal
UVa - 11002 Towards Zero
easy
offset
CF - 698A
Vacation
easy
CF - 706C
Hard problem
easy
CF - 82D
Two out of Three
easy
GYM - 100201D
Yet Another Digit
easy
CF - 855B
Marvolo Gaunt's Ring
easy
UVa - 1244
Palindromic paths
medium
DAGs, two pointers, palindromes, special return type,
print the solution
UVa - 882
printing the solution
The Mailbox Manufacturers Problem
medium
egg dropping
UVa - 10271 Chopsticks
medium
greedy selection
UVa - 10177 (2/3/4)-D Sqr/Rects/Cubes/Boxes?
medium
hardcoding, combinatorics, inclusion-exclusion
principle
UVa - 10419 Sum-up the Primes
medium
sieve, print the solution, compare function design
UVa - 10690 Expression Again
medium
bottom-up, subset sum
UVa - 11701 Cantor
medium
circular recurrence handling, number systems
CF - 132C
Logo Turtle
medium
UVa - 1240
ICPC Team Strategy
medium
bitmasks
CF - 33C
Wonderful Randomized Sum
medium
prefixes and suffixes
CF - 321B
Ciel and Duel
medium
DP idea
CF - 466D
Increase Sequence
medium
counting
CF - 393D
Tower of Hanoi
medium
SPOJ - MIXTURES
Mixtures
medium
CF - 225C
Barcode
medium
CF - 404D
Minesweeper 1D
medium
CF - 383D
Antimatter
medium
offsets, counting
GYM - 100200F
Think Positive
medium
printing the solution
Topcoder
EncodingTrees
medium
counting
CF - 999F
Cards and Joy
medium
CF - 933A
A Twisty Movement
medium
brute force
CF - 909C
Python Indentation
medium
counting
CF - 1000D
Yet Another Problem On a Subsequence
medium
CF - 1114D
Flood Fill
medium
CF - 1176F
Destroy it!
medium
CF - 855E
Salazar Slytherin's Locket
hard
CF - 13C
Sequence
hard
UVa - 10029 Edit Step Ladders
hard
UVa - 11285 Exchange Rates
hard
UVa - 711
Dividing up
hard
CF - 279E
Beautiful Decomposition
hard
ASC 36 - B
Divisible Substrings
very hard
solvable with doubles
seen
seenX
10.0
important
solvable with mathematical formulas (generating functions and perturbation)
malformed input: has empty lines
important
Matrix Chain Multiplication, prefix sum
offset trick for complexity O(nm + m (y-x)) instead of O(nm + my)
neat implementation
nice technique: has D&C + DP solution, check editorial
tutorial: nice correlation with LCS
mod state
masks, digits
trie
composite, Malformed input: has uppercase letters
important
solvable with backtracking + search space reduction
solvable with greedy
↗
grammars, modular arithmetic, D&C
Other Techniques
UVa - 11536 Smallest Sub-Array
easy
sliding window
pupils
constraints: K >= 1
UVa - 1121
easy
sliding window
pupils
if no answer print 0
Subsequence
solvable with backtracking and pruning
solvable with greedy
CF - 701C
They Are Everywhere
easy
sliding window
CF - 378B
Semifinals
easy
two pointers
CF - 239B
Easy Tape Programming
easy
next processing
CF - 190C
STL
easy
recursion, EBNF
UVa - 442
Matrix Chain Multiplication
easy
D&C, EBNF, bracket matching
CF - 224B
Array
medium
D&C, constructive algorithms
CF - 69E
Subsegments
medium
sliding window, treemaps, treesets
CF - 57B
Martian Architecture
medium
lazy processing
CF - 89C
Chip Play
medium
path compression, brute force, grids
CF - 56E
Domino Principle
medium
path compression, sortings
CF - 375B
Maximum Submatrix 2
medium
next processing, brute force
CF - 279C
Ladder
medium
next processing
CF - 237C
Primes on Interval
medium
sliding window, primes
CF - 1148B
Born This Way
medium
two pointers
CF - 1175C
Array Splitting
medium
prefix sum, sortings
GYM - 100008D
Largest Square
medium
sliding window
CF - 1175E
medium
binary lifting, lazy update
GYM - 100197D
Little Jumper
hard
ternary search, projectile trajectory
CF - 888G
hard
D&C, constructive algorithms
Xor-MST
solvable with simulation
easy
GYM - 100201IRailroad Sort
Minimal Segment Cover
pupils
pupils
solvable with binary search + prefix sum
pupils
Boruvka's algorithm
Data Structures
Linear Data Structures
1D Array Manipulation
CF - 236A
Boy or Girl
easy
1D Array manipulation
UVa - 10050 Hartals
easy
CF - 988A
Diverse Team
easy
boolean arrays
CF - 1015A
Points in Segments
easy
boolean arrays
CF - 66E
Petya and Post
hard
pupils
specialists
2D Array Manipulation
UVa - 10908 Largest Square
easy
UVa - 11975 Tele-loto
easy
UVa - 11581 Grid Successors
easy
simulation, bitmasks
UVa - 201
easy
brute force
Squares
walk on square cantor
UVa - 12398 NumPuzz I
easy
UVa - 12187 Brothers
easy
UVa - 11835 Formula 1
easy
brute force
CF - 90B
African Crossword
easy
implementation, strings
UVa - 541
Error Correction
CF - 411B
Multi-core Processor
CF - 706E
Working routine
pupils
pupils
medium
hard
reference manipulation
Stack
CF - 547B
Mike and Feet
medium
effective range of a point
important
CF - 5C
Longest Regular Bracket Sequence
medium
bracketing
important
CF - 601B
Lipshitz Sequence
medium
effective range of a point
CF - 817D
Imbalanced Array
medium
Queue
UVa - 12100 Printer Queue
easy
UVa - 11034 Ferry Loading IV
easy
UVa - 127
"Accordian" Patience
UVa - 10901 Ferry Loading III
easy
easy
stacks, references
specialists
simulation
SPOJ - BRICKS
New bricks disorder
medium
frequency count, counting
CSA
Minimize Max Diff
medium
modified queue
CF - 788A
Functions again
medium
modified queue
Code note: don't add the mod, overflow works!
↗
Deque
UVa - 12207 That is Your Queue
easy
UVa - 11491 Erasing and Winning
medium
greedy
UVa - 11760 Brother Arif, Please feed us!
easy
bitsets
CF - 60A
easy
bitsets
Bit Manipulation
Where Are My Flakes?
UVa - 11933 Splitting Numbers
easy
CS
easy
Max Or Subarray
GYM - 100863 Lamps
(L)
of the Mind
hard
pupils
↗
bitsets (own library), brute force
Non-linear Data Structures
UVa - 11849 CD
treesets
pupil
easy
treemaps, prefix sum
pupils
Chat Order
easy
treesets
pupils
UVa - 11286 Conformity
easy
treemaps
UVa - 10138 CDVII
easy
treemaps, sortings, implementation
UVa - 11136 Hoax or what
easy
treemaps
UVa - 10282 Babelfish
easy
treemaps
UVa - 11062 Andy's Second Dictionary
easy
treesets
UVa - 11967 Hic-Hac-Hoe
easy
treesets, infinite grids, brute force
CF - 105A
Transmigration
easy
treemaps
CF - 702B
Powers of Two
easy
treemaps, brute force
CF - 75B
Facetook Priority Wall
easy
treemaps, sortings, implementation
CF - 87B
Vasya and Types
easy
tree/hashmaps
UVa - 156
Ananagrams
easy
treemaps, anagrams
CF - 205D
Little Elephant and Cards
easy
treemaps, treesets
CF - 808D
Array Division
easy
hashsets
CF - 436A
Feed with Candy
medium
priority queues
CF - 721D
Maxim and Array
medium
priority queues, constructive algorithm
CF - 681C
Heap Operations
medium
priority queues, greedy
CF - 1005E1 Median on Segments (Permutations Edition)
medium
treemaps, arrays, ranges, counting
CF - 220C
Little Elephant and Shifts
medium
treesets, maps, cyclic shifts
CF - 3D
Least Cost Bracket Sequence
CF - 519D
A and B and Interesting Substrings
CF - 637B
very easy
hard
priority queues, greedy, bracketing
pupils
pupils
specialists
pupils
specialists
specialists
specialists
key idea: try a solution, then optimize, important
Union-Find Disjoint Sets
UVa - 10583 Ubiquitous Religions
easy
UVa - 11474 Dying Tree
easy
UVa - 1197
easy
The Suspects
GYM - 100008A
Bridges and Tunnels
specialists
brute force, geometry
specialists
specialists
easy
UVa - 10608 Friends
medium
specialists
CF - 28B
medium
specialists
pSort
Timus - 1671 Anansi's Cobweb
medium
CF - 25D
medium
Roads not only in Berland
SPOJ - CHAINStrange Food Chain
hard
CF - 553C
Love Triangles
reverse the problem
specialists
hard
bipartite graphs
Timus - 1003 Parity
hard
next processing
experts
CF - 659F
hard
grids, bfs, sortings
experts
Polycarp and Hay
cleaner solution
Fenwick Trees (Binary-Indexed Trees / BIT)
UVa - 12086 Potentiometers
CF - 459D
Pashmak and Parmida's problem
CF - 597C
Subsequences
easy
easy
medium
TC - floatingMedian
Floating Median
medium
CF - 137E
medium
Last Chance
↗
findIndex
Timus - 1470 UFOs
medium
3D Fenwick Trees, Points in Space
CF - 589G
Hiring
medium
binary search, two fts
CF - 961E
Tufurama
medium
counting
UVa - 11610 Reverse Prime
hard
sieve, binary search
GYM - 100247K
Three Contests
hard
D&C
nice replacement for pq with events&sortings
composite
Segment Trees
UVa - 12532 Interval Product
easy
8.1
solvable with two BITs (one to count zeros and other to count ones)
CF - 482B
Interesting Array
easy
CF - 339D
Xenia and Bit Operations
easy
CF - 91B
Queue
easy
range compression
CF - 242E
XOR on Segment
easy
lazy propagation
Timus - 1846 GCD 2010
lazy propagation, prefix sum
Nice Editorial Solution
8.1
solvable with binary search
easy
CF - 52C
Circular RMQ
CF - 292E
Copying Data
CF - 474F
Ant colony
medium
number theory
CF - 380C
Sereja and Brackets
medium
lazy propagation, prefix sum, merging
CF - 555C
Case of Chocolate
medium
coordinate compression
UVa - 1232
SKYLINE
medium
HackerRank
Cat-cation Rentals
medium
HackerRank
Similar Pair
medium
CF - 629D
Babaei and Birthday Cake
medium
easy
lazy propagation
easy
UVa - 11402 Ahoy, Pirates!
medium
CF - 558E
A Simple Task
medium
CF - 448C
Painting Fence
medium
8.3
8.1
offline, lazy propagation
LIS with segment trees
unsolved
↗
general day
↗
8.3
8.3
frequency count
solvable with DP or greedy in O(n^2). Segment tree for O(n log n) solution
HackerEarth Monk meets Dynamic Array
medium
LIS, modifed stacks
CF - 817F
MEX Queries
medium
range compression
CF - 620E
New Year Tree
medium
CF - 671C
Ultimate Wierdness
hard
↗
solvable with treesets
unsolved
UVa - 12669 Blogger Language
hard
UVa - 11990 "Dynamic" Inversion
hard
segment + fenwick tree
HackerRank
hard
segment trees, number theory, stacks
Boxes for Toys
8.3
nice solution
↗
experts
Quad Trees
UVa - 297
Quadtrees
UVa - 11297 Census
easy
8.1
medium
solvable with 2D segment trees
Sparse Table
UVa - 11235 Frequent Values
easy
RMQ
specialists
UVa - 12674 Go up the ultras
medium
RMQ
specialists
gcd, preprocessing
specialists
CF - 475D
CGCDSSQ
hard
solvable with segment trees: combine Node(prefix, suffix, occ, first_elem, last_elem)
nice editorial solution
Static RSQ (Prefix Sum)
UVa - 10706 Number Sequence
UVa - 12028 A Gift from the Setter
CF - 706B
Interesting drink
GYM - 100200F
Think Positive
CF - 675C
Money Transfers
GYM - 100247C
Victor's Research
easy
easy
sortings
easy
easy
solvable with offsets
medium
medium
Sortings
Inversion Index
UVa - 299
Train Swapping
very easy
UVa - 612
DNA Sorting
very easy
solvable with bubble sort
very easy
solvable with bubble sort
UVa - 10327 Flip Sort
SPOJ - INVCNT
Inversion Count
easy
UVa - 10810 Ultra-QuickSort
easy
UVa - 11495 Bubbles and Buckets
UVa - 11858 Frosh Week
pupils
easy
solvable with bubble sort
pupils
best one
pupils
nice
easy
HackerRank
Larry's Array
medium
CF - 540E
Infinite Inversions
medium
fenwick trees, treemaps/sets
CF - 61E
Enemy is weak
medium
mergesort, coordinate compression
↗
pupils
Others
CF - 652B
z-sort
easy
UVa - 12049 Just Prune The List
easy
greedy, two pointers
UVa - 450
easy
input parsing, output formatting, time waster
easy
counting sort
easy
bubble sort
Little Black Book
UVa - 11462 Age Sort
CF - 686B
Little Robber Girl's Zoo
pupils
UVa - 11269 Setting Problems
medium
compare function design
CF - 1043E
medium
counting, greedy, math
Train Hard, Win Easy
solvable with multisets
pupils
pupils
experts
Other Data Structure
UVa - 1241
Jollybee Tournament
Topcoder
RedBlack
medium
RedBlackTree with Twists
Topcoder
DirectoryTree
medium
easy
heap
trees with pointers
balabizoo^1
Binary Trie
CF - 706D
Vasiliy's Multiset
CF - 817E
Choosing The Commander
easy
XORing
easy
experts
SPOJ - SUBXOR
SubXor
medium
XORing
UVa - 11590 Prefix Lookup
medium
counting
CF - 282E
Sausage Maximization
medium
XORing
CF - 665E
Beautiful Subarrays
medium
XORing
HackerRank
Vankey and his Interview
hard
XORing
Solution with BitVector
SQRT Decomposition
CF - 617E
XOR and Favorite Number
medium
mo
Treaps
SPOJ - HORRIBLE
Horrible Queries
easy
GYM - 100488L
Two Heads Are Better
easy
Codechef - PALINDR
Lucy and Palindromes
medium
POJ
SuperMemo
medium
CF
T-shirts
hard
easily solvable with segment trees
solvable with stacks and deque
combinatorics
↗
Graphs
Basic Algorithms
CF - 540C
easy
flood fill
UVa - 10004 Bicoloring
easy
Bipartite Graph Check
UVa - 11686 Pick up sticks
Ice Cave
easy
topological sort
UVa - 11561 Getting Gold
easy
grids, dfs
UVa - 10507 Waking up brain
easy
direct connectivity check
CF - 246D
Colorful Graph
easy
graph representation
CF - 61D
Eternal Victory
easy
dfs
UVa - 11991 Easy Problem from Rujia Liu?
easy
graph representation
UVa - 11966 Galactic Bonding
easy
dsu, connected components
UVa - 1263
easy
SCC, DAG compression, geometry
UVa - 11838 Come and Go
Mines
easy
SCC
UVa - 626
Ecosystem
easy
connectivity, brute force
CF - 691D
Swaps in Permutation
easy
CC, sortings, permutations
CF - 60B
Serial Time!
easy
connected components, grids
CF - 24A
Ring road
easy
rings
CF - 687A
NP-Hard Problem
easy
CF - 22C
System Administrator
easy
constructive, articulation points, star/complete graphs
GYM - 100200B
Burning Bridges
easy
standard bridges
CF - 999E
Reachability from the Capital
easy
SCC
CF - 1176E
Cover it!
medium
bipartite check
CF - 103B
Cthulhu
medium
CF - 405E
Graph Cutting
pupils
seen
pupils
composite
bipartite Graph Check
connected components, cycle check
seen
medium
dfs, dfs state
seen
UVa - 10765 Doves and bombs
medium
articulation points
UVa - 11504 Dominos
medium
SCC, DAG compression
UVa - 11396 Claw Decomposition
medium
UVa - 295
bipartite Graph Check
seen
medium
connected components, binary search, geometry
seen
UVa - 10973 Triangle Counting
medium
graph representation, brute force
seen
CF - 106D
Treasure Island
medium
grids, brute force, next processing (with counting)
CF - 427C
Checkposts
medium
SCC
CF - 558C
Amr and Chemistry
medium
bfs, implicit graph, brute force
CF - 680E
Bear and Square Grid
medium
connected components, grids, 2D sliding window
CF - 723D
Lakes in Berland
medium
connected components, grids
CF - 723F
st-Spanning Tree
medium
connected components, dsu, greedy
CF - 598D
Igor In the Museum
medium
connected components, grids
GYM - 100201H
Don’t Go Left
medium
dfs, cycles
SPOJ - CAPCITY
Capital City
medium
SCC
SPOJ - BOTTOM
The Bottom of a Graph
medium
SCC
CF - 329B
Biridian Forest
medium
bfs
CF - 1063B
Labyrinth
medium
Fatman
seen
seen
seen
seen
seen
put in plan
seen
bfs
hint: enough to minimize left or right. because R - L = const
UVa - 10876 Factory Robot
hard
connected components, binary search, geometry
composite
UVa - 1092
hard
graph compression, grids, connectivity
solvable with brute force
UVa - 13008 Exposing corruption
hard
bipartite coloring, DP
composite
CF - 196B
Infinite Maze
hard
bfs, cycles
nice editorial solution
CF - 788C
Tracking Bio-bots
The Great Mixing
hard
bfs, smallest cycle length, math
CF - 987F
AND Graph
hard
connected components, bitmasks
CF - 369D
Valera and Fools
hard
bfs, counting
Minimum Spanning Tree (MST)
UVa - 11857 Driving Range
easy
UVa - 1160
X-Plosives
easy
UVa - 544
Heavy Cargo
easy
maximin
UVa - 10147 Highways
easy
minimum spanning subgraph
UVa - 10397 Connect the Campus
easy
minimum spanning subgraph
UVa - 1174
easy
IP-TV
8.4
10.4
UVa - 10099 The Tourist Guide
easy
maximin
UVa - 10462 Is There A Second Way Left?
easy
2nd mst
UVa - 1208
easy
Oreon
solvable with FW
specialists
solvable with FW
easy
max spanning tree
UVa - 10369 Arctic Network
easy
minimum spanning forest
UVa - 1235
easy
pupils
GYM - 100204H
Oil Deal
medium
add to plan
UVa - 11267 The Hire-a-Coder Business Model
medium
accept -ve weights, bipartite check
UVa - 10307 Killing Aliens in Borg Maze
hard
SSSP, bfs, grids
UVa - 1040
The Traveling Judges Problem
hard
brute force on all subsets, dfs, output formatting
CSA
Fold Polygon
hard
malformed input: empty line after last test case
specialists
UVa - 10842 Traffic Flow
Anti Brute Force Lock
count edges not taken by kruskal
specialists
solvable with binary search and DSU
specialists
composite
↗
Single-Source Shortest Path
UVa - 11792 Krochanska is Here!
easy
UVa - 10422 Knights in FEN
easy
UVa - 11693 Speedy Escape
easy
binary search
UVa - 12135 Switch Bulbs
easy
bfs, bitmasks, state-space search
UVa - 928
easy
bfs, grids, state-space search
UVa - 12160 Unlock the Lock
easy
bfs
UVa - 710
Eternal Truths
The Game
bfs
needs good complexity analysis
composite
specialists
easy
dijkstra, grids
UVa - 10047 The Monocycle
easy
bfs, grids, state-space search
UVa - 11487 Gathering Food
medium
bfs, counting paths
UVa - 859
medium
bfs
UVa - 11635 Hotel booking
medium
dijkstra, state-space search
UVa - 12070 Invite Your Friends
medium
dijkstra, grids, state-space search, brute force
UVa - 10557 XYZZY
medium
bellman-ford, maximization, connectivity, positive
cycles
specialists
important
UVa - 11721 Instant View of Big Bang
medium
bellman-form, negative cycles, printing the solution
specialists
important, solvable with SCC
UVa - 1233
USHER
medium
single-sink, dijkstra, bottle replacement
(combinatorics)
CF - 59E
Shortest Path
medium
bfs, state-space search, printing the solution
CF - 96D
Volleyball
Chinese Checkers
medium
graph conversion
GYM - 100200H
Driving Straight
medium
bfs, printing the solution
CF - 229B
Planets
medium
dijkstra, binary search, sets
CF - 342C
Paths and Trees
medium
CF - 144D
Missile Silos
medium
CF - 716D
Complete The Graph
specialists
composite
specialists
specialists
put in plan
hard
check this comment
UVa - 10166 Travel
hard
dijkstra
solvable with DP
UVa - 1202
hard
dijsktra, grids
speical case: outside grid
Finding Nemo
CF - 100570B ShortestPath Query
hard
All-Pairs Shortest Path (Floyd-Warshall's Algorithm)
UVa - 12319 Edgetown's Traffic Jams
easy
seen
UVa - 567
Risk
easy
standard
UVa - 821
Page Hopping
solvable with BFS but graph is small
easy
standard
UVa - 11047 The Scrooge Co Problem
easy
standard
specialists
UVa - 1056
seenX
Degrees of Separation
easy
standard
UVa - 10171 Meeting Prof. Miguel...
easy
standard
UVa - 925
No more prerequisites, please!
easy
transitive closure, transitive reduction of a DAG
UVa - 439
Knight Moves
easy
UVa 423
MPI Maelstrom
easy
UVa - 521
Gossiping
medium
graph connectivity, lcm
UVa - 125
Numbering Paths
medium
counting paths
UVa - 334
Identifying Concurrent Events
medium
connectivity, transitive closure, topological sort +
fenwick trees (for large graphs)
UVa - 1243
Polynomial-time Reductions
hard
non-zero diagonal, printPath edit
specialists
specialists
transitive closure, SCC, transitive reduction of a DAG
specialists
specialists
misconception
constraints: small graph
specialists
Network Flow
UVa - 563
Crimewave
CF - 498C
Array Operations
easy
output sensitive complexity
medium
number theory
GYM - 100200A
Unique Attack
medium
min cut, Dinic with scaling
Topcoder
Graduation
medium
UVa - 10983 Buy one, get the rest free
hard
important, customization of max flow solution, solvable with bipartite matching
binary search, max flow
balabizoo^3
Minimum Cost (Max) Flow
UVa - 10806 Dijkstra, Dijkstra.
medium
minimum cost flow
UVa - 10746 Crime Wave - The Sequel
medium
MCMF on bipartite graph
UVa - 10594 Data Flow
medium
minimum cost flow
UVa - 11301 Great Wall of China
medium
MCMF with SPFA, grids, vertex capacity
UVa - 10888 Warehouse
medium
SSSP (bfs), MCMF on bipartite graph
CF - 863F
Almost Permutation
medium
Guess Your Way Out!
easy
Trees
CF - 507C
binary tree, heap representation
UVa - 11350 Stern-Brocot Tree
easy
CF - 682C
Alyona and the Tree
easy
max suffix sum
UVa - 615
Is It A tree?
easy
dfs
UVa - 11108 Tautology
easy
expression evaluation, btimasks, brute force
UVa - 699
The Falling Leaves
easy
pre-order
UVa - 679
Dropping Balls
easy
heap representation
UVa - 12186 Another Crisis
easy
dfs, sortings
UVa - 599
The Forrest for the Trees
easy
tree properties
CF - 698B
Fix a Tree
easy
dfs, constructive algorithm
CF - 34D
Road Map
easy
stacks
CF - 369C
Valera and Elections
easy
tree traversal
GYM - 100247E
Of Groups and Rights
Topcoder
IncompleteBST
CF - 763A
Timofey and a tree
checking for a tree using indegree and #edges is not enough in case of description using defined root and directed edges is not enough (cases: empty tree, loops, disconneted + cycle)
balabizoo^2
balabizoo^2
seen
easy
easy
implementation
easy
UVa - 11131 Close Relatives
medium
CF - 675D
medium
Tree Construction
general day
tree traversal
general day
general day
UVa - 11234 Expressions
medium
post-order or level order, binary tree, stacks, queues
CF - 82C
General Mobilization
medium
implementation, priorityqueues
CF - 89B
Widget Library
medium
implementation, dp, treemaps, expression parsing
CF - 77C
Beavermuncher-0xFF
medium
dfs, greedy
CF - 337D
Book of Evil
medium
tree diameter, dfs
CF 486D
Valid Sets
medium
dfs, combinatorics
CF - 707D
Persistent Bookcase
medium
dfs, persistence
CF - 455C
Civilization
medium
diameter, dsu
CF - 570D
Tree Requests
hard
euler walk, prefix xor, bitmasks, binary search
UVa - 10805 Cockroach Escape Networks
hard
minimum diameter spanning tree
can be solved with segment trees
solvable with up & down dp
Nice Solution
11.3
important
DP on Trees
Topcoder
PendingTasks
easy
UVa - 11307 Alternative Arborescence
medium
DP, min chromatic sum
CF - 440D
Berland Federalization
medium
firstChild & nextSibling
CF - 110E
Lucky Tree
medium
up & down dp
CF - 219D
Choosing Capital for Treeland
medium
up & down dp
CF - 618D
Hamiltonian Spanning Tree
medium
firstChild & nextSibling
CF - 855C
Helga Hufflepuff's Cup
medium
firstChild & nextSibling
CF - 500D
New Year Santa Network
medium
up & down, expectations
SPOJ - VOCV Con-Junctions
medium
DP
CF - 461B
medium
counting
Appleman and Tree
only 6 colors are needed for largest n
solvable with 1 dfs
Euler Walk
CF - 343D
Water Tree
medium
segment trees
CF - 397E
On Changing Tree
medium
segment trees
CF - 838C
Propagating tree
medium
fenwick trees
CF - 570D
Tree Requests
seen
hard
solvable with DSU on trees
Lowest Common Ancestor (LCA)
LA - 2045
Closest Common Ancestors
UVa - 10938 Flea circus
easy
standard
easy
experts
UVa - 12238 Ants Colony
easy
experts
GYM - 100015F
City Driving
medium
experts
UVa - 12533 Joining Couples
medium
experts
CF - 191C
Fools and Roads
medium
experts
CF - 855D
Rowena Ravenclaw's Diadem
medium
UVa - 1728
Toll Management IV
hard
experts
DSU on Trees
CF - 600E
Lomsat gelral
easy
CF - 246E
Blood Cousins Return
medium
multisets
CF - 208E
Blood Cousins
medium
ancestors processing
CF - 161D
Distance in Tree
medium
solvable with euler walk and LCA
solvable with DP in O(nk)
Centroid Decomposition
CF - 321C
Ciel the Commander
IOI 2011
Race
CF - 342E
Xenia and Tree
easy
standard
easy
aux array
medium
↗
best complexity: O(N log N)
SPOJ - QTREE5
Query on a tree V
medium
multisets
Hello 2015 - Div1
TreeF Query
medium
binary search
CF - 716E
Digit Tree
medium
modular inverse, up & down dp
HackerRank
BST Maintenance
hard
BST construction
↗
HackerRank
Unique Colors
hard
auxilary array
↗
easy
binary search MCBM
Bipartite Graph
UVa - 11262 Weird Fence
best complexity: O(N log^2 N)
↗
UVa - 753
easy
MCBM
UVa - 12159 Gun Fight
easy
MCBM, geometry
UVa - 670
A Plug for UNIX
The dog task
easy
MCBM, geometry
Topcoder
RookAttack
easy
Topcoder
PlayingCubes
easy
Topcoder
Parking
MCBM
easy
bfs, binary search
SPOJ - QUEST4
Dungeon of Death
easy
mvc
SPOJ - TAXI Taxi
easy
UVa - 10804 Gopher Strategy
medium
UVa - 663
medium
Sorting Slides
UVa - 11419 SAM I AM
Topcoder
DataFilter
medium
binary search, MCBM
solvable with pfs
seenX
composite
check whether removing an edge will affect MCBM, solvable with greedy algorithm
MVC, printing the solution
important
hard
many cases, implementation details
Eulerian Graph
UVa - 291
The House Of Santa Claus
UVa - 117
The Postal Worker Rings Once
easy
euler tour, backtracking
easy
euler tour, FW
UVa - 10296 Jogging Trails
medium
chinese postman problem
CF - 788B
Weird journey
medium
counting
CF - 62D
Wormhouse
hard
euler tour/path, bridges
CF - 367C
Sereja and the Arrangement of Numbers
hard
euler tour, modelling problem
Always on the run
backtracing solution
DAGs
UVa - 590
easy
shortest path, DP
UVa - 10285 Longest Run on a Snowboard
easy
longest path, DP
UVa - 103
easy
longest path, LIS
UVa - 10926 How Many Dependencies?
easy
counting reachable nodes, DAG
balabizoo^2
UVa - 10000 Longest Paths
easy
longest path, DP, pair optimization
balabizoo^1
UVa - 12376 As Long as I Learn, I Live
easy
graph traversal
UVa - 10350 Liftless EME
easy
shortest path, DP
UVa - 11545 Avoiding Jungle in the Dark
medium
shortest path, DP
UVa - 11324 The Largest Clique
medium
SCC, DAG compression, DP
CF - 721C
medium
DP, printing the solution
SPOJ - TRSTAGE
Traveling by Stagecoach
medium
DP, bitmasks
UVa - 10917 Walk Through the Forest
hard
Stacking Boxes
Journey
GYM - 100863 tourist
(G)
very hard
balabizoo^2
weak test cases
seenX
seenX
composite
dijkstra, convert general graph to DAG, count paths
printing paths, DAG compression, topological sort
Minimum Path Cover (MPC)
UVa - 1201
Taxi Cab Scheme
UVa - 1184
Air Raid
easy
easy
Functional Graphs
CF - 702E
Analysis of Pathes in Functional Graph
medium
CF - 711D
Directed Roads
medium
combinatorics
CF - 698B
Fix a Tree
medium
constructive algorithm
Bridge Trees
Arabella 2015 -Capital
H
City
Amman 2015 -Bridges
H
easy
tree diameter
↗
easy
tree diameter
↗
CF - 555E
Case of Computer Network
medium
LCA
HackerRank
Sherlock and Queries on the Graph
medium
LCA
↗
DSU on graphs
ECPC 2015 - CConnecting Graph
HackerRank
Travel in HackerLand
medium
↗
hard
↗
Mathematics
Ad-hoc
Brute Force
CF - 915A
Garden
easy
divisibility
UVa - 264
Count on Cantor
easy
grid
UVa - 697
Jack and Jill
easy
simulation
UVa - 616
Coconuts, Revisited
medium
UVa - 10257 Dick and Jane
medium
UVa - 10427 Naughty Sleepy Boys
medium
rational numbers enumeration
filtered
divisibility, coprimes
complex output formatting
observation: remaining coconuts on last day must be at least N * (N-1)
mathematical insight
brute force
Formulas
CF - 415B
Mashmokh and Tokens
easy
floor and ceiling
UVa - 10696 f91
easy
UVa - 10970 Big Chocolate
easy
UVa - 10014 Simple calculations
easy
CF - 638A
Home Numbers
easy
CF - 70A
Cookies
easy
CF - 80B
Depression
easy
CF - 90A
Cableway
easy
UVa - 913
Joana and the Odd Numbers
CF - 787A
The Monster
CF - 233B
Non-square Equation
medium
quadratic equation, brute force
CF - 185A
Plant
medium
fast exponentiation
CF - 702D
Road to Post Office
medium
linear recurrence
easy
easy
UVa - 10519 !! Really Strange !!
medium
geometry, arithmetic progression
CF - 337C
medium
floor and ceiling, fast exponentiation
Quiz
solvable with DP with matrix power
Logarithms and Powers
UVa - 113
Power of Cryptography
UVa - 11636 Hello World!
UVa - 107
The Cat in the Hat
easy
easy
medium
W must be pow(N, k) and H must be pow(N+1, k) for some k, 1 special case
Polynomials
UVa - 392
Polynomial Showdown
UVa - 12318 Digital Roulette
easy
polynomials, output formatting
easy
Ruffini–Horner's method, brute force, treesets
bitwise or, couting
filtered
useless
Base Number Systems
CF - 1017B
The Bits
easy
UVa - 575
Skew Binary
easy
CF - 92B
Binary Number
easy
UVa - 10931 Parity
easy
UVa - 11185 Ternary
easy
CF - 219B
Special Offer! Super Price 999 Bourles!
easy
UVa - 389
Basically Speaking
CF - 39H
Multiplication Table
GYM - 100008B
Alien Communicating Machines
GYM - 100201C
Yellow Code
toBinaryString(), bitCount()
easy
solvable with built-in functions only
easy
easy
medium
bit manipulation
Find the pattern
CF - 55A
Flea travel
UVa - 10161 Ant on a Chessboard
easy
mathematical insights
solvable with simulation
hard
solvable with simulation
Others
UVa - 496
Simply Subsets
easy
set operations, treesets
UVa - 138
Street Numbers
easy
hardcoding
CF - 42A
Guilty — to the kitchen!
easy
inequalities, greedy
CF - 697B
Barnicle
easy
scientific notation
UVa - 350
Pseudo-Random Numbers
easy
cycle finding
UVa - 10591 Happy Number
easy
cycle finding
UVa - 10013 Super long sums
easy
long arithmetic
CF - 111A
Petya and Inequiations
easy
greedy
CF - 1175B
Catch Overflow!
easy
infinity
CF - 1176A
Divide it!
easy
CF - 863C
1-2-3
medium
CF - 65A
Harry Potter and Three Spells
medium
CF - 81C
Average Score
medium
mathematical insights, sortings
CF - 712C
Memory and De-Evolution
medium
greedy
see proof in tutorial comments
UVa - 202
Repeating Decimals
medium
repeating decimals, cycle finding, long division
important
CF - 939E
Maximize!
medium
mean, two pointers
medium
dp
cycle finding
add to specialists
Combinatorics
pigeonhole Principle
CF - 577B
Modulo Sum
Fibonacci Numbers
UVa - 10579 Fibonacci Numbers
very easy
UVa - 11000 Bee
easy
UVa - 10862 Connect the Cable Wires
easy
dp
9.1
UVa - 10689 Yet another Number Sequence
easy
pisano period
9.1
9.2
UVa - 11161 Help My Brother (II)
easy
9.2
UVa - 11089 Fi-binary Number
medium
Fibonacci Number System
UVa - 11780 Miles 2 Km
medium
fibonacci growth, DP
UVa - 1258
Nowhere Money
medium
two-step interpretation, zerkendorf's theorem
CF - 551D
GukiZ and Binary Operations
medium
PE because of blanks at the end of each line
solvable with DP with matrix power
Binomial Coefficient
CF - 919B
Perfect Number
easy
CF - 817B
Makes And The Product
easy
CF - 294C
Shaass and Lights
easy
use stars and bars to prove max answer. check bonus questions in tutorial
UVa - 10105 Polynomial Coefficients
easy
UVa - 326
Extrapolation Using a Difference Table
easy
CF - 397C
On Number of Decompositions into Multipliers medium
stars and bars, prime factorization
ASC 28 - D
Dinner Problem
medium
take at least 1
CF - 156C
Cipher
medium
dp, modelling (numbers moving between buckets)
CF - 128C
Games with Rectangle
medium
CSA
All Numbers
medium
A2oj - 292
Functions
hard
dp (take at least 1)
HackerRank
Div and Span
hard
catalan, dp, stars and bars
CF - 57C
Array
hard
stars and bars
Catalan Numbers
combinatorial proof of binomial coefficient
pascal's triangle
↗
stars and bars with restriction
solvable with dp with prefix sum processing
combinatorial solution
↗
preprocessing, composite
↗
UVa - 10303 How Many Trees?
UVa - 10223 How many nodes ?
UVa - 10312 Expression Bracketing
easy
9.1
easy
medium
dp, super cataln numbers
9.2
important
Inclusion-Exclusion Principle
UVa - 10325 The Lottery
easy
UVa - 11806 Cheerleaders
easy
SPOJ - NGM2 Another Game With Numbers
easy
CF - 701B
Cells Not Under Attack
easy
Topcoder
Divisibility
easy
Topcoder
SetOfPatterns
easy
↗
divisible by at least one of a set
Codechef - COUNTREL
Count Relations
SPOJ - MSKYCODE
Sky Code
medium
square-free numbers
Topcoder
Carless Secretary
medium
free-fixed-points permutations, derangements
CF - 560E
Gerald and Giant Chess
medium
SPOJ - SQFREE
Square-free integers
↗
best solution
medium
Derangments
UVa - 10497 Sweet Child Makes Trouble
easy
UVa - 12024 Hats
easy
Topcoder
easy
Deranged
BigInteger
11.3
Others
UVa - 12463 Little Nephew
easy
UVa - 10079 Pizza Cutting
easy
formula
9.1
UVa - 11069 A Graph Problem
easy
dp
9.1
9.1
UVa - 11597 Spanning Subtree
easy
formula
8.4
UVa - 10219 Find the ways !
easy
CF - 83A
Magical Array
easy
combinations
CF - 621B
Wet Shark and Bishops
easy
chessboard
9.2
UVa - 10338 Mischievous Children
easy
UVa - 10790 How Many Points of Intersection?
easy
arithmetic progression
UVa - 11554 Hapless Hedonism
easy
triangle counting, pattern finding, prefix sum
easy
counting principle
easy
DP
UVa - 11115 Uncle Jack
UVa - 10328 Coin Toss
CF - 205C
Little Elephant and Interval
easy
nice solution
UVa - 11401 Triangle Counting
medium
brute force, formula
CF - 459C
Pashmak and Buses
medium
counting principle, constructive algorithm
CF - 496D
Tennis Game
medium
harmonic series, binary search/preprocessing
CF - 258B
Little Elephant and Elections
medium
backtracking
medium
DP
GYM - 100015B
Ball Painting
9.2
9.2
Number Theory
Prime Numbers
CF - 665D
Simple Subset
easy
UVa - 543
sieve
specialists
easy
sieve
specialists
UVa - 10948 The primary problem
Goldbach's Conjecture
easy
sieve
specialists
UVa - 914
specialists
easy
sieve, binary search
UVa - 10533 Digit Primes
Jumping Champion
easy
modified sieve, static RSQ
UVa - 10200 Prime Time
easy
sieve, static RSQ
UVa - 10490 Mr. Azad and his Son!!!!!
easy
perfect number, sieve
UVa - 10852 Less Prime
easy
sieve, modulo
UVa - 10650 Determinate Prime
easy
sieve
Topcoder
EngineersPrimes
specialists
solvable with hardcoding
seen
easy
sieve
UVa - 10871 Primed Subsequence
easy
sieve, brute force
UVa - 967
Circular
easy
sieve, static RSQ
specialists
CF - 385C
Bear and Prime Numbers
easy
sieve, static RSQ
specialists
UVa - 10858 Unique Factorization
medium
backtracking
UVa - 11752 The Super Powers
medium
UVa - 10742 The New Rule in Euphomia
medium
sieve, static RSQ, combinatorics
Topcoder
PreprimeNumbers
medium
sieve, brute force, sortings
Topcoder
PowerCollector
medium
Topcoder
PrimePalindromic
medium
sieve, brute force
Topcoder
PrimePolynom
medium
primality test, brute force
Topcoder
PrimeAnagrams
medium
sieve, brute force
seen
10.0
Modular Arithmetic
CF - 913A
Modular Exponentiation
very easy
CF - 447A
DZY Loves Hash
very easy
CF - 68A
Irrational problem
very easy
UVa - 10127 Ones
very easy
UVa - 1230
MODEX
very easy
CF - 248B
Chilly Willy
pupils
conceptual problem
seen
easy
optimizations
UVa - 10489 Boxes of Chocolates
easy
filtered
unclear problem statement
UVa - 128
Software CRC
easy
filtered
unclear problem statement
CF - 284A
Cows and Primitive Roots
easy
seen
CF - 332A
Down the Hatch!
easy
CF - 132A
Turing Tape
easy
UVa - 374
Big Mod
easy
UVa - 10176 Ocean Deep! - Make it shallow!!
easy
CF - 677B
Vanya and Food Processor
easy
CF - 1175A
From Hero to Zero
CF - 476C
Dreamoon and Sums
fast exponentiation
seen
discussed
easy
medium
quotient remainder theorem
specialists
UVa - 10212 The Last Non-zero Digit
medium
UVa - 10174 Couple-Bachelor-Spinster Numbers.
medium
UVa - 11029 Leading and Trailing
medium
logarithmic trick, big mod trick
specialists
UVa - 10006 Carmichael Numbers
medium
fast exponentiation, precomputation
specialists
CF - 300C
Beautiful Numbers
medium
modular inverse, combinatorics
specialists
UVa - 133
The Dole Queue
medium
circular arrays
specialists
CF- 321A
Ciel and Robot
medium
GYM - 100015A
Another Rock-Paper-Scissors Problem
medium
Topcoder
DivisibilityCriteria
medium
CF - 303A
Lucky Permutation Triple
medium
GYM - 100204IBishops on a Toral Board
medium
UVa - 11155 Be Efficient
hard
CF - 492E
Vanya and Field
hard
CF - 484B
Maximum Value
hard
GCD and LCM
UVa - 11388 GCD LCM
very easy
specialists
specialists
odd check for negative numbers, square difference
modular equations
offsets
easily solvable with prefix mod array
experts
harmonic series, next processing
UVa - 11417 GCD
very easy
CF - 664A
Complicated GCD
easy
specialists
seen
UVa - 408
Uniform Generator
easy
specialists
seen
UVa - 412
Pi
easy
CF - 75C
Modified GCD
easy
binary search, divisors generation
UVa - 332
Rational Numbers from Repeating Fractions
easy
fraction simplification
UVa - 10892 LCM Cardinality
easy
divisors generation
seen
UVa - 12068 Harmonic Mean
easy
fraction simplification
seen
easy
brute force
UVA - 10717 Mint
CF - 678C
Joty and Chocolate
easy
inclusion-exclusion
CF - 741A
Arpa's loud Owf and Mehrdad's evil plan
medium
permutation cycles
CF - 87A
Trains
medium
UVa - 11774 Doom's Day
medium
Find patttern
UVa - 106
Fermat vs. Pythagoras
medium
pythagorean triples
UVa - 10637 Coprimes
medium
backtracking, pruning, gcd table
CF - 66D
Petya and His Friends
medium
constructive algorithm
CF - 303B
Rectangle Puzzle II
medium
CF - 1174C
Ehab and a Special Coloring Problem
medium
CF - 359C
Prime Number
hard
CF - 74C
Chessboard Billiard
hard
CF - 348B
Apple Tree
hard
specialists
special case: j = 0
specialists
logic
seen
seen
tricky cases: out of bounds
harmonic
solvable with dsu
trees
solution
overflow handling
Factorial
UVa - 623
500!
UVa - 10220 I Love Big Numbers !
UVa - 324
Factorial Frequencies
UVa - 568
Just the Facts
UVa - 10323 Factorial! You Must be Kidding!!!
very easy
BigInteger
very easy
BigInteger
easy
BigInteger
easy
extract last non-zero digit
easy
seen
specialists
seen
filtered
Prime Factorization
UVa - 583
Prime Factors
easy
UVa - 516
Prime Land
easy
specialists
UVa - 10392 Factoring Large Numbers
easy
filtered
UVa - 11466 Largest Prime Divisor
easy
UVa - 160
Factors and Factorials
easy
UVa - 993
Product of digits
easy
UVa - 10780 Again Prime? No Time.
easy
UVa - 10791 Minimum Sum LCM
easy
UVa - 10484 Divisibility of Factors
easy
UVa - 10527 Persistent Numbers
easy
UVa - 11347 Multifactorials
UVa - 11889 Benefit
easy
base prime number system
seen
weak test cases
seen
divisors from 9 to 2
numDivs
easy
UVa - 10061 How many zero's and how many digits ?
medium
specialists
nice
seen
UVa - 10139 Factovisors
medium
specialists
nice
seen
UVa - 10622 Perfect P-th Powers
medium
specialists
trick: magnitude implies -ve numbers, -2^31
UVa - 10680 LCM
medium
specialists
CF - 490D
medium
Chocolate
#digits base b, #trailing zeros base b, factorials
brute force
UVa - 11395 Sigma Function
hard
square numbers
CF - 449C
hard
sieve, multiples, constructive
Jzzhu and Apples
seen
important
seen
composite
Functions Involving Prime Factors
UVa - 294
easy
numDiv
UVa - 11876 N + NOD (N)
easy
numDivs, binary search
UVa - 884
Divisors
easy
numPF
UVa - 10820 Send a Table
easy
phi
UVa - 11728 Alternate Task
easy
sumDiv
UVa - 11064 Number Theory
easy
numDiv, phi
UVa - 11086 Composite Prime
easy
numPF
UVa - 11226 Reaching the fix-point.
easy
sumPF, DP
UVa - 1246
easy
numDiv
UVa - 11353 A Different Kind of Sorting
easy
numPF
UVa - 12005 Find Solutions
hard
formula reduction, numDiv
UVa - 10958 How Many Solutions?
hard
formula reduction, numDiv
UVa - 10856 Recover Factorial
easy
numPF
UVa - 10699 Count the factors
easy
numDiffPf
UVa - 12043 Divisors
easy
sumDiv, numDiv, brute force
UVa - 10990 Another New Function
easy
phi, DP, static RSQ
UVa - 10738 Riemann vs Mertens
easy
squareFree, numPF, static RSQ
specialists
UVa - 11415 Count the Factorials
easy
numPF, static RSQ, binary search
specialists
UVa - 11408 Count DePrimes
easy
static RSQ, sumDiffPF
UVa - 11960 Divisor Game
easy
numDiv, DP
UVa - 11730 Number Transformation
easy
bfs, state-space search, DP, PF generation
CF - 1176D
easy
largest divisor
Factorial Factors
Find Terrorists
specialists
seen
seen
specialists
trick: bounds are given without order
seen
important
seen
filtered
seen
important
Modified Sieve
Recover it!
solvable with DP and BS (CP chapter 8)
specialists
seen
seen
seen
specialists
seen
composite
seen
Extended Euclidean Algorithm
UVa - 10104 Euclid Problem
UVa - 10673 Play with Floor and Ceil
easy
easy
specialists
UVa - 10090 Marbles
medium
diophantine equation
specialists
UVa - 10633 Rare Easy Problem
medium
diophantine equaiton
specialists
seen
important, solvable with mathematical reduction and brute force
seen
Others
CF - 935A
Fafa and his Company
very easy
count divisors
CF - 1047A
Little C Loves 3 I
very easy
divisibility
UVa - 11461 Square Numbers
easy
perfect squres
UVa - 10110 Light, more light
easy
perfect squares
UVa - 10606 Opening Doors
easy
perfect squares, binary search, BigInteger
UVa - 10929 You can say 11
easy
divisibility
UVa - 11344 The Huge One
easy
divisibility, BigInteger
UVa - 11042 Complex, difficult and complicated
easy
complex numbers
UVa - 756
easy
Chinese remainder theorem
UVa - 10880 Colin and Ryan
Biorhythms
easy
divisors generation, stacks, queues
CF - 43C
Lucky Tickets
easy
divisibility
CF - 597A
Divisibility
easy
divisibility
Topcoder
RugSizes
easy
divisibility, brute force
CF - 71C
Round Table Knights
medium
divisors generation/prime factorization, brute force
GYM - 100247L
For the Honest Election
medium
divisors generation
Topcoder
Refactoring
medium
divisors generation, dp
Topcoder
DivisorInc
medium
divisibility, dp
seen
seen
Topcoder
SquareFree
CF - 448E
Divisors
medium
moebius function
hard
divisors generation, D&C
easy
observation
optimization with sieve to handle prime
observation:
numbersall divisors of divisors of a number
seen are divisors of that number, generate Divisors DAG in O(cubic_root(x)^2 + sqrt(x))
Permutations
CF - 359B
Permutation
CF - 180F
Mathematical Analysis Rocks!
UVa - 10098 Generating Fast
UVa - 11371 Number Theory for Newbies
UVa - 941
Permutations
easy
easy
next_permutation
easy
medium
kth permutation
UVa - 11525 Permutation
medium
kth permutation, segment trees
UVa - 11282 Mixing Invitations
medium
fixed points
CF - 67B
Restoration of the Permutation
medium
constructive algorithm
CF - 48D
Permutations
medium
constructive algorithm
composite
Probability Theory
CF - 77B
easy
continuous probability
UVa - 10491 Cows and Cars
UVa - 542
Falling Anvils
easy
formula
France '98
easy
D&C
UVa - 10056 What is the Probability ?
easy
formula
UVa - 11628 Another lottery
easy
UVa - 12114 Bachelor Arithmetic
easy
Topcoder
BenfordsLaw
Topcoder
ProbabilityTree
easy
expected value
easy
bfs, conditional probability
UVa - 11181 Probability|Given
medium
conditional probability
UVa - 12461 Airplane
medium
:"D
CF - 107B
Basketball Team
medium
combinatorics
CF - 109B
Lucky Probability
medium
brute force, lucky numbers generation
Topcoder
RangeGame
medium
Topcoder
ChipRace
medium
dp
Topcoder
GeneticCrossover
medium
dfs
Topcoder
BagOfDevouring
medium
dp, bitmasks
Topcoder
RandomFA
medium
dp
Topcoder
AntiMatter
medium
gcd
CF - 1042E
Vasya and Magic Matrix
hard
expectation, dp, algebra
CF - 235B
Let's Play Osu!
hard
expectation
UVa - 11500 Vampires
hard
gambler's ruin problem
Topcoder
TestScores
hard
mean and standard deviation
Topcoder
PackageShipping
hard
dp
Topcoder
Hangman42
hard
dp
easy
DP
easy
addition rule, independent events
easy
DP
corner cases
nice solution
restate the problem, important combinatorics trick
Probability with DP
UVa - 10759 Dice Throwing
Topcoder
PrimeSoccer
Topcoder
TopFive
UVa - 11021 Tribles
medium
DP, independent events
hard
bitmasks, preprocessing
UVa - 10891 Game of Sum
easy
dp, two pointers
UVa - 10404 Bachet's Game
easy
dp
UVa - 10578 The Game of 31
easy
dp
UVa - 11489 Integer Game
easy
strategy finding
UVa - 10536 Game of Euler
medium
dp, bitmasks
GYM - 100015F
Fighting for Triangles
medium
dp
UVa - 847
medium
strategy finding
UVa - 10111 Find the Winning Move
medium
dp, implementation
UVa - 10368 Euclid's Game
medium
pattern finding
UVa - 12293 Box Game
medium
pattern finding
UVa - 12469 Stones
medium
dp or pattern finding
CF - 69D
Dot
medium
dp
CF - 63E
Sweets Game
medium
dp, bitmasks, preprocessing
CF - 538E
Demiurges Play Again
medium
trees, constructive
Topcoder
CakeParty
CF - 16E
Fish
solvable with backtracking
↗
Solve it on SPOJ with Java
Game Theory
Decision Tree (Minimax Strategy)
A Multiplication Game
hard
strategy finding
Nim Game
UVa - 10165 Stone Game
UVa - 11311 Exclusively Edible
CF - 15C
Industrial Nim
Topcoder
StoneGameStrategist
very easy
easy
medium
hard
xor on interval
important
ladder nim
Sprague-Grundy Theorem
UVa - 11534 Say Goodbye to Tic-Tac-Toe
Codechef - ASTRGAME
A String Game
SPOJ - MATGAME
Matrix Game
Timus - 1465 Pawn Game
easy
easy
medium
easy
CF - 317D
Game with Powers
medium
CF - 335C
More Reclamation
medium
CF - 87C
Interesting Game
hard
dp
Topcoder
LongLongNim
hard
hardcoding with dp
cycle finding
Topcoder
Roxor
hard
CF - 959A
Mahmoud and Ehab and the even-odd game
easy
strategy finding
CF - 74B
Train
easy
greedy, simulation
CF - 79A
Bus Game
easy
simulation
CF - 914B
Conan and Agasa play a Card Game
medium
strategy finding
CF - 78C
Beaver Game
medium
strategy finding
CF - 49D
Game
medium
brute force
CF - 55C
Pie or die
medium
strategy finding
CF - 705B
Spider Man
medium
CF - 197A
Plate Game
medium
CF - 388C
Fox and Card Game
nice solution
Others
hard
game = # cuts in a chocolate bar
strategy finding
greedy
BigInteger
UVa - 424
Integer Inquiry
very easy
BigInteger addition
UVa - 10193 All You Need Is Love
easy
gcd
UVa - 10235 Simply Emirp
easy
Probabilistic primality test
UVa - 10494 If We Were a Child Again
easy
long divison and modulo
Others
try implementing it without BigInteger
UVa - 10164 Number Game
UVa - 547
DDF
hard
medium
parity
sequences, numDiv, DP
tricky input
Canonical Form
CF - 560D
Equivalent Strings
medium
general day
Strings
Ciphering
UVa - 10878 Decode the tape
easy
observation
Frequency Count
CF - 43B
Letter
easy
UVa - 11588 Image Coding
easy
2D Arrays
CF - 50B
easy
counting principle
Choosing Symbol Pairs
UVa - 10252 Common Permutation
easy
CF - 1176C
Lose it!
medium
CF - 551B
ZgukistringZ
medium
CF - 335A
Banana
medium
brute force, greedy
CF - 254C
Anagram
medium
subsequences
greedy
pupils
pupils
specialists
Subsequences
UVa - 10340 All in All
CF - 91A
Newspaper Headline
easy
medium
subsequence check
next occurence processing
Regular Expression (Regex)
UVa - 409
Excuses, Excuses!
easy
String Matching
CF - 79C
Beaver
easy
two pointers, greedy
CF - 23A
You're Given a String...
easy
brute force
CF - 39J
Spelling Check
easy
prefix/suffix matching
easy
string compression
UVa - 10298 Power Strings
easy
string compression
UVa - 11576 Scrolling Sign
easy
UVa - 11475 Extend to Palindrome
easy
suffix palindromes
UVa - 11888 Abnormal 89's
easy
prefix/suffix palindromes
UVa - 12467 Secret Word
easy
palindromes
UVa - 886
Prefix Function (KMP)
UVa - 455
Periodic Strings
Named Extension Dialing
easy
treesets
SPOJ - NHAY A Needle in the Haystack
easy
standard, on the fly
CF - 535D
Tavas and Malekas
easy
CF - 126B
Password
medium
CF - 346B
Lucky Common Subsequence
medium
HackerRank
Cutting the String
hard
counting, string compression
CF - 25E
Test
hard
permutations, greedy
Topcoder
InfiniteSoup
hard
number theory
CF - 471D
MUH and Cube Walls
hard
solvable with Z-Algorithm
DP, prefix automaton
↗
clever optimizations
solvable with rabin-karp (+ modified queues)
Aho Corasick
UVa - 10679 I Love Strings!!
easy
codechef - LYRC
Music & Lyrics
easy
codechef - QMARKS
Lucy and Question Marks
easy
dp
codechef - FAVNUM
Favourite Numbers
medium
dp
CF - 163E
medium
euler walk, fenwick tree
e-Government
easily solvable with suffix automaton
↗ duplicate dictionary words
needs (time & memory) optimization,
↗
↗
sensitive to time & memory
Grids
UVa - 10010 Where's Waldorf?
easy
backtracking, pruning
UVa - 422
Word-Search Wonder
easy
backtracking, pruning
UVa - 604
The Boggle Game
easy
backtracking, generation, treesets
UVa - 11283 Playing Boggle
easy
backtracking, pruning
UVa - 736
easy
backtracking, pruning
easy
distinct substrings
Lost in Space
uDebug hint
Suffix Structures
Suffix Trie
CF - 271D
Good Substrings
UVa - 760
DNA Sequencing
easy
LCS
experts
CF - 113B
Petr#
medium
KMP
experts
CF - 456D
A Lot of Games
medium
game theory, min-max strategy
SPOJ - MORSE
solvable with hashing
hard
DP
TYPO: A word can exist more than once in dictionary, deal with them as different words
UVa - 11512 GATTACA
easy
longest repeated substring
solvable with suffix trie
UVa - 11107 Life Forms
hard
LCS variant, modified queues, sliding window
solvable with suffix automaton
SPOJ - SUBLEX
Lexicographical Substring Search
easy
kth substring
optimize for time > memory
UVa - 719
Glass Beads
easy
smallest cyclic shift
UVa - 1223
Editor
easy
longest repeated substring
CF - 427D
Match & Catch
UVa - 1254
Top 10
hard
substring occurence
UVa - 257
Palinwords
easy
brute force
CF - 70B
Text Messaging
easy
expression parsing, greedy
CF - 61B
Hard Work
easy
expression parsing, brute force
CF - 59C
Title
easy
palindromes, greedy
CF - 81B
Sequence Formatting
easy
expression parsing
CF - 34C
Page Numbers
easy
expression parsing, output formating
UVa - 644
Immediate Decodability
easy
CF - 278B
New Problem
easy
brute force, treesets
CF - 777D
Cloud of Hashtags
easy
greedy
CF - 62B
Tyndex.Brome
medium
next/last occurence preprocessing
CF - 56C
Corporation Mail
medium
expression parsing, treemaps
medium
canonical form
Suffix Array
Suffix Automaton
medium
occurences
solvable with DP in O(n^2) - check editorial
Others
GYM - 100247B
Similar Strings
filtered
solvable with built-in function StartsWith()
nice solution
String Hashing
SPOJ - ADACLEAN
Ada and Spring Cleaning
easy
CF - 245H
Queries for Number of Palindromes
medium
CF - 494B
Obsessive String
medium
rabin-karp
solvable with DP
rabin-karp, dp
solvable with KMP
root
a
aa
ab
Geometry
Points and Lines
UVa - 152
Tree's Crowd
CF - 706A
Beru-taxi
very easy
easy
brute force
UVa - 10263 Railway
easy
closest point to line segment
UVa - 10357 Playball !!!
easy
UVa - 587
There's treasure everywhere!
easy
translation, path tracing, simulation
UVa - 378
Intersecting Lines
easy
line intersection
pupils
UVa - 10585 Center of Symmetry
easy
CF - 498A
Crazy Town
easy
UVa - 184
Laser Lines
easy
collinear test, brute force
CF - 667A
Pouring Rain
easy
physics
UVa - 10167 Birthday Cake
easy
brute force
UVa - 273
Jack Straws
easy
line segment intersection, dsu, connected
components
UVa - 356
Square Pegs And Round Holes
easy
brute force
CF - 257C
View Angle
easy
CF - 1047B
Cover Points
easy
UVa - 191
Intersection
medium
UVa - 837
Light and Transparencies
medium
7.4
UVa - 920
Sunny Mountains
medium
7.1
7.4
specialists
solvable with FW
line equation
rectangle-line segment intersection
7.3
two opposite corners are given not necessarily top left and bottom right
UVa - 10250 The Other Two Trees
medium
translation
7.2
parallelogram not rectangle
UVa - 10466 How Far?
medium
UVa - 10902 Pick-up Sticks
medium
segment-segment intersection
7.1
clarification: maximum number of sticks at any moment = 1000
CF - 671A
Recycling Bottles
medium
sortings
CF - 593B
Anton and Lines
medium
sortings
CF - 65C
Harry Potter and the Golden Snitch
medium
binary search, physics
CF - 552D
Vanya and Triangles
medium
brute force, counting, treemaps
CF - 404B
Marathon
medium
modular arithmetic
GYM - 100201B
The Minimal Angle
medium
rotations, formula
CF - 1032D
medium
Barcelonian Distance
UVa - 11894 Genius MJ
hard
UVa - 11519 Logo 2
hard
UVa - 11574 Colliding Traffic
hard
brute force, formula derivation, physics
CF - 590B
hard
binary search, physics
Chip 'n Dale Rescue Rangers
GYM - 100015E
Empty Triangles
transformation
EPS handling: read editorial
specialists
7.4
7.3
solvable with binary search
hard
my solution: O(n^2 log n). Package solution with hashmaps and sets O(n^3)
Triangles (plus Circles)
UVa - 438
The Circumference of the Circle
UVa - 11152 Colourful Flowers
very easy
very easy
7.2
UVa - 143
Orchard Trees
easy
inside triangle
CF - 766B
Mahmoud and a Triangle
easy
sorting
UVa - 10195 The Knights Of The Round Table
easy
CF - 1C
easy
Ancient Berland Circus
UVa - 10286 Trouble with a Pentagon
easy
UVa - 10991 Region
easy
UVa - 10210 Romeo and Juliet !
medium
UVa - 10387 Billiard
medium
UVa - 10577 Bounding Box
medium
UVa - 10792 The Laurel-Hardy Story
medium
UVa - 11909 Soya Milk
medium
UVa - 10734 Triangle Partitioning
medium
CF - 407A
medium
Triangle
UVa - 11164 Kingdom Division
7.3
nice author solution: fibonacci
7.1
regular polygons
bad precision
7.1
7.3
7.4
regular polygons
7.2
7.1
treesets, precision handling
tricky cases
hard
7.4
Circles
UVa - 10005 Packing polygons
easy
UVa - 10209 Is This Integration ?
medium
UVa - 10283 The Kissing Circles
medium
UVa - 10678 The Grazing Cow
medium
UVa - 1388
medium
Graveyard
GYM - 100200C
Circles
medium
CF - 342C
Cupboard and Balloons
medium
CF - 617C
Watering Flowers
easy
CF - 140A
New Year Table
7.1
7.3
7.4
7.2
circle-circle intersection
7.3
easy
kissing circles
UVa - 10823 Of Circles and Squares
easy
brute force
UVa - 10947 Bear with me, again..
easy
connected components, FW, dsu
UVa - 10668 Expanding Rods
easy
binary search
filtered
precision problem
Quadrilaterals
UVA - 11207 The easiest way
easy
UVa - 142
Mouse Clicks
easy
rectangles, brute force
UVa - 688
Mobile Phone Coverage
easy
rectangles, brute force
UVa - 638
Finding Rectangles
easy
rectangles, brute force
CF - 749B
Parallelogram is Back
easy
UVa - 11639 Guard the Land
medium
UVa - 12256 Making Quadrilaterals
medium
CF - 340B
medium
Maximal Area Quadrilateral
7.3
7.4
7.1
areas, brute force
compact solution using triangle area function
3D Objects
UVa - 815
Flooded!
medium
UVa - 737
Gleaming the Cubes
medium
UVa - 1280
Curvy Little Bottles
UVa - 10075 Airlines
UVa - 10897 Travelling Distance
hard
medium
easy
7.4
7.3
solid of revolution, binary search, polynomials
Needed two EPS because of binary search
spheres, FW
composite
great-circle distance
Polygons
UVa - 478
Points in Figures: Rectangles, Circles, Triangles easy
7.3
UVa - 11265 The Sultan's Problem
easy
polygon cut
7.4
UVa - 10065 Useless Tile Packers
easy
convex hull
7.3
UVa - 109
SCUD Busters
easy
Topcoder
CultureGrowth
easy
convex hull
UVa - 1111
Trash Removal
medium
convex hull
CF - 659D
Bicycle Race
medium
UVa - 811
The Fortified Forest
medium
convex hull, backtracking, bitmasks
CF - 166B
Polygons
medium
point in polygon
SPOJ - MPOLYPolygon
hard
7.1
very nice, O(1) and O(n) solutions
DP
Java TLE
CS
Point in Kgon
hard
inclusion-exclusion
easy
areas
↗
experts
Measures
UVa - 10499 The Land of Justice
Geometric Sweep
Line Sweep
Topcoder
BoxUnion
easy
UVa - 10245 The Closest Pair Problem
easy
standard
UVa - 11378 Bey Battle
easy
closest pair, Chebyshev distance
Topcoder
PowerSupply
medium
CF - 429D
Tricky Function
medium
UVa 12647
Balloon
medium
UVa - 833
Water Falls
medium
Topcoder
ConvexPolygons
hard
Circle Sweep
UVa 12675
Hide and seek
medium
Others
SPOJ MTRIAREA
Maximum Triangle Area
medium
solvable with inc-exc
closest pair
line segments, ccw
difficulty in modelling the problem as points and required answer is euclidean distance
7.2
weak test cases
Ad-hoc
Implementation
CF - 977A
Wrong Subtraction
very easy
CF - 946A
Partition
very easy
CF - 1041A
Heist
very easy
CF - 1005A
Tanya and Stairways
very easy
CF - 908A
New Year and Counting Cards
easy
CF - 426B
Sereja and Mirroring
easy
CF - 641A
Little Artem and Grasshopper
easy
CF - 669A
Little Artem and Presents
easy
CF - 195A
Let's Watch Football
easy
CF - 436B
Om Nom and Spiders
easy
CF - 182B
Vasya's Calendar
easy
CF - 677C
Vanya and Label
easy
CF - 3C
Tic-tac-toe
easy
CF - 4B
Center Alignment
easy
output formatting
CF - 147A
Punctuation
easy
output formatting
CF - 63B
Settlers' Training
easy
CF - 705A
Hulk
easy
CF - 62A
A Student's Dream
easy
CF - 71B
Progress Bar
easy
CF - 57A
Square Earth?
easy
CF - 88B
Keyboard
easy
CF - 56B
Spoilt Permutation
easy
CF - 46B
T-shirts from Sponsor
easy
CF - 48A
Rock-paper-scissors
easy
CF - 40A
Find Color
easy
CF - 51A
Cheaterius's Problem
easy
CF - 10A
Power Consumption Calculation
easy
CF - 32B
Borze
easy
CF - 47B
Coins
easy
CF - 8A
Train and Peter
easy
logic
nice
formula
seen
number systems
UVa - 10082 WERTYU
easy
GYM - 100015H
Hidden Code
easy
CF - 1016A
Death Note
easy
CF - 1174B
Ehab Is an Odd Person
easy
CF - 382
Arithmetic Progression
medium
cases handling, sortings
CF - 69C
Game
medium
treemaps, brute force
CF - 83B
Doctor
medium
sortings, math
CF - 93A
Frames
medium
tricky cases
CF - 96C
Hockey
medium
strings
CF - 433C
Ryouko's Memory Note
medium
sortings, math
discussed
hardcoding
good example for writing small codes
sortings
GYM - 100200G
Ranking
medium
CF - 863C
Yet Another Array Queries Problem
medium
CF - 34E
Collisions
hard
brute force, physics
GYM - 100200D
Linear Programming Dual
hard
parsing
backward thinking
add to specialists
Constructive Algorithms
CF - 417C
Football
easy
CF - 331A
The Closest Pair
easy
CF - 63D
Dividing Island
easy
CF - 78B
Easter Eggs
easy
CF - 49C
Disposition
easy
CF - 85A
Domino
easy
CF - 219A
Lesha and array splitting
easy
CF - 1174A
Ehab Fails to Be Thanos
CF - 590A
Median Smoothing
medium
CF - 663A
Rebus
medium
CF - 59D
Team Arrangement
medium
CF - 82B
Sets
medium
CF - 161B
Discounts
medium
CF - 370C
Mittens
medium
CF - 550E
Brackets in Implications
medium
CF - 949A
Zebras
medium
CF - 1148C
Crazy Diamond
medium
CF - 1174D
Ehab and the Expected XOR Problem
medium
CF - 754C
Vladik and chat
GYM - 100004B
Octagons
easy
number theory
divisibility insights
sortings
sortings
sortings
nice editorial solution
logic
bitmasks, XOring
hard
assignment problem variant, string parsing
solution similar to printing solution in MVC in bipartite graphs, solvable with DP
hard
reduction
important technique
easy
output formatting
Time Waster
CF - 151B
Phone Numbers
CF - 71D
Solitaire
medium
card game, brute force
Aces (for speed practice)
CF - 686A
Free Ice Cream
very easy
CF - 702A
Maximum Increase
very easy
CF - 688A
Opponents
easy
Random Solutions
GYM - 100015IIdentity Checker
easy
choose x as a multiple of PI
Specific Problems and Algorithms
UVa - 10017 The Never Ending Towers of Hanoi
easy
tower of hanoi
UVa - 344
easy
roman numerals
UVa - 11616 Roman Numerals
Roman Digititis
easy
roman numerals
UVa - 12397 Roman Numerals
easy
roman numerals
UVa - 759
The Return of the Roman Empire
easy
roman numerals
CF - 61C
Capture Valerian
easy
roman numerals, base number systems
UVa - 727
Equation
easy
expression notation conversion
UVa - 120
Stacks of Flapjacks
easy
pancake sorting, greedy
UVa - 1266
Magic Square
easy
magic square
GCJ 09 R2 - CStock Charts
medium
partially ordered sets, bipartite matching
10.4
link
Download