We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Mathematics
- Number Theory
- Akhil and GF
- Discussions
Akhil and GF
Akhil and GF
Sort by
recency
|
29 Discussions
|
Please Login in order to post a comment
I tried this : 1/ find a diviser to n (call it n1) then the original number 111...11 can be divided by n1, and the result is like n2=1000...1000...1 (number of zeros dpend on n1) then our original number 111...11 (n ones) = 11..1 (n1 ones)n2 Now 1000...1000....1 = 1000...1000...0 +1 1000...1000...0 can be divided by 1000... one can continue like this with some patterns to reduce the cost of % big numbers But it didn't run all test cases :/ time exceeded
If your C++ code fails last test ,try using __int128_t.
This is a pretty fun problem.
We can see that 111...N times mod m = (999.. N times mod 9m) / 9 by mod distributive law
999.. N times mod 9m can be calculated efficiently with binary exponentiation, it is 10^N - 1, and the 10^N can be calculated in log N time.
Now when do I get a gf.....
You know, I have long dreamed of finding myself an Asian girlfriend and I succeeded. A couple of months ago I was browsing the internet and found a dating site https://www.onenightfriend.com/asian-hookup.html which helped me solve my loneliness problem. I just registered and started chatting, but I was serious and now I have a gorgeous girl from China.