My Competitive Programming code

ICPC

I am one of the problem setters of Vietnam ICPC since 2016. Added my reference solutions for some problems here.

Also added some solutions from upsolving other regionals / WFs.

VNOJ

Code for VNOI Online Judge - official OJ in Vietnam.

I livestream solving these problems (in Vietnamese) at my FB page

Codeforces

Codeforces submissions are auto-generated with Harwest.

Only Accepted submissions are included.

All submissions from gyms and virtual contests are here.

# Title Solution Tags Submitted
3568 D - Shurikens C++17 greedy *1700 Oct/30/2020
3567 C - Perform Easily C++17 two pointers *1900 Oct/30/2020
3566 B - A New Technique C++17 *1100 Oct/30/2020
3565 A - Finding Sasuke C++17 math *800 Oct/30/2020
3564 E - Make It Increasing C++17 dp *2200 Oct/30/2020
3563 D - Minimal Height Tree C++17 trees *1600 Oct/30/2020
3562 C - Chef Monocarp C++17 sortings *1800 Oct/30/2020
3561 B - Reverse Binary Strings C++17 greedy *1200 Oct/30/2020
3560 A - Marketing Scheme C++17 math *800 Oct/30/2020
3559 A - Ahahahahahahahaha PyPy 3 math *1100 Sep/10/2020
3558 A - Multiples of Length C++17 number theory *1600 Sep/03/2020
3557 D - Again? Python 3 Apr/02/2020
3556 B - Limericks Python 3 math number theory Apr/02/2020
3555 A - Is it rated? Python 2 Apr/02/2020
3554 A - Malek Dance Club C++17 math *1600 Feb/29/2020
3553 E - Binary Numbers AND Sum C++17 math *1700 Feb/29/2020
3552 D - Polycarp's phone book C++17 sortings *1600 Feb/29/2020
3551 C - Permutation Cycle C++17 constructive algorithms *1600 Feb/29/2020
3550 A - Long Beautiful Integer C++17 strings *1700 Feb/29/2020
3549 B - s-palindrome Python 3 strings *1600 Feb/29/2020
3548 I - Palindrome Pairs C++17 strings *1600 Feb/29/2020
3547 A - Multicolored Marbles C++17 math *1600 Feb/29/2020
3546 D - Minimum Diameter Tree C++17 trees *1700 Feb/28/2020
3545 B - Three-level Laser C++17 two pointers *1600 Feb/28/2020
3544 F - Mentors C++17 data structures *1500 Feb/28/2020
3543 C - Find Maximum C++17 number theory *1600 Feb/28/2020
3542 C - Save the Nature C++17 greedy *1600 Feb/28/2020
3541 E - Field of Wonders C++17 strings *1500 Feb/28/2020
3540 C - Nastya and a Wardrobe C++17 math *1600 Feb/28/2020
3539 C - Destroying Array C++17 dsu *1600 Feb/28/2020
3538 A - Win or Freeze C++17 number theory *1400 Feb/28/2020
3537 D - Union Found Rust Feb/10/2020
3536 C - Partial Reduplication C++17 Feb/10/2020
3535 B - Bogart Gets Disqualified C++17 Feb/10/2020
3534 A - Vincent Adultman C++17 Feb/10/2020
3533 C - Product of Three Numbers Rust number theory *1300 Feb/08/2020
3532 F - Mega Nim C++17 Feb/07/2020
3531 C - Floyd Rust Feb/07/2020
3530 A - Clothes C++17 Feb/07/2020
3529 D - Dijkstra C++17 Feb/05/2020
3528 B - DAG C++17 constructive algorithms Feb/04/2020
3527 C - Segment tree or Fenwick? C++17 data structures Feb/04/2020
3526 A - Nash equilibrium C++17 Feb/04/2020
3525 A - Display The Number Rust greedy *900 Jan/31/2020
3524 D - Dr. Evil Underscores Rust trees *1900 Jan/13/2020
3523 C - Fadi and LCM Rust number theory *1400 Jan/13/2020
3522 B - Just Eat It! Rust greedy *1300 Jan/13/2020
3521 A - Mezo Playing Zoma Rust math *800 Jan/12/2020
3520 A - Water Buying Rust math *800 Jan/12/2020
3519 A - Wrong Subtraction Rust *800 Jan/12/2020
3518 B - Welfare State C++17 sortings *1600 Aug/16/2019
3517 D - Vus the Cossack and Numbers C++17 math *1500 Jun/28/2019
3516 C - Vus the Cossack and Strings C++17 math *1800 Jun/28/2019
3515 A - Vus the Cossack and a Contest C++17 *800 Jun/28/2019
3514 E - Fourier Doodles C++17 Apr/02/2019
3513 F - Neat Words C++17 Apr/02/2019
3512 C - Mystery Circuit C++17 bitmasks brute force Apr/02/2019
3511 B - Kanban Numbers C++17 brute force Apr/01/2019
3510 D - Pigeon d'Or C++17 Apr/01/2019
3509 A - Thanos Sort C++17 Apr/01/2019
3508 A - A C++17 Nov/06/2018
3507 E - The Untended Antiquity Java 8 hashing *2400 Nov/05/2018
3506 A - The Artful Expedient PyPy 2 brute force *1100 Nov/05/2018
3505 C - Flawed Flow C++17 greedy *2100 Oct/05/2018
3504 D - Sequence analysis C++17 May/12/2018
3503 E - Cheese Board C++11 *2000 Apr/02/2018
3502 D - I'm Feeling Lucky! C++11 probabilities *1800 Apr/02/2018
3501 C - Ravioli Sort C++11 *1600 Apr/02/2018
3500 B - A Map of the Cat C++11 interactive *1900 Apr/02/2018
3499 A - Quirky Quantifiers C++11 math *800 Apr/02/2018
3498 A - The Meaningless Game C++11 number theory *1700 Dec/01/2017
3497 L - Send the Fool Further! (hard) C++ trees *2400 May/28/2017
3496 C - Heidi and Library (hard) C++11 flows *2600 May/28/2017
3495 K - Send the Fool Further! (medium) C++14 trees *2100 May/28/2017
3494 N - April Fools' Problem (medium) C++11 graphs *2400 May/28/2017
3493 F - Marmots (hard) C++ probabilities *2800 May/28/2017
3492 E - Marmots (medium) C++ math *2200 May/28/2017
3491 D - Marmots (easy) C++ math *2100 May/28/2017
3490 H - Fake News (medium) C++ strings *2200 May/28/2017
3489 J - Send the Fool Further! (easy) C++14 trees *1400 May/28/2017
3488 M - April Fools' Problem (easy) C++11 sortings *1200 May/28/2017
3487 I - Fake News (hard) C++14 string suffix structures *2300 May/28/2017
3486 A - Heidi and Library (easy) C++11 greedy *1800 May/28/2017
3485 B - Heidi and Library (medium) C++11 greedy *1800 May/28/2017
3484 G - Fake News (easy) C++ strings *800 May/28/2017
3483 B - Dynamic Problem Scoring C++11 greedy *2000 May/08/2017
3482 A - Success Rate C++11 math *1700 May/08/2017
3481 D - Lie or Truth Go sortings *1500 Apr/07/2017
3480 L - Bars Java 8 greedy *2000 Apr/06/2017
3479 J - Stepan's Series Python 2 dp *2000 Apr/06/2017
3478 E - Big Number and Remainder C number theory *2300 Apr/06/2017
3477 K - Stepan and Vowels FPC strings *1600 Apr/06/2017
3476 C - Maximum Number JavaScript greedy *1200 Apr/06/2017
3475 B - Significant Cups C++14 two pointers *2100 Apr/05/2017
3474 A - Amusement Park Ruby ternary search *2100 Apr/05/2017
3473 B - Kids' Riddle Java 8 *special problem *2000 Apr/01/2017
3472 C - INTERCALC C++14 *special problem *1800 Apr/01/2017
3471 D - Touchy-Feely Palindromes C++14 *special problem *1900 Apr/01/2017
3470 A - Numbers Joke C++14 *special problem *1700 Apr/01/2017
3469 F - Crunching Numbers Just for You Python 2 *special problem *1900 Apr/01/2017
3468 E - Twisted Circuit C++11 brute force *2000 Apr/01/2017
3467 G - BF Calculator Python 2 *special problem *2000 Mar/31/2017
3466 E - New task C++14 data structures *2900 Mar/30/2017
3465 B - Weird journey C++14 graphs *2100 Mar/30/2017
3464 C - The Great Mixing C++14 shortest paths *2300 Mar/30/2017
3463 A - Functions again C++14 two pointers *1600 Mar/30/2017
3462 B - Not Afraid C++14 math *1300 Mar/24/2017
3461 A - The Monster C++14 number theory *1200 Mar/24/2017
3460 C - Till I Collapse C++14 divide and conquer *2400 Mar/24/2017
3459 B - Legacy C++14 shortest paths *2300 Mar/24/2017
3458 A - Berzerk C++14 games *2000 Mar/23/2017
3457 C - Bear and Company C++14 dp *2500 Mar/19/2017
3456 B - Bear and Tree Jumps C++14 trees *2100 Mar/19/2017
3455 A - Bear and Different Names C++14 greedy *1500 Mar/18/2017
3454 C - Pie Packages C++14 Mar/11/2017
3453 A - Salient Strings C++14 Mar/11/2017
3452 B - Innokenty and a Football League C++14 strings *1900 Mar/06/2017
3451 D - Axel and Marston in Bitland C++14 matrices *2400 Mar/05/2017
3450 E - Andryusha and Nervous Barriers C++14 data structures *2700 Mar/05/2017
3449 C - Underground Lab C++14 trees *2100 Mar/05/2017
3448 A - Andryusha and Colored Balloons C++14 trees *1600 Mar/05/2017
3447 D - Parquet Re-laying C++14 constructive algorithms *2700 Feb/26/2017
3446 B - Bitwise Formula C++14 expression parsing *1800 Feb/26/2017
3445 A - String Game C++14 strings *1700 Feb/26/2017
3444 F - Sherlock's bet to Moriarty C++14 trees *2800 Feb/24/2017
3443 G - Sherlock and the Encrypted Data C++14 dp *2900 Feb/24/2017
3442 D - The Door Problem C++14 graphs *2000 Feb/24/2017
3441 E - The Holmes Children C++14 number theory *2100 Feb/24/2017
3440 C - Molly's Chemicals C++14 math *1800 Feb/23/2017
3439 B - Sherlock and his girlfriend C++14 number theory *1200 Feb/23/2017
3438 A - A Serial Killer C++14 strings *900 Feb/23/2017
3437 C - Jon Snow and his Favourite Number C++14 sortings *1800 Feb/21/2017
3436 B - Code For 1 C++14 divide and conquer *1600 Feb/21/2017
3435 F - Barrels and boxes C++14 probabilities *2300 Feb/21/2017
3434 E - Game of Stones C++14 games *2100 Feb/21/2017
3433 A - Oath of the Night's Watch C++14 sortings *900 Feb/21/2017
3432 I - Sergey and exam C++14 Jan/28/2017
3431 H - Sergey and sequence C++14 Jan/28/2017
3430 F - Sergey’s columns C++14 Jan/28/2017
3429 A - Sergey and reduction (Junior) C++14 Jan/28/2017
3428 B - Big Top C++14 Jan/28/2017
3427 C - Fighting all the Zombies C++14 Jan/28/2017
3426 A - Subtle Sabotage C++14 Jan/28/2017
3425 A - Hacker Cups and Balls C++14 Jan/28/2017
3424 J - Zero Game C++14 Jan/28/2017
3423 F - Lonely Dreamoon 2 C++14 Jan/27/2017
3422 G - Dreamoon and NightMarket C++14 Jan/27/2017
3421 C - Crazy Dreamoon C++14 Jan/27/2017
3420 E - Radio stations C++14 data structures *2200 Jan/27/2017
3419 D - Bacterial Melee C++14 string suffix structures *2400 Jan/23/2017
3418 C - Nikita and stack C++14 data structures *2200 Jan/23/2017
3417 B - Travel Card C++14 dp *1600 Jan/23/2017
3416 A - Pavel and barbecue C++14 dfs and similar *1700 Jan/23/2017
3415 D - Beach Umbrellas C++14 Jan/21/2017
3414 A - Pie Progress C++14 Jan/21/2017
3413 B - Fighting the Zombies C++14 Jan/21/2017
3412 C - Manic Moving C++14 Jan/21/2017
3411 C - Fighting the Zombie C++14 Jan/21/2017
3410 A - Progress Pie C++14 Jan/21/2017
3409 B - Lazy Loading C++14 Jan/21/2017
3408 D - PolandBall and Polygon C++14 data structures *2000 Jan/16/2017
3407 E - PolandBall and White-Red graph C++14 shortest paths *2400 Jan/16/2017
3406 C - PolandBall and Forest C++14 trees *1300 Jan/16/2017
3405 B - PolandBall and Game C++14 strings *1100 Jan/16/2017
3404 A - PolandBall and Hypothesis C++14 number theory *800 Jan/16/2017
3403 C - Felicity is Coming! C++14 strings *1900 Jan/13/2017
3402 E - Bash Plays with Functions C++14 number theory *2500 Jan/13/2017
3401 D - Felicity's Big Secret Revealed C++14 dp *2200 Jan/13/2017
3400 B - Bash's Big Day C++14 number theory *1400 Jan/12/2017
3399 A - Gotta Catch Em' All! C++14 *1000 Jan/12/2017
3398 D - Leaving Auction C++14 data structures *2000 Dec/21/2016
3397 E - Inversions After Shuffle C++14 probabilities *2400 Dec/20/2016
3396 C - Hongcow Buys a Deck of Cards C++14 dp *2400 Dec/18/2016
3395 B - Hongcow's Game C++14 interactive *1900 Dec/18/2016
3394 A - Hongcow Builds A Nation C++14 graphs *1500 Dec/18/2016
3393 D - Permutations C++14 matrices *2800 Nov/28/2016
3392 C - Ostap and Tree C++14 trees *2500 Nov/28/2016
3391 B - Taxes C++14 number theory *1600 Nov/28/2016
3390 A - Tennis Championship C++14 math *1600 Nov/28/2016
3389 C - Subordinates C++14 greedy *1900 Nov/20/2016
3388 B - Sea Battle C++14 math *1700 Nov/20/2016
3387 A - Road to Cinema C++14 binary search *1700 Nov/20/2016
3386 F - Drivers Dissatisfaction C++14 trees *2200 Nov/01/2016
3385 D - Kostya the Sculptor Java 8 hashing *1600 Oct/31/2016
3384 C - Epidemic in Monstropolis Java 8 two pointers *1800 Oct/31/2016
3383 B - Parade Java 8 math *1100 Oct/31/2016
3382 A - Grasshopper And the String Java 8 *1000 Oct/31/2016
3381 D - Running Over The Bridges C++11 math *2200 Oct/23/2016
3380 C - Bulmart C++11 dfs and similar *2100 Oct/23/2016
3379 E - Award Ceremony C++ greedy *2200 Oct/23/2016
3378 I - Olympiad in Programming and Sports C++11 greedy *2000 Oct/23/2016
3377 A - Toda 2 C++ greedy *1800 Oct/23/2016
3376 H - Delete Them C++11 constructive algorithms *1300 Oct/23/2016
3375 B - Minimum and Maximum C++11 interactive *1800 Oct/23/2016
3374 J - Bottles C++ dp *1900 Oct/23/2016
3373 G - Car Repair Shop C++11 *1600 Oct/23/2016
3372 D - Contest Balloons C++11 greedy *1800 Oct/23/2016
3371 C - Hidden Word C++11 strings *1600 Oct/22/2016
3370 B - Food on the Plane Python 2 math *1200 Oct/22/2016
3369 A - Jumping Ball C++14 *1000 Oct/22/2016
3368 E - Dance Party C++ Oct/13/2016
3367 B - Pouring Water C++ Oct/13/2016
3366 A - The Baguette Master C++11 Oct/12/2016
3365 D - Checkmate with Bishop and Knight C++11 Oct/12/2016
3364 I - Odd Factor (64 MB ML!) C++ Oct/12/2016
3363 H - Kids' Play C++11 Oct/12/2016
3362 K - Average Speed C++11 Oct/12/2016
3361 L - Subway C++ Oct/12/2016
3360 C - Old Chess Sets C++11 Oct/12/2016
3359 M - A multiplication game C++ Oct/12/2016
3358 C - Ray Tracing C++11 sortings *1800 Oct/08/2016
3357 D - Dense Subsequence C++11 strings *1900 Oct/08/2016
3356 B - Batch Sort C++11 math *1500 Oct/08/2016
3355 A - Checking the Calendar C++11 *1000 Oct/08/2016
3354 C - Card Collecting C++ Oct/06/2016
3353 D - Double Elimination C++11 Oct/05/2016
3352 H - Hunter's Apprentice C++11 Oct/05/2016
3351 L - Sympathetic Tables C++ Oct/05/2016
3350 K - Mixing Bowls C++11 Oct/05/2016
3349 G - Ground Defense C++11 Oct/05/2016
3348 F - Flight Plan C++ Oct/05/2016
3347 J - Jurisdiction Disenchantment C++ Oct/05/2016
3346 E - Election of Evil C++11 Oct/05/2016
3345 I - Ingenious Lottery Tickets C++11 Oct/05/2016
3344 A - Assembly Required C++ Oct/05/2016
3343 B - Bulbs C++11 Oct/05/2016
3342 A - Letters Cyclic Shift C++11 strings *1200 Aug/25/2016
3341 B - Recover the String C++11 math *1900 Aug/25/2016
3340 D - Recover the String C++11 math *1900 Aug/25/2016
3339 C - Sereja and Brackets C++11 schedules *2000 Aug/10/2016
3338 C - Break Up C++11 graphs *2600 Jul/23/2016
3337 B - Connecting Universities C++11 trees *1800 Jul/23/2016
3336 A - As Fast As Possible C++11 math *1900 Jul/23/2016
3335 B3 - Recover Polygon (hard) C++11 *2600 Jul/10/2016
3334 B2 - Recover Polygon (medium) C++11 geometry *2600 Jul/10/2016
3333 A3 - Collective Mindsets (hard) C++ *2400 Jul/10/2016
3332 E2 - Photographs (II) C++11 *2600 Jul/10/2016
3331 A2 - Collective Mindsets (medium) C++ *2300 Jul/10/2016
3330 C3 - Brain Network (hard) C++11 trees *2200 Jul/10/2016
3329 E1 - Photographs (I) C++11 *1800 Jul/10/2016
3328 C2 - Brain Network (medium) C++11 trees *1500 Jul/10/2016
3327 C1 - Brain Network (easy) C++11 *1300 Jul/10/2016
3326 D3 - The Wall (hard) C++11 *2100 Jul/10/2016
3325 B1 - Recover Polygon (easy) C++11 *1700 Jul/10/2016
3324 D2 - The Wall (medium) C++11 combinatorics *1800 Jul/10/2016
3323 F1 - Tree of Life (easy) C++11 *1300 Jul/10/2016
3322 D1 - The Wall (easy) C++11 *1200 Jul/10/2016
3321 A1 - Collective Mindsets (easy) C++ *1100 Jul/10/2016
3320 B - Kay and Snowflake C++11 trees *1900 Jun/24/2016
3319 A - Robbers' watch C++11 math *1700 Jun/24/2016
3318 C - Alyona and the Tree C++11 trees *1600 Jun/18/2016
3317 B - Alyona and Mex C++ sortings *1200 Jun/18/2016
3316 A - Alyona and Numbers C++11 number theory *1100 Jun/18/2016
3315 E - Alyona and Triangles C++11 two pointers *2600 Jun/18/2016
3314 D - Alyona and Strings C++11 strings *1900 Jun/18/2016
3313 I - Loader Kotlin *special problem *2500 Jun/17/2016
3312 G - The Fraction Kotlin *special problem *1900 Jun/17/2016
3311 H - Exchange of Books Kotlin *special problem *1900 Jun/17/2016
3310 F - Reformat the String Kotlin *special problem *1800 Jun/17/2016
3309 E - Hammer throwing Kotlin *special problem *1800 Jun/17/2016
3308 D - Chocolate Bar Kotlin math *1400 Jun/17/2016
3307 C - Symmetric Difference Kotlin *special problem *1600 Jun/17/2016
3306 B - The Teacher of Physical Education Kotlin *special problem *1600 Jun/17/2016
3305 A - The Check of the Point Kotlin geometry *1200 Jun/17/2016
3304 E - Runaway to a Shadow C++11 sortings *2500 Jun/15/2016
3303 B - Economy Game C++11 brute force *1300 Jun/15/2016
3302 A - A Good Contest C++11 *800 Jun/15/2016
3301 C - Heap Operations C++11 greedy *1600 Jun/15/2016
3300 D - Gifts by the List C++11 trees *2000 Jun/15/2016
3299 F - Lena and Queries C++11 geometry *2500 Jun/14/2016
3298 E - Another Sith Tournament C++11 probabilities *2200 Jun/14/2016
3297 D - Theseus and labyrinth C++11 shortest paths *2000 May/27/2016
3296 C - Vasya and String C++11 two pointers *1500 May/27/2016
3295 B - Different is Good C++11 strings *1000 May/12/2016
3294 A - Summer Camp C++11 *800 May/12/2016
3293 C - Ultimate Weirdness of an Array C++11 number theory *2800 May/12/2016
3292 B - Robin Hood C++11 greedy *2000 May/12/2016
... ... ... ... ...