Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

Philosophi's blog

By Philosophi, history, 8 months ago, In English

https://codeforces.me/contest/1726/submission/365331041 Can anyone tell me where did i do wrong in this solution ? thanks

Update: My answer in the first test can be drawn in a pic like this

If we remove blue we get 2 connected components, if we remove red we get 1 connected component. So in total we get 3, which is the same with the answer. Was my understanding wrong somewhere?

  • Vote: I like it
  • -3
  • Vote: I do not like it

»
8 months ago, hide # |
 
Vote: I like it -11 Vote: I do not like it

You should run the sample test before submitting it...

  • »
    »
    8 months ago, hide # ^ |
     
    Vote: I like it +8 Vote: I do not like it

    Yes, but i dont understand why my answer is wrong =)). If my understanding of the statement is right, my answer should be correct, but i got WA. If you are kind enough could you please tell me why my answer in test 1 is wrong ?

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Philosophi (previous revision, new revision, compare).

»
8 months ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

afaik you understood the problem right, but on the submission page your code responds to sample 1 with 1110010 and the jury answer 1110001

your answer would mark edges the following edges red: (1, 2) (2, 3) (3, 4) (1, 3) which doesn't match your drawing. The jury's answer matches your drawing with red and blue swapped though.