We compute the cohomology with trivial coefficients of two graded infinite-dimensional Lie algebras of maximal class, give explicit formulas for their representative cocycles. Also we discuss the relations with combinatorics and representation theory.