正文
增加 2 行删除 2 行
167 行未改动全部展开168169170171172173174175176177178179180181182183184185186106 行未改动全部展开167 行未改动全部展开}cin >> p;if (p == 1) {cout << cnt << '\n';for (int i : ans)cout << i << ' ';} else {set<int> s;for (int i = 1; i <= n; i++) {cnt = 0;memset(f, 0, sizeof(f));for (int j = n; j; j--) {if (cnt - f[a[i][j]] >= n - 1)s.insert(a[i][j]);if (!f[a[i][j]])fill(a[i][j]);}}cout << s.size() << '\n';106 行未改动全部展开167 行未改动全部展开168169170171172173174175176177178179180181182183184185186106 行未改动全部展开167 行未改动全部展开}cin >> p;if (p == 1) {cout << cnt << '\n';for (int i : ans)cout << i << ' ';} else {set<int> s;for (int i = 1; i <= n; i++) {cnt = 0;memset(f, 0, sizeof(f));for (int j = n; j; j--) {if (cnt - f[a[i][j]] >= n - 1)s.insert(a[i][j]);if (!f[a[i][j]])fill(a[i][j]);}}cout << s.size() << '\n';106 行未改动全部展开