prog.cpp:2:2: error: expected unqualified-id before ‘for’
for(int j = 0; j < n; j++) {
^~~
prog.cpp:2:17: error: ‘j’ does not name a type
for(int j = 0; j < n; j++) {
^
prog.cpp:2:24: error: ‘j’ does not name a type
for(int j = 0; j < n; j++) {
^
prog.cpp:19:1: error: ‘set’ does not name a type
set<int> pairs; // pairs up to i-1
^~~
prog.cpp:20:1: error: expected unqualified-id before ‘for’
for(int i = 0; i < n; i++) {
^~~
prog.cpp:20:16: error: ‘i’ does not name a type
for(int i = 0; i < n; i++) {
^
prog.cpp:20:23: error: ‘i’ does not name a type
for(int i = 0; i < n; i++) {
^