Codeforces 1169B. Pairs Codeforces Round #562 (Div. 2)


Problem link

One of x,y is obviously one of a1,b1. For example, let's fix who is x from the first pair. Then you need to check that there exists some y such that all pairs that don't contain x, contain y. For this, you can remember in the array for each value how many pairs that don't contain x contain this value, and then you need to check that in the array there exists some value that is equal to the number of pairs left.

A solution in c++


Post a Comment

0 Comments