http://en.lichess.org/training/9899after g4 my browser analysis shows that re1+ is a mate in 4, but somehow the right answer to this puzzle is qf6.
Go figure.
[FEN "7k/5p1p/4r3/1Pp2qpQ/p1P3P1/P6P/5P2/6K1 b - - 0 37"]
37... Re1+ 38. Kg2 Qe4+ 39. f3 Qc2+ 40. Kg3 Rg1#
Yes - bogus puzzle. Re1+ is actually a mate in 3. Qf3 is also a mate in 3, which the puzzle also rejects. The only move accepted by the puzzle, Qf6, is a mate in 6.
Also, the opponent's move g4 is a blunder, turning a -6 evaluation into a mate in 4.
For completeness, these are the puzzle moves prior to the critical move we've been talking about:
35... Qe5+ 36. Kg1 Qxf5 37. g4