/Codeforces

Solutions to Codeforces Problems

Primary LanguageC++

Solutions to Codeforces Problems

Educational Codeforces Round 101 - 2/6

  • 1469A - Regular Bracket Sequence - Accepted
  • 1469B - Red and Blue - Accepted

Codeforces Round #686 (Div. 3) - 2/6

  • 1454A - Special Permutation - Accepted
  • 1454B - Unique Bid Auction - Accepted
  • 1454C - Sequence Transformation - Accepted
  • 1454D - Number into Sequence - Accepted

Codeforces Round #685 (Div. 2) - 2/7

  • 1451A - Subtract or Divide - Accepted
  • 1451B - Non-Substring Subsequence - Accepted
  • 1451C - String Equality - Accepted

Codeforces Round #684 (Div. 2) - 2/6

  • 1440A - Buy the String - Accepted
  • 1440B - Sum of Medians - Accepted
  • 1440C1 - Binary Table (Easy Version) - Accepted
  • 1440C2 - Binary Table (Hard Version) - Accepted

Codeforces Round #683 (Div. 2) - 1/7

  • 1447A - Add Candies - Accepted
  • 1447B - Numbers Box - Accepted

Codeforces Round #674 (Div. 3)

Virtual participation

  • 1426A - Floor Number - Accepted
  • 1426B - Symmetric Matrix - Accepted
  • 1426C - Increase and Copy - Accepted
  • 1426D - Non-zero Segments - Accepted

Codeforces Round #667 (Div. 3)

Virtual participation

  • 1409A - Yet Another Two Integers Problem - Accepted
  • 1409B - Minimum Product - Accepted
  • 1409C - Yet Another Array Restoration - Accepted

Codeforces Round #640 (Div. 4)

  • 1352F - Binary String Reconstruction - Accepted

Codeforces Round #634 (Div. 3)

  • 1335B - Construct the String - Accepted

Codeforces Global Round 5 - 1/9

  • 1237A - Balanced Rating Changes - Accepted
  • 1237B - Balanced Tunnel - Accepted
  • 1237C1 - Balanced Removals (Easier) - Accepted
  • 1237C2 - Balanced Removals (Harder) - Wrong answer

Educational Codeforces Round 72 - 0/6

  • 1217A - Creating a Character - Accepted
  • 1217B - Zmei Gorynich - Accepted
  • 1217C - The Number Of Good Substrings - Accepted

Codeforces Round #582 (Div. 3) - 3/8

  • 1213A - Chips Moving - Accepted
  • 1213B - Bad Prices - Accepted
  • 1213C - Book Reading - Accepted
  • 1213D1 - Equalizing by Division (easy version) - Accepted
  • 1213D2 - Equalizing by Division (hard version) - Accepted
  • 1213E - Two Small Strings - Accepted

Manthan, Codefest 19 - 1/8

  • 1208A - XORinacci - Accepted
  • 1208B - Uniqueness - Accepted
  • 1208C - Magic Grid - Accepted

Educational Codeforces Round 71 - 2/7

  • 1207A - There Are Two Types Of Burgers - Accepted
  • 1207B - Square Filling - Accepted
  • 1207C - Gas Pipeline - Accepted

Codeforces Round #581 (Div. 2) - 2/6

  • 1204A - BowWow and the Timetable - Accepted
  • 1204B - Mislove Has Lost an Array - Accepted
  • 1204C - Anna, Svyatoslav and Maps - Accepted

Codeforces Round #580 (Div. 2) - 3/6

  • 1206A - Choose Two Numbers - Accepted
  • 1206B - Make Product Equal One - Accepted
  • 1206C - Almost Equal - Accepted
  • 1206D - Shortest Cycle - Accepted

Codeforces Round #579 (Div. 3) - 4/8

  • 1203A - Circle of Students - Accepted
  • 1203B - Equal Rectangles - Accepted
  • 1203C - Common Divisors - Accepted
  • 1203D1 - Remove the Substring (easy version) - Accepted
  • 1203E - Boxers - Accepted

Codeforces Round #578 (Div. 2) - 1/6

  • 1200A - Hotelier - Accepted
  • 1200B - Block Adventure - Wrong answer

