Editorial for COCI '07 Contest 2 #3 Prva


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

We need to find all words in the crossword and choose the lexicographically smallest one. A vertical word starts in a square if that square is on the first row or if the square above it is blocked, and a horizontal word starts if a square is in the first column or if the square to its left is blocked.

To check if a string A is lexicographically less than string B in the programming language C we can use the expression strcmp(A, B) < 0, and in Pascal and C++ (assuming A and B are variables of type string) simply A < B.


Comments

There are no comments at the moment.