Good Triples | Codeforces 1907E Solution | Codeforces Round 913 (Div. 3) | English
ฝัง
- เผยแพร่เมื่อ 19 ก.ย. 2024
- In this video, I walk through the solution to problem D from Codeforces Round 913 (Div. 3)
Contest link: codeforces.com...
Problem name: "good triples"
My Submission:
codeforces.com...
I explain the thought process and logic behind the solution and show how to implement it in code. Don't forget to like and subscribe for more coding content!
Something else: / sreejithcoast
Please solve the Getting points problem of 3rd dec contest
Sorry, unable to upload.
Nice explanation.
Thanks for such great explanation!
Great Tutorial
Nice, 🤗
lets say the value of n is 54 and for the ab and c i am just taking c = 54 , how is this case satisfying your logic also why we taking one digit at a time . please help
One digit at a time, because we don't need to carry over. I didn't get the question where u r mentioning 54.
@@codingdynamo three numbers i call a, b and c and i assign 0, 0, 54 respectively , now i didnt get the part of carry here as i am takin c as whole 54 the number itself .
how is that working
@@pokerfaced8139
We need to write like
a = 0 0 0 - digsum - 0
b = 0 0 0 - digsum - 0
c = 0 5 4 - digsum - 9
-------- -----
0 5 4 - digsum - 9
This is a valid sequence.
Here there is no carry.So horizontally (after digsum) and vertically(before digsum, normal addition) you get the same number. When something like carry comes, we don't know where to keep that extra 1, horizantally there is no room for that 1 (we just add the digits, but we are forced to place that extra 1 somewhere, which is not allowed in any digsum). It comes only in vertical. So we are ignoring carry. Your example doesn't have any carry here. You can rewatch the video and try again from part 3:50 - 4:33. To understand where carry over has an issue.
Just think like whenever a number has carry we ignore them because of the reason mentioned.
@@codingdynamo thank you so much dude for a clear and precise explanation