Comments
+29

Cause this problem can be solved without centroid decomposition. Don't assume your way is the only way to solve a problem.

Lol, my bad. Added my one.

Only prefix sum, I needed kind of dp. How did you do that?
https://atcoder.jp/contests/abc203/submissions/23059605

binary search for median.

I tried to do bfs in E, from any pawn to any other reachable pawn. This costed me heavy implementation and of-course, 2 minutes passed after the contest sadly.
https://atcoder.jp/contests/abc203/submissions/23074189
Edit: I accidentally copied another submission lol

But, we know the stories there. But, here we're missing the story of Berland University, Polycarp, Monocarp, Biteland, Vasya petya and many more.

Well, at least you know the stories there huh.

Well, what about upsolve?

I've seen Alice and Bob in math problems too.

When I started CP, I didn't know any of my friend doing that. Just headed here referred from an article I guess to give a shot.
Even if you got people, it's fine to ask in a community. You can get many insights from them. Those new people need guidance and even us little experienced people too. Blog for a problem is kinda too much but also that kinda gives you more insight. You would find some people spamming with hints. You would find 100 other people trying that problem. Interestingly, I learnt rerooting technique from a help post of a pupil. He just wanted help in a problem and it actually helped me too.
This is a community for a reason.

Dude, don't ban newbies to talk lol. Those posts just look useless but it's pretty natural to ask how many hours to dedicate in CP when you're new in the field. If you start some other activities, same questions would pop in your head. So, let them ask.
I know those questions people ask in the blog are googlable but still. It feels better if you get direct replies.
I think banning unrated users to spam is fine. No need to put any rating boundaries.

Problems in this platform aren't made for cracking interviews. So, don't use this platform for cracking interviews.

There is only one case of draw though. So, it isn't possible. However, they should've blocked the outputs. That's something setters should work on, they should try to highlight the key statements

How to solve E? Couldn't get any idea for an hour.

You wanna see observations in problems though. Those observations are nice.
They should've swapped C with B though.

How to solve E?

How to not choke? All I do is choking

You can at most aim for 1900+. 2100 is way far from you. Let's say, you're practicing hard. But, you have to adjust with that and perform good in rounds constantly. How many rounds would you get in 3 months? And you won't do good in every round you know.
You have to be real lucky to reach your goal, also real hardwork.

+3

wtf. Why everyone is getting hacked?

My bad, didn't understand what he meant at the 2nd solution, it looks like implementation is exactly same. Now I just noticed that sorting was mentioned in the very beginning.

Alternative solution for 1504E - Travelling Salesman Problem
Basic observation is similar. Cost for $$$i→j$$$ is $$$c_i + max(0, a_j - (a_i + c_i))$$$. There is another thing to look for. We can start from any city instead of city $$$1$$$ and still get same answer as our path is a cycle. That's how, we can just sort the cities based on $$$a_i$$$. Now, starting from the lowest $$$a_i$$$ city, we can go one by one and we can do transition from most optimal city to current city based on $$$(a_j + c_j)$$$ values.
Code — 111946687

-13

damn, I was correct for E. Just 10 min left to implement so couldn't implement in time. I wish I didn't cost much time at B

On MonogonCodeforces Round #712, 5 years ago
+16

Quite easier than C

(6, 4), (7, 5), (8, 6) and so on

won't work. 4 — 5 != 2 — 4

then m can be largest possible

How to do div2D?

Score distribution?

I mean, satisfying the problem constraints($$$a_i \lt = 2.5*10^6$$$)is needed

Yeah, I know. But, for N <= 1572, we can have NO. And we need to find a sequence having the answer No for those N

Well, that won't fulfill the constraint as $$$a_i \lt = 2.5*10^6$$$ needs to satisfy

Even absolute newcomers with just a little idea of complexity won't write O(N^2) solution at this constraints without reasoning. So, what are you talking about? They at least got the intuition and getting it isn't hard. It's just getting the fact that if you have large N, then you would have duplicates in sum simply because of so much options to choose sum and limited options for sum.
So, not actually many of them, only like 1-2% at most without knowing reason tried out O(N^2).

That's also cheating. A guy is registered, viewed problems and decided not to participate.

Hmm, you can choose to not to log in and see the problems and then decide whether to participate or not.

I mean the round needs to be rated if you're registered. No matter you viewed the problems or not. You have option for registering 5 minutes ago. It's easy to decide to go for a contest 5 minutes ago. So, just register before the contest if you wanna participate.

Inefficient strategy. If you end up solving D, still you would be late and you won't get enough points due to penalties. Then, you would have only time for A and B, still you would face huge penalty.

