Codeforces will be possibly unavailable in the period between Sep. 19, 19:00 (UTC) and Sep. 19, 21:00 (UTC) because of maintenance. ×

Garvit_2013's blog

By Garvit_2013, history, 7 weeks ago, In English

Code link :https://codeforces.com/contest/1549/submission/124673267

Please help me I am trying to find it since last night and I am not able till now .

Thanks in advance.

 
 
 
 
  • Vote: I like it
  • +1
  • Vote: I do not like it

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

ur code is kinda messy for me idk why

»
7 weeks ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

Use vector<set<int>> adj(n+1)

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

When you do adj[i].erase(*itr); the iterator gets erased. So try changing the order in which you perform deletion.

adj[*itr].erase(i);
adj[i].erase(*itr);