Блог пользователя tkien1707

Автор tkien1707, история, 7 недель назад, По-английски

Devide n vertical into 2 group A and B.

There are q query of two type: 1 u v, tell you that u and v belong to different group; 2 u v, print "YES" if u and v belong to one group, "NO" if u and v not belong to one group, "NOT GIVEN" if there is not enough information about u and v, based on the information has given in query type 1;

For example:

Input: 3 5

2 1 2

1 1 2

2 1 2

1 2 3

2 1 3

Output:

NOT GIVEN

NO

YES

I have stucked in this problem for a week, please help me ToT.

Полный текст и комментарии »

Теги dsu
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится