Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
469 views
in Technique[技术] by (71.8m points)

c++ - I'm not getting what the problem wants to say by line that - dk and d1 should also be adjacent. How the kth dot and 1 dot can be adjacent?

Gary has a board of size NxM. Each cell in the board is a coloured dot. There exist only 26 colours denoted by uppercase Latin characters (i.e. A,B,...,Z). Now Gary is getting bored and wants to play a game. The key of this game is to find a cycle that contain dots of same colour. Formally, we call a sequence of dots d1,?d2,?...,?dk a cycle if and only if it meets the following condition:

  1. These k dots are different: if i?≠?j then di is different from dj.
  2. k is at least 4.
  3. All dots belong to the same colour.
  4. For all 1?≤?i?≤?k?-?1: di and di?+?1 are adjacent. Also, dk and d1 should also be adjacent. Cells x and y are called adjacent if they share an edge.

Since Gary is colour blind, he wants your help. Your task is to determine if there exists a cycle on the board

question from:https://stackoverflow.com/questions/65914744/im-not-getting-what-the-problem-wants-to-say-by-line-that-dk-and-d1-should-al

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...