This is what happens when the problem is actually of nice easy observation. And I like it

I liked the baiting in score distribution

+3

What's the approach, my sol gets WA on test 7

+4

damn, what's test 7 on D?

0

Some progress.
1. The set of fish $$$i$$$ can eat forms an interval $$$[L, R]$$$ where $$$L \lt = i \lt = R$$$. If we can't extend it any further, than
2. $$$a_{L - 1} \gt = a_i + R - L$$$ and $$$a_{R + 1} \gt = a_i + R - L$$$
3. $$$mx(L, R) \lt a_i + R - L$$$
if we combine, we have
4. $$$a_{L - 1} \gt mx(L, R)$$$ and $$$a_{R + 1} \gt mx(L, R)$$$
Now, how to check that thing? I am struck here.

0

That stupid fake updates.

0

Why so many hacks in F? What is the hack case?

0

Yeah, but F should not be solved by 250+ peoples if we see the other div3s. And yeah, it was educational. I was getting struck in implementation with fake updates cause I initialized everything with 0. Probably that's why they put it in F.
But, a lot of people dance between blue and cyan so this probably gives unfair advantages to them.

0

For F, it is simple to reduce that difficulty in your idea, do an auxiliary dp for only col counting the state for checking M/2. Extract optimal and use it to update main dp.

0

Why would you give a problem like F in a serious contest?

Biggest fool I have ever seen.

Let's say 2 lines be in parallel to x-axis denoted by endpoints $$$(x1, y1), (x2, y1)$$$ and $$$(x3, y2), (x4, y2)$$$. They are overlapping in x-axis if $$$max(x1, x3) \lt min(x2, x4)$$$

Well, you missed another hint. To have overlapping squares. You need overlapping in both x axis and y axis. Thus you can transform the problem into finding overlapping lines. Let, $$$X$$$ be the number of overlapping lines. Ans is simple $$$X^2$$$.
How to count overlapping of lines. WLOG $$$A \gt = B$$$. Two cases.
1. $$$B$$$ is completely inside $$$A$$$.
2. $$$B$$$ is not completely inside $$$A$$$.
Calculating these two things is trivial.

0

think with time, then you would be able to optimise it in O(2 * n * r)

Well, how would you manage training then?

-35

Oh please, then make score of every problems twice. What if some contestant gets C/D but not B and gets bad position due to closer score distribution. And in combined rounds, its common to get tougher B(at least for me)

So, that's something extra of problem solving. Thanks a lot, I would try to give the proper value of your words and reach at least CM. Thanks a lot.

What to do to get out of expert? I am struck for 4 months. Not that I left my training. During my 4 months, I solved around 200 problems. Still I am exactly where I was in 4 months ago and I am not even being able to reach my previous rating that I achieved 4 months ago. What to do? Everytime I do better turns out I did better to be fucked up next time. How you improved so quickly? Please dont say just solve problems because I am solving problems and I see editorial if I am completely struck, not struck for 1 hour or something like that but completely struck.
I need your help badly. Please.

You can count me in.

I think this gives us chance to solve harder problems. But, B is too easy.

It isnt valid. if you have (3, 6), then you need (2, 5) and (1, 4).

What a pure implementation garbage you made to C there.

0

Probably its supposed to work but combined rounds interferes everytime.

Bad day for you bro. But this is the story of me in every combined rounds, complicated statement in B, try to understand the statement thus kill your potential, go to C solve it then come back and try more. Finally get B and then rush for D, get idea before just 10 min of end and rage in corner. This is the thing that dropped me from 1800+ where I never managed to reach till now

Looks like combined round is here only to kill me. RIP rating once again.

I did $$$max(0, b1 - a1 - a2, b2 - a2 - a3, b3 - a3 - a1)$$$ and it passed. I have some intuition that it would work but not sure at all. Someone prove this please.

0

Why good day? You managed to get lot of penalties with better performance due to be late

0

4

0

There is a general thing. People can solve A because its A, people cant solve E even if its easy cause thats E

0

Something like this.
5
-1 1 -1 1 -1

On maroonrkACL Contest 2 Announcement, 6 years ago
0

That's really useful. Thanks a lot

On maroonrkACL Contest 2 Announcement, 6 years ago
0

I need tutorial for documentation lol. Freaking mathematical terms

On maroonrkACL Contest 2 Announcement, 6 years ago
+3

dp with segment tree. Make a segment tree in range 0 to 300000 where in a node i, you would store the position where i appeared last. Now, lets say you are at index i, then you are looking for p = maximum in range(v[i], v[i] + k) and q = maximum in range(v[i — k], v[i]). then, dp[i] = max(dp[p], dp[q]) + 1. Update for v[i] with i after calculating the dp[i]. Ans is maximum of dp[i] over 1 to n. Its easy to realise why it works, its upto you

