Graph Theory37 sections · 1633 units
Open in Course

CSES 1668 Building Teams - Input Format

Competitive style

CSES uses standard competitive programming I/O format. No fancy JSON or API calls. First line: two integers nn and mm, the number of pupils and the number of friendships. Next mm lines: each contains two integers aa and bb meaning pupils aa and bb are friends.

You read from stdin and write to stdout. Build the adjacency list yourself from the edge pairs. Pupils are numbered 11 to nn, not 00 to n1n-1. Remember to size your arrays so.