Editorial for Bedao Mini Contest 02 - MARRIAGE

Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Code mẫu


using namespace std;

int main() {
  ios_base::sync_with_stdio(false); cin.tie(NULL);

  freopen("marriage.inp", "r", stdin);
  freopen("marriage.out", "w", stdout);

  int A, B, M; cin >> A >> B >> M;

  vector<bool> deg(A + B);
  while(M--) {
    int x, y; cin >> x >> y;
    deg[--x] = 1; deg[--y + A] = 1;

  for(int i = 0; i < deg.size(); ++i) cout << (deg[i] ? "Yes" : "No") << "\n";

  return 0;


Please read the guidelines before commenting.

There are no comments at the moment.