Блог пользователя DS007

Автор DS007, 5 лет назад, По-английски

Hello Codeforces!

I am pleased to invite you to my first contest Codeforces Round 695 (Div. 2), which will take place on Jan/08/2021 17:35 (Moscow time). The problems were written by alimq and DS007. The round is rated for all users with rating less than 2100, while other users can participate unofficially.

You will be given 5 problems and 2 hours to solve them. You are strongly advised to read all the problems.

I would really like to thank:

  • BledDest for his amazing coordination of the round.
  • Aggu_01000101 and infinitepro for helping me in shortening the problem statements and solving one of the problems.
  • MikeMirzayanov for creating the Codeforces and Polygon systems.
  • The following people for testing the round:
Geothermal
sahil_k
dorijanlendvaj
eggag32 awoo
Roms Java
stefdasca Aggu_01000101 kostia244
fishy15 Gilgameshx vrooooom
T1duS wabadabakalakaboo neko_nyaaaaaaaaaaaaaaaaa
SleepyShashwat BRCode infinitepro
flamestorm saarang123 geekpradd
Jellyman102 manish.17 1_2_oatmeal
anuragbhatt socho kshitij_sodani

We hope you will enjoy the problem set! Good luck!

The scoring distribution will be added shortly.

UPD: Also thanks to nooinenoojno for testing the round.

UPD: The scoring distribution is: $$$500 - 1000 - 1500 - 1750 - 2500$$$.

UPD: Congratulations to the winners

Of div 1:
1. kort0n
2. Suiseiseki
3. peti1234
4. fastmath
5. wrinx

And of div 2:
1. raingirl
2. xsdns
3. Mister5
4. o.a
5. 20I6wudi

Thank you all for participating! My apologies for misjudging the difficulty of B.
Editorial

  • Проголосовать: нравится
  • +424
  • Проголосовать: не нравится

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +722 Проголосовать: не нравится

As a tester, I have a proof that upvoting this comment will lead to positive delta. But the proof is too long to fit the margin.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +184 Проголосовать: не нравится

As a tester there are 1 AI and 4 DS problems

Spoiler
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +104 Проголосовать: не нравится

As a tester, I Can confirm that DS007 is a wonderful dancer.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +92 Проголосовать: не нравится

As a tester, I'll edit this comment later and add something witty.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -7 Проголосовать: не нравится

This should be great contest. Good luck to everyone!

»
5 лет назад, скрыть # |
Rev. 8  
Проголосовать: нравится +162 Проголосовать: не нравится

I'm the (official) meme supplier for this contest. For every 69 upvotes, I'll upload a new, original content, cp related meme.

#1
Free Sample #1
#2

See this post for latest memes.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -11 Проголосовать: не нравится

Good luck to everybody and to me also

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Wow, no wonder you said, You had a lot of testers for this round earlier. Looks like a lot of effort went into the preparation of the round, looking forward to it. Also any authors of future rounds who are looking for testers, I would be happy to help.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

Let's wait till 11/01 to see the tester table messed up. Unless it will be changed later.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +119 Проголосовать: не нравится
Spoiler
»
5 лет назад, скрыть # |
 
Проголосовать: нравится -7 Проголосовать: не нравится

only 192 more for pupil rank :D (lmao I'm not still good and I don't know why I'm happy)

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +88 Проголосовать: не нравится

(bccf)

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +22 Проголосовать: не нравится

I tested this contest and it was good.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -81 Проголосовать: не нравится

As a tester, give me contribution! Also suggest me a new profile photo, I removed mine temporarily.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I like how the testers' names are arranged in order of the lights to the left of the logo!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

Indian Round .

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -9 Проголосовать: не нравится

pog

»
5 лет назад, скрыть # |
Rev. 8  
Проголосовать: нравится -51 Проголосовать: не нравится

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -20 Проголосовать: не нравится

I hope everyone rating goes up in this contest

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -36 Проголосовать: не нравится

As a non tester Chaliye Fodte hai ;)

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hope a good result for everyone !

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

It's advised in the post to read all the problem statements. Does that mean the problems won't necessarily be in increasing order of difficulty?

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +5 Проголосовать: не нравится

As an idler, there are too many useless spoilers on this page, so one can use this script in the console to expand them all:

$(".spoiler-content").map((i,val)=>{val.style.display="block";})
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

