We will hold AtCoder Beginner Contest 448.
- Contest URL: https://atcoder.jp/contests/abc448
- Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20260307T2100&p1=248
- Duration: 100 minutes
- Writer: Nyaan, physics0523, toam, ynymxiaolongbao, kyopro_friends
- Tester: sheyasutaka, math957963
- Rated range: ~ 1999
- The point values: 100-200-300-400-450-525-675
We are looking forward to your participation!








哇,G有675分诶~
The meaning of this sentence is:'Wow,the G is a 675-pointed problem!'.
Oh yeah,I don't think it's a good idea to post in Chinese.Maybe you should use English next time?
hyw
深刻悼念寒假同志
Wow! Chinese is very unusual on Codeforces.
The meaning of that sentence is: 'Deeply mourn Comrade Winter Vacation'(Are you chinese?)
No, I am part Taiwan, part American, and have some knowledge of Chinese characters.
Thank you for your translation, by the way.
The Hardest ABC.:( How E&F
I can't solve E(
For F,you can use the Mo's algorithm with (奇偶化排序 in Chinese,but I don't know how to say it in English).And change your block len to about 80000 or 130000.
For F: https://mirror.codeforces.com/blog/entry/61203
For E, do the following steps:
Find $$$mod = N \% M$$$.
Set $$$N = N - mod$$$.
Now the floor disappears from the problem. It asks you to find $$$N/M \% 10007$$$. This can now be done easily since you can use the regular modular inverse on $$$M$$$.
Finding N % x
Note that $$$N$$$ can be expressed as:
$$$N = \sum_{i=1}^{K}{(c_i c_i c_i...l_i times) * 10^{\sum_{j=i+1}^{K}{l_i}}}$$$
$$$N = \sum_{i=1}^{K}{(111...l_i times) * c_i * 10^{\sum_{j=i+1}^{K}{l_i}}}$$$
$$$N = \sum_{i=1}^{K}{(\sum_{j=0}^{l_i-1}{10^j}) * c_i * 10^{\sum_{j=i+1}^{K}{l_i}}}$$$
You need to be able to calculate $$$\sum_{i=0}^{N}{10^i}$$$ fast. That can be done using halving like binary exponentation.
And $$$\sum_{j=i+1}^{K}{l_i}$$$ is just the suffix sum, which can be precalculated.
Decrementing N
I think doing $$$N - 1$$$ is a lot simpler to do since the RLE is given. It changes the last few digits only.
So after finding $$$N \% M$$$, you can just decrement $$$N$$$ by $$$1$$$ that many times.
Submission: 73938944
I just discuss about whether or not to use #define int long long on cf-blog like the day before, I don't do it and that wreck me from time to time, and this is the time that the curse cast uppon me, I don't see that my bigmod function overflow at exponent arguent(int) and spending the whole contest just to debug E 😭 I'm going full #define int long long from now on... 🥀 🥀
F is same as 576C
为什么F题题解中为什么没有Hilbert曲线的做法?
I think problem E and F are very good ones for practice.
For prolem E, one needs understand how to calculate a/b mod p, where a/b is some integer. The derivation looks like the following:
let a/b = qp+r, and then we are going to compute r = (a/b) mod p. As a = qbp+rb, then a mod bp = (qbp+rb) mod bp = (qbp) mod bp + (rb) mod bp = (rb) mod bp, as r < p, so (rb) mod bp = rb. Thus we have a mod bp = rb, and r = (a mod bp) / b. So, we get a/b mod p = (a mod bp) / b.
Problem F needs a little bit construction. Whenever we see such a problem, we should never forget the famous sqrt-decomposition idea. I think this is why we are told to solve as many problems as possible, because if you have enough experiences, it will not take a long time to come up with this idea. On the other hand, the complexity analysis part is also very educational. Sometimes, we should consider all the operations as a whole or based on blocks, while sometimes we should consider them one by one.