We will hold AtCoder Beginner Contest 475.
- Contest URL: https://atcoder.jp/contests/abc475
- Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20260912T2100&p1=248
- Duration: 100 minutes
- Writer: kyopro_friends, cn449
- Tester: Nyaan, MMNMM
- Rated range: ~ 1999
- The point values: 100-200-300-400-475-525-575
We are looking forward to your participation!









gl&hf
DMY student?
catch
I catch one little shark!
Hope I can solve 4 problems and get >=800 perf
UPD: I solved 3 problems, and got 1139 perf
gl bro
I hope I can solve 6 problems at least and get 2000+ perf,please
Me too. I rated this contest with 1680 rating because all my classmates have signed up.
I hope to answer 5 questions A, B, C, D, and E
hello,yyx!
NOW, MY RANKING IS 915TH!!!
I solved A, B, D in 40 mins
Me too
How did you optimize D?
I thought of creating the first possible number, then incrementing it and checking until maximum length, and for each check all the conditions must satisfy It gave a TLE
I precomputed isPrime using a sieve. Then I generated permutations of digits from 0 to 9, but only used the first distinct characters count. For each permutation, I only needed as many digits as the number of distinct characters, so I checked them. My submission https://atcoder.jp/contests/abc475/submissions/79210901
Linear sieve -> https://atcoder.jp/contests/abc475/submissions/79206018
I solved A,B,C,D!!!!I solved D for the first time!!!!
Good luck to everyone!
D is very easy, isn't it?
I have no word but
Rk 2475
1138 ↗ 1166 (+28) 我还是太废了,回分没有掉分快
I cannot laugh again because I just only solve ABCD


Nice contest but I couldn't solve G on time.
next time prompt faster
next time cry louder
Your main account got banned because cheating.
I'll post EFG here.
E
Notice $$$K \le 200$$$, and answer can be only
oorx, so a 01trie is expected.Then we found that $$$O(QK)$$$ is reasonable to pass, so just brute forcce and modify the trie each time, and maintain the subtree-size fo querying rank.
There's a trap that one can pass if he got atleast an
o.F
Classical $$$HW \le 2 \times 10^5$$$, so let's come up with an $$$O(H^2 W)$$$ algo.(assume $$$H \le W$$$)
Let's brute force the up and down border, and count the valid left and right border. So to make sure we don't count sth twice, we'll make sure that all the borders have a
..Then we find out that it's hard to count for up and down border, but we see that counting it inversed is just simple, so let's use the inclusion-exclusion principle, and that's ok.
G
Magically easy. Just brute force like we're searching for the maximum number of divisors in a given range.(prefix.) How about that $$$D$$$?
Well, it's simple, just select a prime factor and force its exponent to be less than $$$D$$$'s. If then, ignore this prime factor when we're enumerating the next exponent.
Sorry for bad English.
yl student? orzorzorz
trashABC abcd is easy but e is hard e>>>d
Was C harder than D?
I think it's not true
A lot of contestants skipped C but solved D. I did too.
Solved $$$A, B, C, D$$$ but too many penalties and $$$E$$$ is too hard :(
How can I solve E with 01-Trie?
Hello
I solve problem C without correction :)
Can you please translate the editorial in english ?
how much you want to overkill D ? me: yes.
EDIT: i just read the editorial for D and realized my approach was the inteded.. WHAT how is segmented sieve easier than brute forcing like this ?
also if anybody was wondering, here is the solution in O(N) for C with the two pointer mentioned in the editorial.