SPOILERFORCES

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

Guys don't waste your time in B and C like me. There is always an easier approach and everytime I think of an overkilled solution.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +20 Проголосовать: не нравится

Love this comment section

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +21 Проголосовать: не нравится

There are only 3 ratings left before I can be a Master(without using "magic")!Hope I can do it!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I hope no one cheats in today's contest.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -10 Проголосовать: не нравится

Just two hours left in the contest and still not able to see the score distribution for problems.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -9 Проголосовать: не нравится

Ok

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +28 Проголосовать: не нравится

If the contest gets 20k participants, I'm going to post 25 high quality memes.

Plus, DS007 promises a div1+div2 contest in the near future if this contest is well received...

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

scoring PLS

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -22 Проголосовать: не нравится

Is it rated for newbie?

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -53 Проголосовать: не нравится

.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

good luck

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

че за говно

»
5 лет назад, скрыть # |
Rev. 4  
Проголосовать: нравится -18 Проголосовать: не нравится

div2A is kind of diffcult >_<

I think we could add a problem in front of this and make a 6 problem round.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

it's been only 30 minutes and I already hate this contest.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -8 Проголосовать: не нравится

I think authors should not make problems anymore

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +75 Проголосовать: не нравится

Describe the contest in 1 line: Wrong answer on pretest 3

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +23 Проголосовать: не нравится

The round of Wrong answer

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

deleted

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -30 Проголосовать: не нравится

Contests 2021 is so boring !!!

»
5 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится -52 Проголосовать: не нравится

Deleted

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Описка в русском тексте задачи D. Второе предложение

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +21 Проголосовать: не нравится

I am in doubt this is a div2 round ...

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +20 Проголосовать: не нравится

well there goes my expert

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

As I can see from my friends standings this contest has been a total mess.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -9 Проголосовать: не нравится

it is been more than half of the contest and less than 3000 one solved b :o , i can say that this is a big mess

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +20 Проголосовать: не нравится

Pretests for B are too damn strong. Kudos.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

