### PrasannaBalaji's blog

By PrasannaBalaji, history, 2 months ago, ,

I am unable to understand the problem please someone explain me in simple terms

• 0

 » 2 months ago, # |   0 Auto comment: topic has been updated by PrasannaBalaji (previous revision, new revision, compare).
 » 2 months ago, # |   0 Something like this maybe: int main (void) { int Q; cin >> Q; while (Q--) { int N; cin >> N; if (N == 1 || N == 2) cout << "2\n"; else if (N & 1) cout << "1\n"; else cout << "0\n"; } return 0; } Please don't post all bold or caps. It hurts the eye...
•  » » 2 months ago, # ^ |   0 I just started using codeforces sry that i hurt your eyes:)
•  » » 2 months ago, # ^ |   0 I can understand the code but can you explain me the question for once
 » 2 months ago, # |   0 Auto comment: topic has been updated by PrasannaBalaji (previous revision, new revision, compare).
 » 2 months ago, # |   0 As for the question, all we need to do is with a given number of sticks, form an addition equation of 2 numbers and output the additional sticks needed. The minimal equation that we can form is |+|=|| and we would need 4 matches. Looking at this mathematically, we would always need even number of sticks as RHS == LHS always. The LHS part needs (answer)/2 sticks and RHS would need (answer)/2. The solution approach goes like, if we have even number of matches => we don't need additional sticks (hence 0) if odd => we need 1 match to make it even (hence 1).Hope you got what you needed :)
•  » » 2 months ago, # ^ |   0 Yes I got It