Educational Codeforces Round 70 - 0/6

  • 1202A - You Are Given Two Binary Strings... - Time limit exceeded
  • 1202D - Print a 1337-string... - Time limit exceeded

Codeforces Round #577 (Div. 2) - 1/5

  • 1201A - City Day - Accepted
  • 1201B - Water Lily - Wrong answer

Codeforces Round #576 (Div. 2) - 2/6

  • 1199A - City Day - Accepted
  • 1199B - Water Lily - Accepted
  • 1199C - MP3 - Wrong answer

Codeforces Round #575 (Div. 3) - 3/7

  • 1196A - Three Piles of Candies - Accepted
  • 1196B - Odd Sum Segments - Accepted
  • 1196D1 - RGB Substring (easy version) - Accepted

Educational Codeforces Round 69 - 2/6

  • 1197A - DIY Wooden Ladder - Accepted
  • 1197B - Pillars - Accepted
  • 1197C - Array Splitting - Memory limit exceeded

Codeforces Global Round 4 - 1/9

  • 1178A - Prime Minister - Accepted
  • 1178B - WOW Factor - Time limit exceeded
  • 1178C - Tiles - Wrong answer

Codeforces Round #573 (Div. 2) - 3/7

  • 1195A - Drinks Choosing - Accepted
  • 1195B - Sport Mafia - Accepted
  • 1195C - Basketball Exercise - Accepted
  • 1195D1 - Submarine in the Rybinsk Sea (easy edition) - Time limit exceeded

Educational Codeforces Round 68 - 2/7

  • 1194A - Remove a Progression - Accepted
  • 1194B - Yet Another Crosses Problem - Time limit exceeded
  • 1194C - From S To T - Accepted

Codeforces Round #573 (Div. 2) - 3/6

  • 1191A - Tokitsukaze and Enhancement - Accepted
  • 1191B - Tokitsukaze and Mahjong - Accepted
  • 1191C - Tokitsukaze and Discard Items - Accepted
  • 1191D - Tokitsukaze, CSL and Stone Game - Wrong answer

Kotlin Heroes: Practice - 5/6

  • 1171A - Dice Rolling - Accepted
  • 1171B - New Year and the Christmas Ornament - Accepted
  • 1171C - Letters Rearranging - Accepted
  • 1171D - Got Any Grapes? - Accepted
  • 1171E - Doggo Recoloring - Accepted
  • 1171F - Division and Union - Accepted

Codeforces Round #540 - 3/8

  • 1141A - Game 23 - Accepted
  • 1141B - Maximal Continuous Rest - Accepted
  • 1141C - Polycarp Restores Permutation - Accepted
  • 1141D - Colored Boots - Accepted

Codeforces Round #540 - 2/8

  • 1118A - Water Buying - Accepted
  • 1118B - Tanya and Candies - Accepted
  • 1118C - Palindromic Matrix - Accepted
  • 1118D1 - Coffee and Coursework (Easy Version) - Accepted
  • 1118D2 - Coffee and Coursework (Hard Version) - Accepted
  • 1118E - Yet Another Ball Problem - Accepted
  • 1118F1 - Tree Cutting (Easy Version) - Accepted

Codeforces Round #539 - 2/6

  • 1113A - Sasha and His Trip - Accepted
  • 1113B - Sasha and Magnetic Machines - Accepted
  • 1113C - Sasha and a Bit of Relax - Memory limit exceeded