Just waiting for time to end and someone tell me all I did was miss an edge case to get Wrong Answer on Pretest 3 :(

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +22 Проголосовать: не нравится

I am actually curious to see the standing of the testers' virtual participation.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +98 Проголосовать: не нравится
CF #695 IN A NUTSHELL
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

Div2-B Pretest 3 is KILLER !!!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +14 Проголосовать: не нравится

What the hell is this Pretest 3 in B

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

SOLVED C but Failed B. this is CODEFORCES EFFECT

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

No way this was a DIV 2 round

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Too hard!!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -15 Проголосовать: не нравится

Really confusing statement for A, or so it appeared to me. Although they explicitly mentioned $$$|x-y|$$$, I had considered array to be circular in my mind. Even the examples satisfy the circular array assumption.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

WA on pretest 3

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

The most evil: "Problem B pretest 3"

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

I probably misread Div 2

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -7 Проголосовать: не нравится

To the people complaining — Div2B is all about a simple brute-force, so yes — you've read that right — perfectly suitable problem for Div2B. As for the Div2C I believe it has to do something with finding the two minimum elements and a few corner cases, but wasn't able to solve it fully.

Overall a great contest! Really challenging and interesting problemset! Thanks to the authors for such an amazing contest!

EDIT: Again downvoted for saying truth — newbies go be real mad. Y'all expect to solve 3 problems and stay pupil? No, that's not how it works. Back in the day, people who solved 2 problems fast could reach 1700 — because problems used to be tough. Trust me — no improvement if you do only easy problems.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Got stuck even on B. As a result, return to the cyan :(

How to solve B and C?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

getting wrong answer on pretest 3 for B question ,can anyone give any test case

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

quite a peculiar contest many people had the first problem wrong in the first attempt and even the second question. loved the contest by the way

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +20 Проголосовать: не нравится

Those who failed B, try this

Testcase
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +40 Проголосовать: не нравится

Who made these problems is an evil person ...

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Since contest is over, may I get some hints on how to solve problem C?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -9 Проголосовать: не нравится

My mistake from past 30 or so minutes

if(!isValley(idx, arr) && !isValley(idx, arr)){
}

instead of

if(!isValley(idx, arr) && !isPeak(idx, arr)){
}

and that happens despite using an IDE that warns against this :)

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +135 Проголосовать: не нравится

Who wants to hear how we, the testers, trolled the cheating telegram group? Lot's of WA are cause of our efforts.

To those who want to help: Search for solutions of B that have a -25 anywhere in the code. Post their names here, they are all cheaters...

Reason why? Will make a blog post "soon".

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

Some thoughts after solving B:

If you wrote exactly once in bold why couldn't you write or let the sequence remain unchanged in bold as well?

Why can't n be just greater than 2?

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -33 Проголосовать: не нравится

tricky contest XD

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Div2 C I think I figured out... I was not sure though: is it just total — 2*(smallest + second_smallest) ? D was easier I thought...

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +28 Проголосовать: не нравится

»
5 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится -6 Проголосовать: не нравится

In my opinion only fault was it was of 2 hrs . It should have been half or 1 hour more.

Problems weren't straight forward and samples didn't gave any hint and that's why accuracy in this contest was low. But contest wasn't that bad.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

I am eagerly waiting to see the 3rd test case of problem "B".

»
5 лет назад, скрыть # |
Rev. 5  
Проголосовать: нравится 0 Проголосовать: не нравится

Problem solved

»
5 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится +14 Проголосовать: не нравится

I'm not exactly in a position to say this, but I think pretests for E were too weak. Let's define an array occ[1e9], where occ[i] represents the number of nodes with assigned number equal to i. Then my solution worked in O(sum(occ[i] ^ 2)), which on worst case is O(n ^ 2), and for some reason pass the pretests without much problem. I guess that's because my solution is too counter-intuitive to even think of, but allowing any kind of O(n ^ 2) to pass is in my opinion a sign of very weak testcases.

Note: I'm not saying anything about the main tests, I do hope that some in-contest hacks will be added to break my solution (post-contest hacks will surely break it). However, I suspect this is not the case since there were only around 100 accepted solutions for E, and I've not seen a hacked solution in-contest.

UPDATE: So thankfully (or not?), a new test was introduced to break my solution. My opinion holds though.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

My wait for cyan continues....

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

Respect ! To those who solved B from the first submission !

»
5 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится -10 Проголосовать: не нравится

Excuse me for saying this .. There are two points that make this contest bad : You have underestimated it as Div2 ,,,, The tests were not enough to fully understand problems

»
5 лет назад, скрыть # |
Rev. 4  
Проголосовать: нравится -14 Проголосовать: не нравится

Very interesting round, first time I've had to write a brute-force for A and B to debug my fast-but-WA code.

For those facing WA in B, here is a brute-force solution and a test harness in python.

Brute-force solution
Test harness
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +33 Проголосовать: не нравится

On the positive side, fast system testing.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

system testing on nitros. so much lesser submissions relatively.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

In C, can we take a and b from the same bag? The problem statement makes it sound like we can't, but then I don't really see how the answer to the second test can be 29...

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

For Task $$$B$$$ The maximum no of hill/valley we can destroy by changing a number is $$$3$$$ right?

  • »
    »
    5 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    The best possible case is when changing an element, the answer decreases by 3, however, you have to be careful because many corner cases may exist.

    What I did was: for each position $$$i$$$, I have some options. Keep the value of $$$v[i]$$$ the same or for each $$$j$$$ $$$(i - 2 \le j \le i + 2)$$$, assign $$$v[i] = v[j] + 1$$$ or $$$v[i] = v[j] - 1$$$ or $$$v[i] = v[j]$$$.

    Therefore, I just have to iterate over all these possibilities and see which one is the best.

    Note that for each possibilty, I just need to recalculate the answer in the interval $$$[i - 2, i + 2]$$$.

    My code: https://mirror.codeforces.com/contest/1467/submission/103779093

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

is my idea for B totally wrong ? We can at most decrease the hills and valleys by 3 because at most we can affect 2 hills and one valley or 2 valleys and one hill how could I be wrong about that

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +19 Проголосовать: не нравится

This contest was a trap. :))

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Another Div 1.5 Contest.
Those who submitted A and B in one go without wrong answer on pretest 3. Hats off to their accuracy.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

Rozen Maiden one-two finish with Suiseiseki :)

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -9 Проголосовать: не нравится

