×

# Confusion in YVNUM solution Dec18 cookoff

 0 Here is the link to the Problem and Solution of December cook-off YVNUM. There is one thing in this solution which i cant get my head around - when the number becomes too big we take the modulo of the number wrt to 1000000007 instead of the original number and then do the concatenation operation with it rather than the original number and then expect the answer to be same, will it work?? Ex. string 921, modulo number = 103 921%103 = 97 but we find that (921219192)%103 != (977997)%103 Please tell me where am i wrong. asked 24 Dec '18, 18:51 3★vaibnak7 3●1 accept rate: 0%

 0 We first try to represent the number as sum of several numbers. Now, as the numbers become large, we take the modulo of the component numbers instead of the digits. So, to find modulo of (921219192), we break it as a = 921 * 10^6 b = 219 * 10^3 c = 192 * 10^0 So,921219192 = a + b + c So, now the answer is (a%103+ b%103 + c%103)%103. And I don't think that just taking modulo of each cyclic shift and then concatenating it would work. answered 24 Dec '18, 19:01 106●3 accept rate: 13%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×31
×13

question asked: 24 Dec '18, 18:51

question was seen: 98 times

last updated: 24 Dec '18, 19:09