Codeforces Round #538 - 1/6

  • 1114A - Got Any Grapes? - Accepted
  • 1114B - Yet Another Array Partitioning Task - Wrong answer
  • 1114C - Trailing Loves (or L'oeufs?) - Wrong answer
  • 1114D - Flood Fill - Wrong answer

Codeforces Global Round 1 - 1/8

  • 1110A - Parity - Accepted
  • 1110B - Tape - Accepted
  • 1110C - Meaningless Operations - Accepted
  • 1110D - Jongmah - Wrong answer
  • 1110E - Magic Stones - Wrong answer

Codeforces Round #532 - 4/6

  • 1106A - Lunar New Year and Cross Counting - Accepted
  • 1106B - Lunar New Year and Food Ordering - Accepted
  • 1106C - Lunar New Year and Number Division - Accepted
  • 1106D - Lunar New Year and a Wander - Accepted

Educational Codeforces Round 58 - 3/7

  • 1101A - Minimum Integer - Accepted
  • 1101B - Accordion - Accepted
  • 1101C - Division and Union - Accepted
  • 1101E - Polycarp's New Job - Accepted

Codeforces Round #531 - 3/6

  • 1102A - Integer Sequence Dividing - Accepted
  • 1102B - Array K-Coloring - Accepted
  • 1102C - Doors Breaking and Repairing - Accepted
  • 1102D - Balanced Ternary String - Accepted

Codeforces Round #530 - 3/6

  • 1099A - Snowball - Accepted
  • 1099B - Squares and Segments - Accepted
  • 1099C - Postcard - Accepted

Hello 2019 - 3/8

  • 1097A - Gennady and a Card Game - Accepted
  • 1097B - Petr and a Combination Lock - Accepted
  • 1097C - Yuhao and a Parenthesis - Accepted

Good Bye 2018 - 3/8

  • 1091A - New Year and the Christmas Ornament - Accepted
  • 1091B - New Year and the Treasure Geolocation - Accepted
  • 1091C - New Year and the Sphere Transmission - Accepted

Educational Codeforces Round 57 - 2/7

  • 1096A - Find Divisible - Accepted
  • 1096B - Substring Removal - Accepted
  • 1096C - Polygon for the Angle - Wrong answer

Codeforces Round #529 - 3/6

  • 1095A - Repeating Cipher - Accepted
  • 1095B - Array Stabilization - Accepted
  • 1095C - Powers Of Two - Accepted

Codeforces Round #528 - 2/6

  • 1087A - Right-Left Cipher - Accepted
  • 1087B - Div Times Mod - Accepted

Codeforces Round #527 - 2/7

  • 1092A - Uniform String - Accepted
  • 1092B - Teams Forming - Accepted
  • 1092C - Prefixes and Suffixes - Wrong answer

Avito Cool Challenge 2018 - 1/8

  • 1081A - Definite Game - Accepted
  • 1081B - Farewell Party - Wrong answer

Educational Codeforces Round 56 - 2/7

  • 1093A - Dice Rolling - Accepted
  • 1093B - Letters Rearranging - Accepted
  • 1093C - Mishka and the Last Exam - Accepted
  • 1093D - Beautiful Graph - Wrong answer

Codeforces Round #526 - 2/6

  • 1084A - The Fair Nut and Elevator - Accepted
  • 1084B - Kvass and the Fair Nut - Accepted

Educational Codeforces Round 54 - 1/7

  • 1082A - Vasya and Book - Accepted
  • 1082B - Vova and Trophies - Wrong answer

Codeforces Round #524 - 3/6

  • 1080A - Petya and Origami - Accepted
  • 1080B - Margarite and the best present - Accepted
  • 1080C - Masha and two friends - Accepted

Codeforces Round #523 - 1/6

  • 1061A - Coins - Accepted
  • 1061B - Views Matter - Wrong answer

Codeforces Round #521 - 3/7

  • 1077A - Frog Jumping - Accepted
  • 1077B - Disturbed People - Accepted
  • 1077C - Good Array - Accepted
  • 1077D - Cutting Out - Wrong answer

Codeforces Round #520 - 2/6

  • 1062A - A Prank - Accepted
  • 1062B - Math - Accepted
  • 1062C - Banh-mi - Wrong answer

Educational Codeforces Round 54 - 3/7

  • 1076A - Minimizing the String - Accepted
  • 1076B - Divisor Subtraction - Accepted
  • 1076C - Meme Problem - Accepted

Mail.Ru Cup 2018 - Round 2 - 1/7

  • 1055A - Metro - Accepted
  • 1055B - Alice and Hairdresser - Accepted

Codeforces Round #519 - 2/7

  • 1043A - Elections - Accepted
  • 1043B - Lost Array - Accepted
  • 1043C - Smallest Word - Accepted

Educational Codeforces Round 53 - 2/7

  • 1073A - Diverse Substring - Accepted
  • 1073B - Vasya and Books - Accepted
  • 1073D - Berland Fair - Time limit exceeded

Codeforces Round #518 - 2/6

  • 1068A - Birthday - Accepted
  • 1068B - LCM - Accepted

Codeforces Round #511 - 1/5

  • 1047A - Little C Loves 3 I - Accepted
  • 1047B - Cover Points - Accepted

Codeforces Round #510 - 2/6

  • 1042A - Benches - Accepted
  • 1042B - Vitamins - Accepted
  • 1042C - Array Product - Accepted

Codeforces Round #509 - 2/6

  • 1041A - Heist - Accepted
  • 1041B - Buying a TV Set - Accepted
  • 1041C - Coffee Break - Accepted

Educational Codeforces Round 49 - 1/7

  • 1036A - Function Height - Accepted
  • 1036B - Diagonal Walking v.2 - Accepted

Codeforces Round #508 - 3/6

  • 1038A - Equality - Accepted
  • 1038B - Non-Coprime Partition - Accepted
  • 1038C - Gambling - Accepted

Codeforces Round #507 - 1/5

  • 1040A - Palindrome Dance - Accepted
  • 1040B - Shashlik Cooking - Accepted

Manthan, Codefest 18 - 3/8

  • 1037A - Packets - Accepted
  • 1037B - Reach Median - Accepted
  • 1037C - Equalize - Accepted
  • 1037D - Valid BFS? - Accepted

AIM Tech Round 5 - 2/8

  • 1028A - Find Square - Accepted
  • 1028B - Unnatural Conditions - Accepted

Codeforces Round #506 - 0/6

  • 1029A - Many Equal Substrings - Accepted
  • 1029B - Creating the Contest - Accepted

Educational Codeforces Round 49 - 1/7

  • 1027A - Palindromic Twist - Accepted
  • 1027B - Numbers on the Chessboard - Accepted

Codeforces Round #503 - 2/5

  • 1020A - New Building for SIS - Accepted
  • 1020B - Badge - Accepted

Codeforces Round #502 - 2/8

  • 1017A - The Rank - Accepted
  • 1017B - The Bits - Accepted
  • 1017C - The Phone Number - Wrong answer

Codeforces Round #501 - 4/7

  • 1015A - Points in Segments - Accepted
  • 1015B - Obtaining the String - Accepted
  • 1015C - Songs Compression - Accepted
  • 1015D - Walking Between Houses - Accepted
  • 1015E1 - Stars Drawing (Easy Edition) - Wrong answer

Codeforces Round #500 - 2/5

  • 1013A - Piles With Stones - Accepted
  • 1013B - And - Accepted
  • 1013C - Photo of The Sky - Wrong answer

Codeforces Round #498 - 3/6

  • 1006A - Adjacent Replacements - Accepted
  • 1006B - Polycarp's Practice - Accepted
  • 1006C - Three Parts of the Array - Accepted

Educational Codeforces Round 47 - 2/7

  • 1009A - Game Shopping - Accepted
  • 1009B - Minimum Ternary String - Accepted

Codeforces Round #497 - 1/5

  • 1008A - Romaji - Accepted
  • 1008B - Turn the Rectangles - Accepted
  • 1008C - Reorder the Array - Time limit exceeded

Codeforces Round #494 - 2/6

  • 1003A - Polycarp's Pockets - Accepted
  • 1003B - Binary String Constructing - Accepted
  • 1003C - Intense Heat - Accepted

Educational Codeforces Round 46 - 1/7

  • 1000A - Codehorses T-shirts - Accepted
  • 1000B - Light It Up - Accepted

Codeforces Round #492 - 2/6

  • 996A - Hit the Lottery - Accepted
  • 996B - World Cup - Accepted
  • 996D - Suit and Tie - Accepted
  • 996E - Leaving the Bar - Wrong answer

Codeforces Round #491 - 2/6

  • 991A - If at first you don't succeed... - Accepted
  • 991B - Getting an A - Accepted
  • 991C - Candies - Wrong answer

Codeforces Round #490 - 3/6

  • 999A - Mishka and Contest - Accepted
  • 999B - Reversing Encryption - Accepted
  • 999C - Alphabetic Removals - Accepted

Educational Codeforces Round 45 - 1/7

  • 990A - Commentary Boxes - Accepted
  • 990B - Micro-World - Accepted

Codeforces Round #486 - 3/6

  • 988A - Diverse Team - Accepted
  • 988B - Substrings Sort - Accepted
  • 988C - Equal Sums - Accepted
  • 988E - Divisibility by 25 - Time limit exceeded

Codeforces Round #482 - 1/5

  • 979A - Pizza, Pizza, Pizza!!! - Accepted
  • 979B - Treasure Hunt - Wrong answer
  • 979C - Kuro and Walking Route - Wrong answer

Codeforces Round #481 - 3/7

  • 978A - Remove Duplicates - Accepted
  • 978B - File Name - Accepted
  • 978C - Letters - Accepted
  • 978D - Almost Arithmetic Progression - Wrong answer
  • 978E - Bus Video System - Accepted

Codeforces Round #479 - 4/6

  • 977A - Wrong Subtraction - Accepted
  • 977B - Two-gram - Accepted
  • 977C - Less or Equal - Accepted
  • 977D - Divide by three, multiply by two - Accepted

Codeforces Round #476 - 2/5

  • 965A - Paper Airplanes - Accepted
  • 965B - Battleship - Accepted
  • 965C - Greedy Arkady - Wrong answer

Codeforces Round #475 - 2/5

  • 964A - Splits - Accepted
  • 964B - Messages - Accepted

Educational Codeforces Round 42 - 2/7

  • 962A - Equator - Accepted
  • 962B - Students in Railway Carriage - Accepted
  • 962C - Make a Square - Accepted

Codeforces Round #473 - 3/6

  • 959A - Mahmoud and Ehab and the even-odd game - Accepted
  • 959B - Mahmoud and Ehab and the message - Accepted
  • 959C - Mahmoud and Ehab and the wrong algorithm - Accepted

Educational Codeforces Round 40 - 1/9

  • 954A - Diagonal Walking - Accepted
  • 954B - String Typing - Accepted
  • 954C - Matrix Walk - Wrong answer
  • 954D - Fight Against Traffic - Wrong answer

Codeforces Round #464 - 2/6

  • 939A - Love Triangle - Accepted
  • 939B - Hamster Farm - Accepted
  • 939C - Convenient For Everybody - Time limit exceeded

Codeforces Round #461 - 1/6

  • 922A - Cloning Toys - Accepted
  • 922B - Magic Forest - Accepted
  • 922C - Cave Painting - Accepted
  • 922D - Robot Vacuum Cleaner - Wrong answer

Codeforces Round #457 - 1/5

  • 916A - Jamie and Alarm Snooze - Accepted

Educational Codeforces Round 33 - 3/6

  • 893A - Chess For Three - Accepted
  • 893B - Beautiful Divisors - Accepted
  • 893C - Rumor - Accepted

Codeforces Round #447 - 1/5

  • 894A - QAQ - Accepted
  • 894B - Ralph And His Magic Field - Wrong answer

Codeforces Round #444 - 1/6

  • 887A - Div. 64 - Accepted
  • 887B - Cubes for Masha - Accepted
  • 887C - Solution for Cube - Accepted

Codeforces Round #443 - 1/5

  • 879A - Borya's Diagnosis - Accepted
  • 879B - Table Tennis - Accepted

Codeforces Round #439 - 1/5

  • 869A - The Artful Expedient - Accepted
  • 869B - The Eternal Immortality - Accepted
  • 869C - The Intriguing Obsession - Accepted

Codeforces Round #437 - 1/6

  • 867A - Between the Offices - Accepted

Codeforces Round #436 - 2/6

  • 864A - Fair Game - Accepted
  • 864B - Polycarp and Letters - Accepted
  • 864C - Bus - Accepted
  • 864D - Make a Permutation! - Accepted

Codeforces Round #433 - 2/5

  • 854A - Fraction - Accepted
  • 854B - Maxim Buys an Apartment - Accepted

Codeforces Round #431 - 1/5

  • 849A - Odds and Ends - Accepted
  • 849B - Tell Your World - Wrong answer

Codeforces Round #430 - 2/5

  • 842A - Kirill And The Game - Accepted
  • 842B - Gleb And Pizza - Accepted
  • 842C - Ilya And The Tree - Wrong answer

Codeforces Round #428 - 1/5

  • 839A - Arya and Bran - Accepted
  • 839C - Journey - Accepted

Codeforces Round #427 - 1/6

  • 835A - Key races - Accepted
  • 835B - The number on the board - Accepted
  • 835C - Star sky - Time limit exceeded

Codeforces Round #426 - 2/5

  • 834A - The Useless Toy - Accepted
  • 834B - The Festive Evening - Accepted
  • 834C - The Meaningless Game - Wrong answer

Codeforces Round #421 - 0/5

  • 820A - Mister B and Book Reading - Wrong answer
  • 820C - Mister B and Boring Game - Memory limit exceeded

Codeforces Round #420 - 1/5

  • 821A - Okabe and Future Gadget Laboratory - Accepted
  • 821B - Okabe and Banana Trees - Accepted
  • 821C - Okabe and Boxes - Wrong answer

Codeforces Round #419 - 2/5

  • 816A - Karen and Morning - Accepted
  • 816B - Karen and Coffee - Accepted
  • 816C - Karen and Game - Accepted

Codeforces Round #411 - 3/6

  • 805A - Fake NP - Accepted
  • 805B - 3-palindrome - Accepted
  • 805C - Find Amir - Accepted
  • 805D - Minimum number of steps - Accepted

Codeforces Round #410 - 2/5

  • 798A - Mike and palindrome - Accepted
  • 798B - Mike and strings - Accepted

VK Cup 2017 - Wild Card Round 1 - 3/12

  • 795C - Maximum Number - Accepted
  • 795D - Lie or Truth
  • 795K - Stepan and Vowels

Codeforces Round #407 - 0/5

  • 789A - Anastasia and pebbles - Accepted
  • 789B - Masha and geometric depression - Wrong answer

Codeforces Round #406 - 1/5

  • 787A - The Monster - Accepted
  • 787B - Not Afraid - Accepted

VK Cup 2017 - Round 1 - 0/6

  • 771A - Bear and Friendship Condition - Accepted
  • 771B - Bear and Different Names - Accepted

Codeforces Round #404 - 2/5

  • 785A - Anton and Polyhedrons - Accepted
  • 785B - Anton and Classes - Accepted
  • 785C - Anton and Fairy Tale - Accepted

VK Cup 2017 - Qualification 2 - 4/4

  • 770A - New Password
  • 770B - Maximize Sum of Digits
  • 770C - Online Courses in BSU - Accepted
  • 770D - Draw Brackets! - Accepted

VK Cup 2017 - Qualification 1 - 2/4

  • 769A - Year of University Entrance
  • 769B - News About Credit
  • 769C - Cycle In Maze - Accepted
  • 769D - k-Interesting Pairs of Integers

Codeforces Round #402 - 1/5

  • 779A - Pupils Redistribution - Accepted
  • 779B - Weird Rounding - Accepted
  • 779C - Dishonest Sellers - Accepted

Codeforces Round #401 - 0/5

  • 777A - Shell Game - Accepted
  • 777B - Game of Credit Cards - Accepted
  • 777C - Alyona and Spreadsheet - Accepted

Codeforces Round #400 - 1/7

  • 776A - A Serial Killer - Accepted
  • 776B - Sherlock and his girlfriend - Accepted

Codeforces Round #399 - 1/7

  • 768A - Oath of the Night's Watch - Accepted
  • 768B - Code for 1 - Accepted
  • 768C - Jon Snow and his Favourite Number - Accepted

Codeforces Round #398 - 0/5

  • 767A - Snacktower - Accepted

Codeforces Round #397 - 2/7

  • 765A - Neverending competitions - Accepted
  • 765B - Code obfuscation - Accepted
  • 765C - Table Tennis Game 2 - Accepted

Codeforces Round #396 - 2/5

  • 766A - Mahmoud and Longest Uncommon Subsequence - Accepted
  • 766B - Mahmoud and a Triangle - Accepted

Codeforces Round #396

  • 764A - Taymyr is calling you - Accepted
  • 764B - Timofey and cubes - Accepted

Problems solved: 309