Next time Don't believe on a new setter too Quickly!!!:(

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Dude, he is making contests, actually making actual contribution to the community. What have you done to do the same? It's pathetic to see the entitlement which participants seem to have. Even I had a terrible contest, but I wouldn't take it out on the authors. Try to give constructive criticism, if possible or don't comment at all :)

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Very weak pretests for C :(

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

The contest is fun and annoying at the same time as "WA on pretest 3", corner cases killed my rating :)) Anyway, I like it :D

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -15 Проголосовать: не нравится

why contest div2 was too hard ???

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

What type of div2B has <30% passing rate smh

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +21 Проголосовать: не нравится

Fastest system testing.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -8 Проголосовать: не нравится

Just asking, did the testers give no feedback about the difficulty? It would be much better if there were one more problem between A and B.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

Problem B WA3: When you replace a number, you may not improve the answer, but rather make it worse. Most likely, you only checked the destruction of valleys/hills.

Example:
1
6
6 7 10 5 7 9
answer(1), your answer(0)

Your program will replace the number 10 with a smaller number X. Then most likely there will be a hill (6, 7, X). It was necessary to make a separate check for this

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

My PyPy 3 O(N) solutions TLE for both A and B. What is going on this contest?

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Update: I submitted exactly same code for problem B and get AC after the contest, with passing time of 960ms. What a great feeling LOL.. if python O(N) cannot pass TLE during contest, I suggest naming it a C++ round.

    • »
      »
      »
      5 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      Yeah, 1 second really is quite harsh, it's not like 2 seconds would have permitted any n² solutions or anything.

      • »
        »
        »
        »
        5 лет назад, скрыть # ^ |
         
        Проголосовать: нравится +5 Проголосовать: не нравится

        Yes, I agree. Sometimes I have seen when O(NlogN) PyPY will not pass, but this is the first time to see O(N) not pass. I don't mean to serve too many sour grapes, but it's my 39th contest, and first time not solving A or B. It does seem there is something with this round. I know CF is for more for CP, so maybe it's my own fault for using python.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +46 Проголосовать: не нравится

Usually when I did not that well I complain about bad problem statements, so I do not write this often, but:

I liked this problemset. Of course, A and B where less simply than expected, but nevertheless solveable. I did not solve C and D, but was close to D. And all the problems were exciting to solve.

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    For a 5 problem contest I think A was simple enough (just think about first 3 digits is not so hard). I ruined my contest because I wrote on C v[N][5] instead of v[5][N]. For me B was impossible and D some math problem, interesting overall.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

WA on test #695: "Division of contest" Expected answer: 1 Given answer: 2

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

:/ I'm bad in CP

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Problem B had very painful implementation.

Is there some trick in it?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

I had my worst performance but still definitely a brilliant contest. Thanks for such a great contest. I learnt a lot and I won't repeat these mistakes.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Was there an elegant solution to B? I spent 2 hours brainstorming and solved it using prefix, suffix arrays.

For all $$$i$$$ change $$$a_{i}$$$ to $$$a_{i-1}$$$, $$$a_{i+1}$$$, a pretty big value, a pretty small value and count the number of hills and valley. Speed up the counting using prefix and suffix arrays. My implementation was way too ugly.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -18 Проголосовать: не нравится

I want my rating back.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can we get the full version of test case 3 for problem B? Thanks a lot.

My thinking which is the same with all the people who got the AC
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +113 Проголосовать: не нравится

To not keep you waiting, the ratings updated preliminarily. In a few hours, I will remove cheaters and update the ratings again!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +13 Проголосовать: не нравится

Finally after 2 and a half years...

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

My solution for problem C failed on test case 17. Can anyone please suggest an easier case on which this solution is failing?

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

guys my contribution is decreasing but i checked every comment i did and there were no downvotes any help!

MikeMirzayanov

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +1 Проголосовать: не нравится

there some moments you want to get wrong answer , a solution you finished writing 2mins after the contest ended is one of those moments. Man just needed 2 more minutes.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +5 Проголосовать: не нравится

can anyone explain this part for problem D?

for (int i = 0; i < N; i++)
        for (int x = 0; x <= K; x++)
            coefficients[i] += dp[x][i] * dp[K - x][i];
»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +16 Проголосовать: не нравится

But in all honesty, a brutal contest. Lucky to have solved 1 problem (late in the contest).

»
5 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится +3 Проголосовать: не нравится

My code for problem B got killed by systest, but when I resubmitted the exact same code twice, it passed both times. Is it possible for me to get a rejudge? If not, that's fine :)

