Skip to content

ShazidMashrafi/Codeforces

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Codeforces Solutions

This page contains my solutions of Codeforces problems. They are in C++ language.

Index

Sorted by Problem ID

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

About Me 👀

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.

Releases

No releases published

Packages

No packages published

Languages