UVa 340

From Algorithmist
Jump to navigation Jump to search

340 - Master-Mind Hints[edit]

Summary[edit]

Compare first line of numbers (Secret) with the following arbitrary number of lines of numbers (Guesses).

Explanation[edit]

INPUT:
	N, S, (G...)
	
Foreach G:
	// Comparate with S:
	Foreach G_i:
		If G_i == S_i: 
			MARK both, strong++
	Foreach G_i:
		If G_i in S:
			MARK S_g, weak++, break
		MARK G_i
	
OUTPUT

Gotchas[edit]

  • Do not print '\t'. Output 4 spaces instead.