Original contest submission (TLE): https://mirror.codeforces.com/contest/1467/submission/103773278

First resubmit (AC): https://mirror.codeforces.com/contest/1467/submission/103811031

Second resubmit (AC): https://mirror.codeforces.com/contest/1467/submission/103811357

Edit: issue has been resolved.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

The trickier contest than usual.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

one of the best contest, looking forward to more like these contests

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

SuperFast Results

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Huh! Superfast rating update.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +36 Проголосовать: не нравится

Too much whine just because problem-setters made somewhat tricky questions and didn't give away hints in the samples.

It was unusual but if you ask me, is not it the way it should be?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +42 Проголосовать: не нравится
How to determine if a round is good
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

I can't see any penalties for my wrong submissions in this round. Why?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

I think A, C, D, E were all good quality problems though they bit have been on the harder side. hard != bad problems. B was boring and tedious.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

I found problem E is doable by DSU-on-tree 30 minutes after the contest began, and jump into the honey trap debugging for one hour and a half. It will only cost me 40 minutes if I decided first to do C and D, but it was too tempting for me to solve E first...

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится
»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

When I uncomment 4th line i.e when I convert all integer to long long. Why am I getting runtime error on test case 8. Without this conversion i.e. int to long long code is getting accepted.

https://mirror.codeforces.com/contest/1467/submission/103815290

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Where are editorials?

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Someone please help me in finding a counterexample for my submission

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

can D solve faster than O(N^2)? I've considered many ways to improve, but couldn't reach any efficient way.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

One of the Fastest Rating Updates !!!

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

can someone give what are edge cases of Problem B Div 2

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -35 Проголосовать: не нравится

hello everyone!!!! can you please tell me what's wrong with this solution for the problem B (hills and valleys)?

include<bits/stdc++.h>

using namespace std;

define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

typedef long long ll; const int mod = 1e9 + 7; int main() { IOS; // string s; // cin>>s; //ll n=s.length(); int t; cin>>t;

while(t>0){
ll n;
cin>>n;
ll ar[n];
ll h=0,v=0;
vector<int>q;

    for(int j=0;j<n;j++)
   {
      cin>>ar[j];
   }
   int cnt=0,flag=0,ans=0;
for(int i=1;i<n-1;i++)
{
    if(ar[i]>ar[i-1] && ar[i]>ar[i+1])
    {
        h++;
        flag=1;
    }
    else if(ar[i]<ar[i-1] && ar[i]<ar[i+1])
    {
        v++;
        flag=2;
    }
    if(flag==1 || flag==2)
    {
        cnt++;
        flag=0;
    }
    else
    {
        flag=0;
        ans=max(ans,cnt);
        cnt=0;
    }
}
ans=max(ans,cnt);

// cout<<v<<h<<ans; v+=h; if(ans>=3) v=v-3; else if(ans==2) v=v-2; else if(ans==1) v=v-1; // if(v<0) // v=0; cout<<v<<endl; t--; } return 0; }

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Does anyone have an idea why this solution doesn't work? https://mirror.codeforces.com/contest/1467/submission/103765146. I think that the problem is not in the idea, but in the implementation, since at the 3rd pretest one result was -27!!! And I have no idea how that could happen, can someone with more c++ knowledge help me?

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

понял проблему...

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Please can someone provide a counter-case for my submission. My code gave the correct solution for the counter-cases mentioned in the above comments. 103819406

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

If they put C before B, I believe more people will be able to solve it.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Очень интересный контест, особенно задачи интересные) Почти в каждой есть какой-то подвох который можно не заметить если быстро пройтись по задачи и придумать решение :D

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

The contest had very good idea!
But it could gain much more likes if:
1. It was Div 2 contest (it was not), 2. if Testers had think more about contraints: Div2 B is very difficult to pass with scripting language and this forces to optimize only a constant and disables from other interesting solutions with same complexity but with a bit higher constant.

UPD. also, it was boring without hacking on A and B. Why multitests!?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

I think passing BC needs very careful thinking

Otherwise it will wa many times like me

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Although I struggled with B, it is hard for me to believe that a simple brute force is enough, I overthought and made it complicated with making shapes/checking valleys and hills.

I found this round pretty interesting. Thanks to setters.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

someone knows how to add the date and time of creation of code like tourist does ?

Is it by hand or some script ?