We will hold AtCoder Beginner Contest 465.
- Contest URL: https://atcoder.jp/contests/abc465
- Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20260704T2100&p1=248
- Duration: 100 minutes
- Writer: sheyasutaka, sounansya
- Tester: MMNMM, KumaTachiRen
- Rated range: ~ 1999
- The point values: 100-200-300-400-450-525-625
We are looking forward to your participation!









It's difficult!!! I just pass A to E.
can you please tell how much time do they take to update the rating? **__**
It's usually about an hour. There are also some Chrome/Firefox extensions you can get that can estimate it for you early (I use a custom script on Tampermonkey).
$$$E$$$ is a mammoth of a digit DP problem right? We compute digit DP's of all combinations of the 3 conditions and do inclusion-exclusion right?
No need. We assume three conditions a,b,c.
When you get a number, just return (a+b+c)==1.
Oh yes got it thanks.
I ran digit DP three times to count the number of positive integers satisfying the 1st, 2nd, and 3rd conditions respectively.
How to solve E ?
Second AtCoder Contest. Improved from only solving A to B to being able to solve C (even though I joined 30 minutes late)! Hopefully I can solve A-C faster next time to start tackling D.
Me too!
has anyone used trie in F, or its just not possible?
Hello! Apparently you need to solve it with a 6D prefix sum, so quite implementation heavy IMO.
fuc.kF,6D is too busy.
It has a unorginal problem.
First ABC. solved A, B quickly but got stuck for a bit on C. Couldn't grasp D and finished with 600.
I am such an idiot ,i solved A,B,E , couldn't solve c and d , for d i was trying to do bfs by keepign ranges of y , but i got tle,mle and wa
Can anyone tell me how to approach c, I guess it's a prefix computation problem because of given time constraints but I got struck...
Try with a deque , i solved it with deque.
you can try using two pointers.
It's actually extremely simple once you get the pattern. You don't need a prefix sum for it.
First of all notice that you shouldn't be checking the string from 'left to right' but actually from 'right to left.' That's because inversions at the beginning doesn't give any hint to the final positions of the number at those positions, since you don't know how many times you'll be inverting later on.
But if you start from the last characters of the string 'right to left', if there's an inversion you can immediately tell that N (last number) should be placed at the beginning of the number array. That's because number N is unaffected by any of the inversions before it and is only inverted by the last character. This is recursively true for number N — 1.
So you read the string from 'right to left' and interchange between right side and left side of the number array as you place the numbers from N to 1, and you'll get the answer in O(N) time.
You can check my solution here (it's very short and I didn't use anything complicated): https://atcoder.jp/contests/abc465/submissions/77213807
look at the alternating sum from the end like :
i have implemented using 2 pointers in the below way.
Maybe you can use a deque ,and exchange its head and tail with the char .Finally think about how to output it
I'm sorry about my bad English,if you can't understand ,just ask me:)
Can some one tell me how to solve D ?
are the possible transformation's that we could do.
Hey, the approach I took is, find the least common ancestor of X and Y. Bring down both values to 0 and check where they meet. special cases are when one number is itself included in other one.
My solution: https://atcoder.jp/contests/abc465/submissions/77223657
You need to observe that applying 1st operation after 2nd operation to $$$x$$$ will yield the same value $$$x$$$. So we have to apply 1st operation before 2nd one. Instead of applying 2nd operation to x, you can apply 1st operation to y. So LCA of operation 1 on x and y gives the answer.
start BFS from X and Y , on each step the next node is X/K and Y/K,
i got blank today don't know why
Anyone can help me with D? I think I can use some kind of graph, X / K operation can lead to multiple values of X (upto K — 1 variations) that give same result. But apart from that I am not able to proceed further?
I solved A and C (with a Treap ;//). IDK why B and D didn’t get accepted. I am yet to solve E and F.
I participated in virtual contest this morning, was able to solve A, B, C. Specifically C is a lovely problem. Upsolved D by some hints, now stuck in E, sunday started well.
C can also be solved using doubly linked list. All the reversals can be done in O(1)
Problem C is simpler than the previous ones, and the difficulty may be only 1200.
Digit circus is a hilarious reference
D had a really good logic. I did not get it, I wonder how I can get good at these!
May I ask hoe to do question E