Competitive Programming

8 posts

Dec 13, 2020

ABC185 editorial

atCoder competitive-programming
Preview

This is unofficial editorial for atCoder abc185.

Read more →

Sep 27, 2020

Polygon.CodeForces Tutorial

competitive-programming
Preview

What is Polygon

According to Polygon itself, The mission of Polygon is to provide platform for creation of programming contest problems. Polygon supports the whole development cycle:

  • Problem statement writing.
  • Test data preparing (generators supported).
  • Model solutions (including correct and wittingly incorrect).
  • Judging.
  • Automatic validation.
Read more →

Sep 19, 2020

ABC179 editorial

atCoder competitive-programming
Preview

This is unofficial editorial for atCoder abc179.

Read more →

Sep 12, 2020

ABC178 editorial

atCoder competitive-programming
Preview

This is unofficial editorial for atCoder abc178.

Read more →

Aug 23, 2020

Stress Testing

competitive-programming
Preview

I decided to write this article after watching the last screencast made by Errichto. To be more precise when he started making stress testing to find counter-test you can check that here. Errichto has a full video called How to test your solution in Competitive Programming, on Linux? I highly recommend you to check it, basically this article is the same but I am extending it to stress test solutions with multiple answers using a written checker, so let’s jump in.

Read more →

Feb 26, 2020

Game Theory

competitive-programming
Preview

Combinatorial Games

The game is said to be Combinatorial if it satisfies the following conditions:

  1. The game is played between two players, we will call them Alice and Bob.
  2. The two players alternate playing, Alice plays first.
  3. We can define two sets \(F_1\) and \(F_2\) of possible moves for each player, these sets are usually finite, based on these two sets we can classify combinatorial games into:
    • Combinatorial impartial games this happens when \(F_1 = F_2\), this means both players have the same options of moving from each position.
    • Combinatorial partizan games this happens when \(F_1\ne F_2\), this includes games like chess or checkers in which one player moves the white pieces, and the other player moves the black pieces.
  4. There is an end position of the game, usually called the terminal position. In normal play rule the player making the last move wins the game, in misère play rules the player making the last move loses the game.
  5. The game always ends after some finite number of moves.
Read more →

Jan 2, 2020

Maximum Independent Set in Bipartite Graphs

competitive-programming
Preview

Introduction

The title contains a lot of terms that should be explained separately before we start, given an undirected graph \(G = (V, E)\) we define the following terms:

  • Independent Set (IS) : Subset of nodes \(U \subseteq V\) with the following propriety: For any two nodes \(u, v \in U\) nodes \(u, v\) are not adjacent ( There is no direct edge between nodes \(u\) and \(v\) ).
  • Maximal Independent Set (MIS) : An independent set is maximal if no node can be added to it without violating the independence condition.
  • Maximum Independent Set (MaxIS) : An independent set of maximum cardinality.
Read more →

Dec 8, 2019

Monotonic Queue

competitive-programming
Preview

Motivation Problem

Given \(n \times m\) matrix \((1 \le n, m \le 3*10^3)\) you have to calculate the sum of minimum numbers in all sub-matrices of size \(a\times b\) with top left corners in \((i, j)\) over all \(1 \le i \le n-a+1\) and \(1 \le j \le m-b+1\).

Read more →