I am a beginner, just starting to learn programming for USACO. I’m trying to solve this problem: USACO
and I found this solution:
Solution - Livestock Lineup (USACO Bronze 2019 December) · USACO Guide
but need help understanding a part of the solution given for Livestock Lineup problem. They are using a pushback method for an array
adj[c1].push_back(c2);
adj[c2].push_back(c1);
I can’t find any information on what adj[c1] means. Based on the information I found, the pushback method is used as adj.push_back(). Can someone please explain what the [c1] is for?
Also, when I copy the code and run it in the https://ide.usaco.guide/ I get an error for these lines
freopen(“lineup.in”, “r”, stdin);
freopen(“lineup.out”, “w”, stdout);
Why does it give me an error for these lines? Any help would be greatly appreciated.
Thank you!