The default ACM style looks like this

However, I need the style as follows. The cls of the template can be found here.

The default ACM style looks like this

However, I need the style as follows. The cls of the template can be found here.

The ACM templates present the authors in columns. If you want to display the author information in a single row instead multiple columns, you can: (1) use other latex commands along the defined in the template or (2) use another template.
You can use the \author{...} command but including a single line of text or a table, instead of using multiple \alignauthor to create new columns.
\numberofauthors{1}
\author{
\alignauthor
XXX, YYY, ZZZ \\ % names
\affaddr{XXX, YYY, ZZZ } \\ % affiliations
\email{XXX}, \email{yyy}, \email{zzz} % emails
}
You can see an example of a table inside an \author{...} in another question in stackexchange. They use a tabular in the \author to create a single line for shared affiliations.
You can use another template. The sample you provided has an author block similar to the used in the IEEE templates.