Friendship Database

Limits: 1s, 512 MB

You have created a new social media for testing the irrationality of human behavior. In order to conduct some experiments, you have invited N person to join your site. These N people are completely unknown to each other and you want to figure out how some unknown people interacts with one another. You have given each individual an unique identification number from 1 to **N&&. Whenever two person communicates within your social media, you want to know whether this interaction is a completely new one, or it has happened before.


This is a companion discussion topic for the original entry at https://toph.co/p/friendship-database