On maroonrkACL Contest 2 Announcement, 6 years ago
+5

Oh man, come on. What mess you made in lazy segment tree documentation. I need tutorial for the terms in lazy segment tree documentation bro.

Well, I am starting codechef

On maroonrkACL Contest 1 Announcement, 6 years ago
0

If 600 point problem is supposed to 1900-2100 rated problem then why there should be maxflow? I was recommended to learn maxflow after reaching master

On maroonrkACL Contest 1 Announcement, 6 years ago
-41

So, you made a maxflow problem for 600 points. Why?

I also got idea of two lazy segment tree immediately but I haven't implemented even a basic lazy segment tree before so I gave up. Now I am seeing there are other solutions too

0

Why would not $$$O(n^4)$$$ pass?

I am not getting the intuition. Can you elaborate why it works?

On i.eCodeforces Round #669, 6 years ago
0

Such a nice D and E. Wow.

What is the codeforces problem similar to F?

Isnt there a lot of cyclic shifts possible?

The idea is tough to explain for me. I try. 1.A is in ascending order and B is in ascending order. So, just try to pick up elements like two pointer from start to end. Then, pick the unpicked elements too. Now, check the answer. If its OK then print.
2. Otherwise, reverse B once again and go like 1. Check the answer. If OK then print it, else there is no answer.

Just 2 min short to get AC in problem F. Nice F anyway

On i.eCodeforces Round #669, 6 years ago
0

They clearly can set TL by language which they dont

On decoder__How to upsolve?, 6 years ago
+11

You don't like -is-this-fft advise, you don't like Errichto advise, then you can surely do all things on yourself. Don't ask advise then

On decoder__How to upsolve?, 6 years ago
0

You would get that later. For now, just think a redcoder advised this so it's correct.
I know it's tough to concentrate on a problem for a long time but improving is also tough. If you face difficulties even after trying for 1+ hour, then you can leave that. But make sure you get back to that problem after some days

On decoder__How to upsolve?, 6 years ago
0

And then try even more. Eventually you would get accepted.
And you are solving <= 1500 level problems which is enough for now. If your rating goes up, then upgrade the range. If you go down, downgrade the range.

On QualifiedHappiest moment on CF?, 6 years ago
0

What I thought would have been my happiest moment turned out to be my worst moment on CF.

I am exactly kinda same situation with you. I can't even retrieve my max rating in 2+ months(looks like I am going to do this now). Sometimes, it's bad problem orders, sometimes overcomplicating B/C or sometimes big WA's just screwing me. And it looks like if I am under pressure, I get WAs.

On atoizCodeforces Round #666, 6 years ago
+10

I costed 2 WA for that. Feeling the pain bro

Well, you forgot the old atcoder problems. There are a lot of interesting E's and F's there including this F to solve. Atcoder problems are better in my opinion but they are making unbalanced rounds recently.

They just could have used some tougher E. I took some time at B, then got a WA in E and that costed me.

How to solve F?

Then, isn't D worth of 1786 at most. Maybe it's less. Cause there are participants who solved D but couldn't manage to solve 4 problems. Then, D would be at max 1800. Isn't it?

There are also some other weird things also about problem rating.1400D - Zigzags from educational round 94 has difficulty of 1900. So, if an expert solves 4 problems in time, he should obviously get positive rating change. Isn't it? But, there are experts who solved 4 problems and got negative rating change. Why?

Big agree. You would get the feeling that you are real close to do that and then you would fall. After some attempts, it's possible to clear. There are a lot of people who reached 1800+ rating are currently in 1600 range. Because this range is versatile. But this actually starts from 1500, so 1500-1900 would be an interesting region for expert in my opinion. You see lots of 1500 guys are beating lots of 1800 guys in div2. The number is not few.

Yeah. $$$1$$$ to $$$i$$$.

Ohh no. Another silly mistake

After D

Tried with that but WA

Iterate for $$$j$$$ and $$$k$$$, Now you need a index i such that $$$a_i = a_k$$$ and $$$i \lt j$$$, similarly, you need index $$$l$$$ such that $$$a_j = a_l$$$ and $$$k \lt l$$$, this suggests us to store two things.
$$$1$$$. $$$pref[i][j]$$$ be the number of times $$$j$$$ appeared from $$$1$$$ to $$$i$$$
$$$2$$$. $$$suff[i][j]$$$ be the number of times $$$j$$$ appeared from $$$i$$$ to $$$n$$$
Now, rest is quite easy.

How to solve B?