This repository contains my solutions of Codeforces problems. They are in C++ language.
Index | Problem ID | Problem Name | Question | Solution |
---|---|---|---|---|
1 | 1 A | Theater Square | Question | Solution |
2 | 2 A | Winner | Question | Solution |
3 | 4 A | Watermelon | Question | Solution |
4 | 4 C | Registration System | Question | Solution |
5 | 9 A | Die Roll | Question | Solution |
6 | 11 A | Increasing Sequence | Question | Solution |
7 | 17 A | Noldbach problem | Question | Solution |
8 | 22 A | Second Order Statistics | Question | Solution |
9 | 34 A | Reconnaissance 2 | Question | Solution |
10 | 34 B | Sale | Question | Solution |
11 | 41 A | Translation | Question | Solution |
12 | 45 A | Codecraft III | Question | Solution |
13 | 50 A | DominoPiling | Question | Solution |
14 | 59 A | Word | Question | Solution |
15 | 71 A | Way Too Long Words | Question | Solution |
16 | 74 A | Room Leader | Question | Solution |
17 | 110 A | Nearly Lucky Number | Question | Solution |
18 | 112 A | Petya And Strings | Question | Solution |
19 | 116 A | Tram | Question | Solution |
20 | 118 B | Present from Lena | Question | Solution |
21 | 122 A | Lucky Division | Question | Solution |
22 | 122 B | Lucky Substring | Question | Solution |
23 | 131 A | cAPS lOCK | Question | Solution |
24 | 136 A | Presents | Question | Solution |
25 | 141 A | Amusing Joke | Question | Solution |
26 | 144 A | Arrival of the General | Question | Solution |
27 | 148 A | Insomnia cure | Question | Solution |
28 | 151 A | Soft Drinking | Question | Solution |
29 | 155 A | I_love_%username% | Question | Solution |
30 | 158 A | Next Round | Question | Solution |
31 | 158 B | Taxi | Question | Solution |
32 | 173 A | Rock-Paper-Scissors | Question | Solution |
33 | 189 A | Cut Ribbon | Question | Solution |
34 | 200 B | Drinks | Question | Solution |
35 | 208 A | Dubstep | Question | Solution |
36 | 230 B | T-primes | Question | Solution |
37 | 231 A | Team | Question | Solution |
38 | 236 A | Boy Or Girl | Question | Solution |
39 | 263 A | Beautiful Matrix | Question | Solution |
40 | 266 A | Stones on the Table | Question | Solution |
41 | 266 B | Queue at the School | Question | Solution |
42 | 268 A | Games | Question | Solution |
43 | 271 A | Beautiful Year | Question | Solution |
44 | 281 A | Word Capitalization | Question | Solution |
45 | 282 A | Bit++ | Question | Solution |
46 | 313 A | Ilya and Bank Account | Question | Solution |
47 | 318 A | Even Odds | Question | Solution |
48 | 339 A | Helpful Maths | Question | Solution |
49 | 343 B | Alternating Current | Question | Solution |
50 | 344 A | Magnets | Question | Solution |
51 | 349 A | Cinema Line | Question | Solution |
52 | 411 A | Password Check | Question | Solution |
53 | 421 A | Pasha and Hamsters | Question | Solution |
54 | 456 B | Fedya and Maths | Question | Solution |
55 | 466 A | Cheap Travel | Question | Solution |
56 | 474 B | Worms | Question | Solution |
57 | 478 C | Table Decorations | Question | Solution |
58 | 486 A | Calculating Function | Question | Solution |
59 | 489 B | BerSU Ball | Question | Solution |
60 | 492 A | Vanya and Cubes | Question | Solution |
61 | 492 B | Vanya and Lanterns | Question | Solution |
62 | 510 A | Fox And Snake | Question | Solution |
63 | 514 A | Chewbaсca and Number | Question | Solution |
64 | 525 A | Vitaliy and Pie | Question | Solution |
65 | 546 A | Soldier and Bananas | Question | Solution |
66 | 584 A | Olesya and Rodion | Question | Solution |
67 | 599 A | Patrick and Shopping | Question | Solution |
68 | 617 A | Elephant | Question | Solution |
69 | 630 A | Again Twenty Five! | Question | Solution |
70 | 677 A | Vanya and Fence | Question | Solution |
71 | 705 A | Hulk | Question | Solution |
72 | 706 B | Interesting drink | Question | Solution |
73 | 734 A | Anton and Danik | Question | Solution |
74 | 742 A | Arpas hard exam and Mehrdads naive cheat | Question | Solution |
75 | 791 A | Bear And Big Brother | Question | Solution |
76 | 854 A | Fraction | Question | Solution |
77 | 855 A | Tom Riddle's Diary | Question | Solution |
78 | 977 A | Wrong Substraction | Question | Solution |
79 | 1068 A | Birthday | Question | Solution |
80 | 1076 C | Meme Problem | Question | Solution |
81 | 1088 A | Ehab and another construction problem | Question | Solution |
82 | 1106 C | Lunar New Year and Number Division | Question | Solution |
83 | 1118 B | Tanya and Candies | Question | Solution |
84 | 1133 A | Middle of the Contest | Question | Solution |
85 | 1144 C | Two Shuffled Sequences | Question | Solution |
86 | 1154 A | Restoring Three Numbers | Question | Solution |
87 | 1166 A | Silent Classroom | Question | Solution |
88 | 1196 A | Three Piles of Candies | Question | Solution |
89 | 1279 A | New Year Garland | Question | Solution |
90 | 1295 A | Display The Number | Question | Solution |
91 | 1296 A | Array with Odd Sum | Question | Solution |
92 | 1301 A | Three Strings | Question | Solution |
93 | 1311 A | Add Odd or Subtract Even | Question | Solution |
94 | 1328 A | Divisibility Problem | Question | Solution |
95 | 1341 A | Nastya and Rice | Question | Solution |
96 | 1343 B | Balanced Array | Question | Solution |
97 | 1352 C | K-th Not Divisible by n | Question | Solution |
98 | 1360 B | Honest Coach | Question | Solution |
99 | 1364 A | XXXXX | Question | Solution |
100 | 1367 A | Short Substrings | Question | Solution |
101 | 1367 B | Even Array | Question | Solution |
102 | 1389 A | LCM Problem | Question | Solution |
103 | 1391 B | Fix You | Question | Solution |
104 | 1399 A | Remove Smallest | Question | Solution |
105 | 1426 A | Floor Number | Question | Solution |
106 | 1440 B | Sum of Medians | Question | Solution |
107 | 1471 A | Strange Partition | Question | Solution |
108 | 1475 A | Odd Divisor | Question | Solution |
109 | 1512 A | Spy Detected! | Question | Solution |
110 | 1534 A | Colour the Flag | Question | Solution |
111 | 1537 A | Arithmetic Array | Question | Solution |
112 | 1537 B | Bad Boy | Question | Solution |
113 | 1582 B | Luntik and Subsequences | Question | Solution |
114 | 1606 A | AB Balance | Question | Solution |
115 | 1607 B | Odd Grasshopper | Question | Solution |
116 | 1624 B | Make AP | Question | Solution |
117 | 1633 A | Div. 7 | Question | Solution |
118 | 1665 B | Array Cloning Technique | Question | Solution |
119 | 1666 D | Deletive Editing | Question | Solution |
120 | 1675 B | Make It Increasing | Question | Solution |
121 | 1676 A | Lucky | Question | Solution |
122 | 1679 A | AvtoBus | Question | Solution |
123 | 1680 A | Minimums and Maximums | Question | Solution |
124 | 1692 A | Marathon | Question | Solution |
125 | 1696 B | NIT Destroys the Universe | Question | Solution |
126 | 1703 A | YES or YES | Question | Solution |
127 | 1703 B | ICPC Balloons | Question | Solution |
128 | 1719 A | Chip Game | Question | Solution |
129 | 1719 B | Mathematical Circus | Question | Solution |
130 | 1721 B | Deadly Laser | Question | Solution |
131 | 1726 A | Mainak and Array | Question | Solution |
132 | 1742 A | Sum | Question | Solution |
133 | 1742 C | Stripes | Question | Solution |
134 | 1746 B | Rebellion | Question | Solution |
135 | 1748 A | The Ultimate Square | Question | Solution |
136 | 1758 B | XOR = Average | Question | Solution |
137 | 1760 A | Medium Number | Question | Solution |
138 | 1761 A | Two Permutations | Question | Solution |
139 | 1765 B | Broken Keyboard | Question | Solution |
140 | 1765 E | Exchange | Question | Solution |
141 | 1765 K | Torus Path | Question | Solution |
142 | 1765 M | Minimum LCM | Question | Solution |
143 | 1766 A | Extremely Round | Question | Solution |
144 | 1773 F | Football | Question | Solution |
145 | 1777 A | Everybody Likes Good Arrays! | Question | Solution |
146 | 1783 A | Make it Beautiful | Question | Solution |
147 | 1788 A | One and Two | Question | Solution |
148 | 1789 A | Serval and Mocha's Array | Question | Solution |
149 | 1791 B | Following Directions | Question | Solution |
150 | 1791 C | Prepend and Append | Question | Solution |
151 | 1792 A | Gaming Forces | Question | Solution |
152 | 1794 B | Not Dividing | Question | Solution |
153 | 1795 B | Ideal Point | Question | Solution |
154 | 1800 A | Is It a Cat | Question | Solution |
155 | 1805 A | We Need the Zero | Question | Solution |
156 | 1806 A | Walking Master | Question | Solution |
157 | 1807 D | Odd Queries | Question | Solution |
158 | 1811 A | Insert Digit | Question | Solution |
159 | 1814 A | Coins | Question | Solution |
160 | 1818 B | Indivisible | Question | Solution |
161 | 1822 A | TubeTube Feed | Question | Solution |
162 | 1822 C | Bun Lover | Question | Solution |
163 | 1828 A | Divisible Array | Question | Solution |
164 | 1828 B | Permutation Swap | Question | Solution |
165 | 1829 A | Love Story | Question | Solution |
166 | 1829 B | Blank Spaces | Question | Solution |
167 | 1829 C | Mr. Perfectly Fine | Question | Solution |
168 | 1829 D | Gold Rush | Question | Solution |
169 | 1831 A | Twin Permutations | Question | Solution |
170 | 1832 A | New Palindrome | Question | Solution |
171 | 1832 B | Maximum Sum | Question | Solution |
172 | 1833 A | Musical Puzzle | Question | Solution |
173 | 1833 B | Restore the Weather | Question | Solution |
174 | 1833 C | Vlad Building Beautiful Array | Question | Solution |
175 | 1834 A | Unit Array | Question | Solution |
176 | 1837 A | Grasshopper on a Line | Question | Solution |
177 | 1837 B | Comparison String | Question | Solution |
178 | 1841 B | Keep it Beautiful | Question | Solution |
179 | 1843 A | Sasha and Array Coloring | Question | Solution |
180 | 1843 B | Long Long | Question | Solution |
181 | 1844 A | Subtraction Game | Question | Solution |
182 | 1845 A | Forbidden Integer | Question | Solution |
183 | 1846 A | Rudolph and Cut the Rope | Question | Solution |
184 | 1846 B | Rudolph and Tic-Tac-Toe | Question | Solution |
185 | 1846 C | Rudolf and the Another Competition | Question | Solution |
186 | 1848 A | Vika and Her Friends | Question | Solution |
187 | 1849 A | Morning Sandwich | Question | Solution |
188 | 1849 B | Monsters | Question | Solution |
189 | 1850 A | To My Critics | Question | Solution |
190 | 1850 B | Ten Words of Wisdom | Question | Solution |
191 | 1850 C | Word on the Paper | Question | Solution |
192 | 1850 D | Balanced Round | Question | Solution |
193 | 1851 A | Escalator Conversations | Question | Solution |
194 | 1851 B | Parity Sort | Question | Solution |
195 | 1851 C | Tiles Comeback | Question | Solution |
196 | 1853 A | Desorting | Question | Solution |
197 | 1855 A | Dalton the Teacher | Question | Solution |
198 | 1855 B | Longest Divisors Interval | Question | Solution |
199 | 1856 B | Good Arrays | Question | Solution |
200 | 1857 A | Array Coloring | Question | Solution |
201 | 1857 B | Maximum Rounding | Question | Solution |
202 | 1857 C | Assembly via Minimums | Question | Solution |
203 | 1858 A | Buttons | Question | Solution |
204 | 1859 A | United We Stand | Question | Solution |
205 | 1860 A | Not a Substring | Question | Solution |
206 | 1862 A | Gift Carpet | Question | Solution |
207 | 1862 B | Sequence Game | Question | Solution |
208 | 1863 A | Channel | Question | Solution |
209 | 1864 A | Increasing and Decreasing | Question | Solution |
210 | 1866 A | Ambitious Kid | Question | Solution |
211 | 1869 A | Make It Zero | Question | Solution |
212 | 1870 A | MEXanized Array | Question | Solution |
213 | 1872 A | Two Vessels | Question | Solution |
214 | 1872 B | The Corridor or There and Back Again | Question | Solution |
215 | 1872 C | Non-coprime Split | Question | Solution |
216 | 1873 A | Short Sort | Question | Solution |
217 | 1873 B | Good Kid | Question | Solution |
218 | 1873 C | Target Practice | Question | Solution |
219 | 1873 D | 1D Eraser | Question | Solution |
220 | 1875 A | Jellyfish and Undertale | Question | Solution |
221 | 1877 A | Goals of Victory | Question | Solution |
222 | 1878 A | How Much Does Daytona Cost | Question | Solution |
223 | 1878 B | Aleksa and Stack | Question | Solution |
224 | 1878 C | Vasilije in Cacak | Question | Solution |
225 | 1879 A | Rigged! | Question | Solution |
226 | 1879 B | Chips on the Board | Question | Solution |
227 | 1881 A | Don't Try to Count | Question | Solution |
228 | 1881 B | Three Threadlets | Question | Solution |
229 | 1881 C | Perfect Square | Question | Solution |
230 | 1883 B | Chemistry | Question | Solution |
231 | 1890 A | Doremy's Paint 3 | Question | Solution |
232 | 1890 B | Qingshan Loves Strings | Question | Solution |
233 | 1891 A | Sorting with Twos | Question | Solution |
234 | 1894 A | Secret Sport | Question | Solution |
235 | 1895 A | Treasure Chest | Question | Solution |
236 | 1895 B | Points and Minimum Distance | Question | Solution |
237 | 1896 A | Jagged Swaps | Question | Solution |
238 | 1896 B | AB Flipping | Question | Solution |
239 | 1898 A | Milica and String | Question | Solution |
240 | 1899 A | Game with Integers | Question | Solution |
241 | 1900 A | Cover in Water | Question | Solution |
242 | 1900 B | Laura and Operations | Question | Solution |
243 | 1901 A | Line Trip | Question | Solution |
244 | 1902 A | Binary Imbalance | Question | Solution |
245 | 1903 A | Halloumi Boxes | Question | Solution |
246 | 1904 A | Forked! | Question | Solution |
247 | 1904 B | Collecting Game | Question | Solution |
248 | 1905 A | Constructive Problems | Question | Solution |
249 | 1905 B | Begginer's Zelda | Question | Solution |
250 | 1905 C | Largest Subsequence | Question | Solution |
251 | 1907 A | Rook | Question | Solution |
252 | 1907 B | YetnotherrokenKeoard | Question | Solution |
253 | 1907 C | Removal of Unattractive Pairs | Question | Solution |
254 | 1909 A | Distinct Buttons | Question | Solution |
255 | 1912 L | LOL Lovers | Question | Solution |
256 | 1913 A | Rating Increase | Question | Solution |
257 | 1913 B | Swap and Delete | Question | Solution |
258 | 1913 C | Game with Multiset | Question | Solution |
259 | 1914 A | Problemsolving Log | Question | Solution |
260 | 1914 B | Preparing for the Contest | Question | Solution |
261 | 1914 C | Quests | Question | Solution |
262 | 1914 D | Three Activities | Question | Solution |
263 | 1914 E1 | Game with Marbles (Easy Version) | Question | Solution |
264 | 1914 E2 | Game with Marbles (Hard Version) | Question | Solution |
265 | 1915 A | Odd One Out | Question | Solution |
266 | 1915 B | Not Quite Latin Square | Question | Solution |
267 | 1915 C | Can I Square | Question | Solution |
268 | 1915 D | Unnatural Language Processing | Question | Solution |
269 | 1915 E | Romantic Glasses | Question | Solution |
270 | 1916 A | 2023 | Question | Solution |
271 | 1916 B | Two Divisors | Question | Solution |
272 | 1916 C | Training Before the Olympiad | Question | Solution |
273 | 1916 D | Mathematical Problem | Question | Solution |
274 | 1917 A | Least Product | Question | Solution |
275 | 1917 B | Erase First or Second Letter | Question | Solution |
276 | 1918 A | Brick Wall | Question | Solution |
277 | 1918 B | Minimize Inversions | Question | Solution |
278 | 1919 A | Wallet Exchange | Question | Solution |
279 | 1919 B | Plus-Minus Split | Question | Solution |
280 | 1920 A | Satisfying Constraints | Question | Solution |
281 | 1920 B | Summation Game | Question | Solution |
282 | 1921 A | Square | Question | Solution |
283 | 1921 B | Arranging Cats | Question | Solution |
284 | 1921 C | Sending Messages | Question | Solution |
285 | 1921 D | Very Different Array | Question | Solution |
286 | 1923 A | Moving Chips | Question | Solution |
287 | 1923 B | Monsters Attack! | Question | Solution |
288 | 1927 A | Make it White | Question | Solution |
289 | 1927 B | Following the String | Question | Solution |
290 | 1927 C | Choose the Different Ones | Question | Solution |
291 | 1927 D | Find the Different Ones! | Question | Solution |
292 | 1927 E | Klever Permutation | Question | Solution |
293 | 1928 A | Rectangle Cutting | Question | Solution |
294 | 1928 B | Equalize | Question | Solution |
295 | 1929 A | Sasha and the Beautiful Array | Question | Solution |
296 | 1929 B | Sasha and the Drawing | Question | Solution |
297 | 1930 A | Maximise The Score | Question | Solution |
298 | 1930 B | Permutation Printing | Question | Solution |
299 | 1931 A | Recovering a Small String | Question | Solution |
300 | 1931 B | Make Equal | Question | Solution |
301 | 1931 C | Make Equal Again | Question | Solution |
302 | 1933 A | Turtle Puzzle Rearrange and Negate | Question | Solution |
303 | 1933 B | Turtle Math Fast Three Task | Question | Solution |
304 | 1933 C | Turtle Fingers Count the Values of k | Question | Solution |
305 | 1945 A | Setting up Camp | Question | Solution |
306 | 1954 C | Long Multiplication | Question | Solution |
307 | 1955 A | Yogurt Sale | Question | Solution |
308 | 1955 B | Progressive Square | Question | Solution |
309 | 1955 C | Inhabitant of the Deep Sea | Question | Solution |
310 | 1955 D | Inaccurate Subsequence Search | Question | Solution |
311 | 1955 E | Long Inversions | Question | Solution |
312 | 1955 F | Unfair Game | Question | Solution |
313 | 1956 A | Nene's Game | Question | Solution |
314 | 1956 B | Nene and the Card Game | Question | Solution |
315 | 1956 C | Nene's Magical Matrix | Question | Solution |
316 | 1957 A | Stickogon | Question | Solution |
317 | 1957 B | A BIT of a Construction | Question | Solution |
318 | 1957 C | How Does the Rook Move | Question | Solution |
319 | 1968 A | Maximize | Question | Solution |
320 | 1968 B | Prefiquence | Question | Solution |
321 | 1968 C | Assembly via Remainders | Question | Solution |
322 | 1968 D | Permutation Game | Question | Solution |
323 | 1968 E | Cells Arrangement | Question | Solution |
324 | 1968 F | Equal XOR Segments | Question | Solution |
325 | 1968 G1 | Division + LCP (easy version) | Question | Solution |
326 | 1969 A | Two Friends | Question | Solution |
327 | 1969 B | Shifts and Sorting | Question | Solution |
328 | 1971 A | My First Sorting Problem | Question | Solution |
329 | 1971 B | Different String | Question | Solution |
330 | 1971 C | Clock and Strings | Question | Solution |
331 | 1971 D | Binary Cut | Question | Solution |
332 | 1971 E | Find the Car | Question | Solution |
333 | 1971 F | Circle Perimeter | Question | Solution |
334 | 1976 A | Verify Password | Question | Solution |
335 | 1976 B | Increase Decrease Copy | Question | Solution |
336 | 1977 A | Little Nikita | Question | Solution |
337 | 1978 A | Alice and Books | Question | Solution |
338 | 1978 B | New Bakery | Question | Solution |
339 | 1979 A | Guess the Maximum | Question | Solution |
340 | 1979 B | XOR Sequences | Question | Solution |
341 | 1979 C | Earning on Bets | Question | Solution |
342 | 1980 A | Problem Generator | Question | Solution |
343 | 1980 B | Choosing Cubes | Question | Solution |
344 | 1980 C | Sofia and the Lost Operations | Question | Solution |
345 | 1980 D | GCD-sequence | Question | Solution |
346 | 1981 A | Turtle and Piggy Are Playing a Game | Question | Solution |
347 | 1981 B | Turtle and an Infinite Sequence | Question | Solution |
348 | 1981 C | Turtle and an Incomplete Sequence | Question | Solution |
349 | 1982 A | Soccer | Question | Solution |
350 | 1982 B | Collatz Conjecture | Question | Solution |
351 | 1982 C | Boring Day | Question | Solution |
352 | 1982 D | Beauty of the mountains | Question | Solution |
353 | 1985 A | Creating Words | Question | Solution |
354 | 1985 B | Maximum Multiple Sum | Question | Solution |
355 | 1985 C | Good Prefixes | Question | Solution |
356 | 1985 D | Manhattan Circle | Question | Solution |
357 | 1985 E | Secret Box | Question | Solution |
358 | 1985 F | Final Boss | Question | Solution |
359 | 1985 G | D-Function | Question | Solution |
360 | 1986 A | X Axis | Question | Solution |
361 | 1986 B | Matrix Stabilization | Question | Solution |
362 | 1986 C | Update Queries | Question | Solution |
363 | 1986 D | Mathematical Problem | Question | Solution |
364 | 1986 E | Beautiful Array | Question | Solution |
365 | 1988 A | Split the Multiset | Question | Solution |
366 | 1988 B | Make Majority | Question | Solution |
367 | 1989 A | Catch the Coin | Question | Solution |
368 | 1989 B | Substring and Subsequence | Question | Solution |
369 | 1989 C | Two Movies | Question | Solution |
370 | 1991 A | Maximize the Last Element | Question | Solution |
371 | 1991 B | AND Reconstruction | Question | Solution |
372 | 1991 C | Absolute Zero | Question | Solution |
373 | 1992 A | Only Pluses | Question | Solution |
374 | 1992 B | Angry Monk | Question | Solution |
375 | 1992 C | Gorilla and Permutation | Question | Solution |
376 | 1993 A | Question Marks | Question | Solution |
377 | 1993 B | Parity and Sum | Question | Solution |
378 | 1996 A | Legs | Question | Solution |
379 | 1996 B | Scale | Question | Solution |
380 | 1996 C | Sort | Question | Solution |
381 | 1996 D | Fun | Question | Solution |
382 | 1997 A | Strong Password | Question | Solution |
383 | 1997 B | Make Three Regions | Question | Solution |
384 | 1997 C | Even Positions | Question | Solution |
385 | 1997 D | Maximize the Root | Question | Solution |
386 | 1999 A | A+B Again | Question | Solution |
387 | 1999 B | Card Game | Question | Solution |
388 | 1999 C | Showering | Question | Solution |
389 | 1999 D | Slavic's Exam | Question | Solution |
390 | 2000 A | Primary Task | Question | Solution |
391 | 2000 B | Seating in a Bus | Question | Solution |
392 | 2000 C | Numeric String Template | Question | Solution |
393 | 2007 A | Dora's Set | Question | Solution |
394 | 2007 B | Index and Maximum Value | Question | Solution |
395 | 2009 A | Minimize! | Question | Solution |
396 | 2009 B | osu!mania | Question | Solution |
397 | 2009 C | The Legend of Freya the Frog | Question | Solution |
398 | 2009 D | Satyam and Counting | Question | Solution |
399 | 2014 A | Robin Helps | Question | Solution |
400 | 2014 B | Robin Hood and the Major Oak | Question | Solution |
401 | 2020 A | Find Minimum Operations | Question | Solution |
402 | 2020 B | Brightness Begins | Question | Solution |
403 | 2020 C | Bitwise Balancing | Question | Solution |
I am Shazid Mashrafi.
I am currently studying Computer Science and Engineering & trying to work my way up in the programming world.
Visit my Website and Codeforces account.