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

Автор Endagorion, история, 6 лет назад, По-английски

Hi!

On Jun/18/2020 17:45 (Moscow time) we will host Codeforces Global Round 8.

It is the second round of a 2020 series of Codeforces Global Rounds. The rounds are open and rated for everybody.

The prizes for this round:

  • 30 best participants get a t-shirt.
  • 20 t-shirts are randomly distributed among those with ranks between 31 and 500, inclusive.

The prizes for the 6-round series in 2020:

  • In each round top-100 participants get points according to the table.
  • The final result for each participant is equal to the sum of points he gets in the four rounds he placed the highest.
  • The best 20 participants over all series get sweatshirts and place certificates.

Thanks to XTX, which in 2020 supported the global rounds initiative!

Problems for this round are set by me. Thanks a lot to the coordinator 300iq and testers thenymphsofdelphi, Lewin, Golovanov399, Osama_Alkhodairy, gamegame, dorijanlendvaj, HenriqueBrito, kocko, ruban, Origenes, Ilya-bar, rahulkhairwar. Their feedback was a huge help and affected the problemset greatly.

The round will have eight problems and will last 150 minutes.

Scoring distribution: 500 — 1000 — 1500 — 1750 — 2500 — 3000 — 3500 — 3000+1500

Good luck, and see you on the scoreboard!

UPD: the round has concluded, congratulations to the winners:

  1. ecnerwala
  2. tourist
  3. Marcin_smu
  4. Petr
  5. Radewoosh
  6. Um_nik
  7. maroonrk
  8. eatmore
  9. snuke
  10. KAN

Check current Codeforces Global series standings here (courtesy of aropan).

You can find the editorial here.

Stay tuned for prizes announcement!

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

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

Surprising that even legendary grand masters have coordinators.

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

Aiming for T-shirt!

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

late announcement :p

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

Combined Round after a long time !

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

Deliveries in corona times T_T

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

Can we expect more than 20k participants in this round.

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

Endagorion... It sounds like a good round

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

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

Will we see a EvenImage vs tourist?

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

NICE Round

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

A newbie like me should participate in this? though it is rated for all and the level of questions will be hard

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

Hello guys.I have no idea about calculating contribution.I commented in the last div3 contest announcement then my contribution began to low.Before this i thought contribution is calculated only for blog.Please anyone explain about calculating contribution..Thanks in advance.

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

Combined Round! Hope it will be fun.

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

tourist and EvenImage both have registered for this round! It will be exciting to see.

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

With how many problems?

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

No offense to anyone

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

A codeforces round from Endagorion after a long time. Eagerly waiting...XD

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

I hope to see myself as a pupil in today's contest. Good luck for everyone.

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

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

Is the rating calculated differently for these rounds? For example if I get rank 500 in a global round and in a div2 round, would my delta be higher for global round since div1 participants are also considered in official standings? Or will it be the same

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

This comment section is shit.

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

For the top-100 participants, how is the points calculated? I mean the sequence {$$$1000, 706,575,497,443,403,371 ...$$$} apparently makes no sense. Or does it?

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

waiting for this contest after global round 7!

and hoping to get t-shirt!!! good luck to all others!!

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

*_*

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

Hey, I am somewhat new in Codeforces. I want to ask that ofc my standing will be lower comparable to other Div. 2 rounds, so will it affect my ratings in a negative or positive way?

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

Codeforces and Polygon may be temporarily unavailable 2 hours starting from July 18, 05:00 (UTC) due to infrastructure updates.

I think it should be June 18 ? MikeMirzayanov

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

Deleted

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

can someone post previous contest Links by Endagorion.

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

i hope "pretest passed" and "accepted" will not follow the rule of social distancing

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

The tourist Is Coming

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

Is there any chance that the contest will be canceled?

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

Please check previous comments before commenting something, don't post same repetitive comments and memes in the same blog.
Remember, it's Codeforces, so don't make it memeforces or spamforces :(

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

Wow! The score distribution for the last problem is almost equal to the score distribution for the first 4 problems!

Good luck everyone!!

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

Scoring distribution: 500 — 1000 — 1500 — 1750 — 2500 — 3000 — 3500 — 3000+1500. Actually, I am not clear about "3000+1500" part.

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

MiFaFaOvO vs tourist ... who will win today ??

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

delayed 10 m !

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

More 10 minitues!!

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

Last five minutes delays are the worst thing ever.

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

delayed

Oh boy the queue will troll us again huh?

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

Let's hope that this delay is not a sign of long queues

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

10 min delay?

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

Seriously why does Codeforces like to delay contests in the last minutes? It's really ruining the momentum and the "zone" :(

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

postponed for 10 mins?

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

Round delayed for 10 minutes.

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

The delay is like the apocalypse trompettes before a round.

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

I got electricity cut and contest is delayed. Hope electricity returns in 10 minutes....

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

Hope queue don't play with us.

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

No queueforces please :(

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

I hope the round doesn't get cancelled. Fingers crossed XD

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

If it gets delayed by 10 more mins, I'm gonna have my dinner.

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

Wouldn't it be amazing to know what exactly happens when codeforces is working on it's infrastructure? Anyone? Just curious :)

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

I hope this round will go without any problem and no more delay

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

Comment section nowadays

Apparently this post is included :(

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

Too Difficult.

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

What the hell is this 2nd problem?

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

That gap between D and E. Oooooooof.

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

Solved 4 Problems and left the contest.

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

Speed-forces for non-red coders. >_<

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

What a mess I've done? Hope others did well

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

Nice problems, but it is so demotivating when you just sit 2 hours straight not even coding something...

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

For example u have:

7
1 2 3 4 5 6 7

Let’s write it in bits:

0 0 1 														
0 1 0
0 1 1
1 0 0  
1 0 1
1 1 0
1 1 1

turn on gravity for let bits fall down and stack at each other, now u have:

0 0 0
0 0 0
0 0 0
1 1 1
1 1 1
1 1 1
1 1 1

Now u just need to sum squares of this numbers

Python code:

am = int(input())
arr = list(map(int,input().split()))
bits = [0]*21
for i in range(am):
    n = list(map(int, reversed(list(bin(arr[i]))[2:])))
    for i in range(len(n)):
        bits[i]+=n[i]

b = max(bits)
s = 0
for i in range(b):
    n = 0
    for g in range(21):
        if bits[g]:
            n+=2**g
            bits[g]-=1
    s+=n**2
print(s)
»
6 лет назад, скрыть # |
 
Проголосовать: нравится +13 Проголосовать: не нравится

I made a video explaining problem D because I really liked the problem — https://www.youtube.com/watch?v=oHgcHjk2fIM

There are many people with these videos, so let me know if it's worth doing more, thanks!

(Well, I liked problem E too, but I didn't solve it)

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

By any chance, were the rooms decided based on rating? Mine only had me as >= CM and 2 blues rest all cyan or below.

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

Why limit in E is 4/7, not 4/6? ;.;

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

These problems are good. Great round! Took me a long while to find the idea for C. I tried so many things lol. Can anyone share ideas for D?

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

What was the catch in Problem B?Can anybody explain?

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

    2 * 2 * 2 * 2 * 2.... generates longer subsequences than 1*1*1.. *n for a smaller cost, so greedy check 2*2*2*2 and then 3*3*3... (keep on incrementing so 4*4*4... and 5*5*5... etc) until you're ready (you can mix different numbers suchas 2 * 2 *... *3 *3 *3

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

How to solve E?

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

KSM problem C

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

First time participated in a "global contest", Wow it was amazing, thanks to the organizers

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

How to solve D? Whats so easy about D?

My approach which is wrong was to store numbers in min_heap, extract 2 and operate on them, store the greater one back in heap. This worked on so many handwritten cases but not pretest 4 :(

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

Please tell any hack case.

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

You just need to learn concept of gravity to solve Problem D

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

How to solve E? someone help please

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

I solved D in 8 minutes and B in two hours, I was trying to increase subsequences using suffix earlier on, but prefix gave a better answer. Really upset! But a really nice round overall!

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

Lol, didn't expect C to be a pattern based problem. Just print the coordinates and thats it.

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

was b something about powers of 2 and 3?

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

How to solve C

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

Was that any problem ordering C->D->B. B was really hard.

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

I'm noob so asking, Is B supposed to be easier than C?

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

deleted

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

Very very interesting problems, thanks!

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

Вау! Как много людей порешало столько же задач, сколько и Легендарный гроссмейстер!

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

Worst contest i have ever seen!..

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

How to solve B?

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

    let number of first character of "codeforces" n(1), second character n(2) ans so on. Then, just check for the combination of these n(i) with greedy method for which it reaches k at the lowest cost.

    Meaning, suppose for k = 4, firstly, the string is "codeforces" which is k = 1 and every n(i) is 1. then, check if it reaches k with 2 first characters, which is "ccodeforces". (combination is 2*1*1*1*1*1*1*1*1*1 = 2) If not, check again with 2 second characters, which is "ccoodeforces". (combination is 2*2*1*1*1*1*1*1*1*1 = 4) which reaches k and is the answer.

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

      Thanks. I don't understand what happens when k is odd, say k = 3. Are you saying that we check for all from 1*1*1*1*1*1*1*1*1*1 to something*something..?

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

        Yes, you can just increment the smallest value of the 10 (if multiple are smallest chose any of them) until they multiply together to be larger than the target.

        In theory you can optimise by finding the largest x where x^10 is less than the target and starting from there, but it's not needed.

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

How to solve F? I think the maximum of $$$R(n)$$$ is $$$\lfloor \frac{n}{2} \rfloor - 1$$$, am I right?

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

Do you think believing is worth more than proving? Don't do this in a speed-solving contests...

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

    I kind of see your point, and that wasn't the intent. Apart from E, do you think other problems suffered from this?

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

      Thanks for your comment. I was not particularly suffered from other problems than E because of the believe-vs-proof issue, but the overall experience wasn't good.

      I think B, D, and F have a similar kind of issue to some extent. For B and D the proof is rather easy (?) but the "targeted" contestants for them could have felt upset as I have for E.

      F is more approachable by experiments (and indeed I did), which is good. But I submitted without proving no better solution exists. Who proved it would have spent non-negligible amount of time, which could lead to a terrible performance for this round.

      The ideas for E and F themselves were pretty nice! (at least for Mathematical Olympiads)

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

        Thanks a lot for your feedback! I have a pet peeve for open-ended problems where the initial direction is not immediately clear. Still, too many of such problems is too frustrating, and they tend to get too "mathy". I'll try my best to balance things better next time.

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

        I think the proof for D is fairly easy and i was able to do it in a fair amount of time,and since i am the "targeted" contestant for it than i think i am the right person to speak for it.Same goes for B, B involves simple high school mathematics to prove.Sorry for my poor English.

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

      Even B and D many solved without proving.

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

I found the solution for E, but I can't implement in time —

solution for E : === infinite loop === node i = minimum of nodes There is no edge comming to node i.

(i's leaf) <= 2,

(i's leaf's leaf) <= 4

open i and i's leaf / close i's leaf's leaf // opened node / (opened + closed node) >= 3/7 : you always satisfies erase-ratio.

erase the i, i's leaf, i's leaf's leaf in the graph

Am I solved right?

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

    No, there are complications. For example, suppose you have i, i's leaf and i's leaf's leaf. Then say j is another parentless node, and say j's leaf's leaf is one of i's leaf.

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

I solve problem C with smallest k value... and after end of contest.. k doesn't need to be smallest. T^T

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

Arthur, please do not manage the ski resort anymore.

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

What so special about 4/7?

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

    i did some cases and it seems that if you greedy for low cases 4/7 should work because you break alternating connections (so if you find a path of length N break 2, 4, 6, etc) but it fails for larger cases like 28 for some reason or another (i drew 28 vertices and kept on mixing and matching but couldn't find the intuition to solve)

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

    If you remove the ends of all the paths of 2 greedily(starting from top to bottom). Then, if x spots are removed, there will y>=x/2 spots that were before these spots in the paths and z>=x/4 which were before the y spots. (x+y+z >= 7/4x => x <=4/7 n)

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

No one:

Literally no one:

Me: Scribbling problem C in-contest using online minesweeper

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

In E, does anyone have a counter for this?

$$$S$$$ = {$$$1,2,3,..N$$$}.

while $$$S$$$ isn't empty
Take smallest numbered node $$$v$$$ from $$$S$$$ with indegree 0, add nodes at distance 2 to the answer.
Delete $$$v$$$ and nodes at distance 1, 2 from $$$v$$$ from set $$$S$$$ and update indegrees.

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

Editorial for C :)

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

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

Least binary searchy interactive problem I've ever seen. Really enjoyed that one.

C and E were really nice too, and I don't have any complaints about the other problems. Great work on the contest overall.

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

RIP my rating.

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

My solution for C:

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

fucking piece of shit.

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

How to solve D?

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

Would someone solving same problems on Global Round get better rating change than solving it in a Div2 Round (assuming same problems and same submission time in both)?

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

Oh, after having so many fast editorials, it feels bad right now to not have the editorial yet :(

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

Problem F: used some time to find $$$R(n)$$$ in OEIS, but failed

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

Problem F was driving me nuts, but I have a method that I thought would work. Does this seem like I'm even on the right track?

Divide n into groups of size k. Then, in each iteration, you can turn on k lights: replace any that were eliminated by the opponent, plus 1 or more in the remaining groups. If you keep doing this with groups of size k, you eventually can fill all but (k-1) in every group (and the opponent can eliminate one full group). So, you could turn on (n/k-1)*(k-1) lights this way (and would want to find the k that maximized that).

But, trying to figure out how to adapt that to cases where (n%k)!=0 was giving me difficulty, and I'm not sure that this method is optimal, even then.

I know I should probably wait for the editorial, but I'd love to know if this was close to the right idea...

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

    I used a similar idea.

    I divided the lamps in groups of size k with 1 lamp between them. The last group could be smaller. K is found by bruteforce.

    Then on each move I turn on all the lamps that should be turned on if there are >k such lamps. The opponent would turn off some of the lamps on their turn, then repeat.

    Example: N = 11, group size = 2

    XX_XX_XX_X_ (after my turn, +7 lamps on)
    _______X_X_ (opponent turns off 5 lamps)
    XX_XX_XX_X_ (I turn on 5 lamps)
    ______XX_X_ (opponent turns off 4 lamps)
    XX_XX_XX_X_ (I turn on 4 lamps)
    ____X_XX_X_ (opponent's move)
    XX_XX_XX_X_ (my move)
    ___XX_XX_X_ (opponent's move)
    I finish the game here
    
  • »
    »
    6 лет назад, скрыть # ^ |
    Rev. 3  
    Проголосовать: нравится +7 Проголосовать: не нравится

    Note that $$$k=\sqrt n$$$ maximizes $$$(n/k-1)*(k-1)$$$. This is also optimal when $$$k\nmid n$$$, where you can just let the last group have size < k.

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

can somebody explain what's wrong in my approach for problem B?

my approach :- initialise an array cnt having value 1 for each of the 10 places. do prime factorization of k, then multiply the prime factors on cnt elements one by one.

for example, if we were asked to make a string for "hello" & k is 360, my cnt array will look like this [10,2,2,3,3] and answer will be hhhhhhhhhheellllloo

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

    Notice that the product of each character's frequency should be >= k.

    So for each character choose such frequency's such that they are equal or some of them have differences with others.

    Like this, $$$x, x, x,....x$$$ or $$$x, x, x,....x + 1, x + 1, x + 1$$$

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

    Well, I had trouble with it too, but anyways:

    First observation, if you multiply the frequencies of the letters, you get the number of subsequences. Here we are considering duplication of letters in adjacent positions. Ex: ccc ooo dddddd eeeeeee fff o r ccccc eeeee ssssss. So the number of subsequences over here = 3*3*6*7*3*1*1*5*5*6 = 170100.

    Now to start with, keep the frequency of each letter = 1 ie. the array f = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]. Also have an iterator i, which increments modulo n. So all you have to do now, is as you iterate, increment f[i] and see if the number of subsequences are more than the required number k. Refer to my code:- Submission

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

    Basically think of groups of letters: you want some number of "c", then some number of "o", etc.

    The number of combinations possible (i.e. the number of substrings possible) is the number of "c"s times the number of "o"s, etc.

    You can start out with one copy of each letter: "codeforces". Then, just keep increasing until the number of combinations is at least as large as the number you need: ccodeforces would allow 2 combinations. ccoodeforces would allow 4 ccooddeforces would allow 8 and so on. Eventually, you can get to 2^10 combinations possible: ccooddeeffoorrcceess at which point you need to go back and start using 3 of each letter, and so on: cccooddeeffoorrcceess cccoooddeeffoorrcceess etc.

    The key is to realize that you maximize combinations by "spreading out" the repeats: i.e. it is better to do ccoodeforces (4 substrings) than cccodeforces (3 substrings)

    I did this by keeping an array of length 10 that stored how many repetitions of each character would be needed, and just kept incrementing through, keeping the total number of combinations until it hit or exceeded the target number.

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

      once again, didn't read question carefully.

      I thought i have to make a string that contains exactly k codeforces subsequences. and thus did prime factorisation.

      feel stupid now...

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

        it happens. I also misread the problem as exactly k. Luckily I realized that if it were exactly k, then the size of the output is at least k chars for prime k (which is ridiculous for the limits)

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

    According to some mathematical theorem:
    if a*b*c=constant then to have a+b+c to be minimum the values of a,b,c must be very close to each other. So doing prime factorisation won't work, instead you find a number whose power is almost equal to k, copy this value 10 times, now modify values by adding 1 one by one, to get minimum answer ;-)

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

      It's an easy proof. Consider the difference to be $$$2k$$$, $$$k \gt 0$$$. Then $$$(x+k)*(x-k) \lt x^2$$$. If it is $$$2k + 1$$$, them $$$(x + k)*(x - k-1) \lt (x-1) *x$$$. Therefore the difference between any 2 values should be less than $$$2$$$

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

      Its actually Arithmetic Mean >= Geometric Mean i.e. p1 + p2 + p3 + .... + pn >= n x nth root of (p1 x p2 x p3 ... x pn). If we make all of them equal to p, only then LHS = RHS otherwise LHS > RHS.

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

    hello bad example because you have to LL in a row.

    For "codeforces" word you can just add one char on each positio and number of subseq will be product of number of chars

    Do it while your number < K

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

Nice Minecraft sword reference on C. And D is a very nice problem.

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

ff

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

It appears I tied the 30th place with chokudai. How does this work, do we both get a shirt?

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

B is more difficult than C

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

nice problems :)

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

Can someone hack my E? https://mirror.codeforces.com/contest/1368/submission/84232635

I tried random, TLE on case 12. Added 2 greedy orderings, if that fails random, then it's AC. Can someone help me proving this solution sucks? :P

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

Thought the tests were faulty, turns out they weren't now I am stuck with this comment which I can't delete, thanks codeforces.

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

I'm unable to submit my corrected F — I keep getting Unexpected Error. Am I the only one with this issue?

Edit: MikeMirzayanov, possible bug?

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

My solution for problem c is not checked. why? Submission is here: — https://mirror.codeforces.com/contest/1368/submission/84248862 @MikeMirzayanov

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

G was solved by 12 people, E was solved by 243 people. I solved ABCDFG and ended up behind ~40 people that solved ABCDEF (51st instead of 12th), I feel scammed :(

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

Good Problems! Here is my easy solution for C if anyone needs it. https://mirror.codeforces.com/contest/1368/submission/84251207. I have just formed an increasing staircase.

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

I can't submit now. Why?

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

How are the 20 t-shirts assigned? Is there a seed or something?

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

When will be the editorial out??

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

Need Some Help! My pretest are passed for Problem C but didn't checked for the main test. After the final standings submission verdicts Pretest Passed instead of Accepted or Wrong Answer if found on main tests. Endagorion MikeMirzayanov Problem — 1368C - Even Picture Submission — 84230794 Will system testing will happen again or is this a minor bug?

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

My submission for problem d was not checked although its correct why?? MikeMirzayanov

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

I'd like not to miss an opportunity to advertise a service for drawing cells which could be useful for debugging/verifying your solution to problem C

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

Can you help me with this solution of mine https://mirror.codeforces.com/contest/1368/submission/84243786

It is giving WA in testcase 14 But on running the same testcase on my machine or codechef IDE or Gfg IDE, I am getting the right answer.

MikeMirzayanov can you look into this please. Thanks

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

    You have a floating-point imprecision error with the logarithm calculation. The submission gets AC when I use long double instead of double for the intlog() function, and also for your count variable. You can check out this submission here 84269419.

    This is exactly what I changed in your code :

    long double intlog(long double base,long double x) {
        return (double)(log(x) / log(base));
    }
    

    and

    long double cnt = 2.0; 
    

    P.S. This is the code I submitted during the contest 84205432

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

Ugh, of course only after competition do I see the simple greedy solution to E

84267481

Just iterate through every spot in order For each spot a, if it is open and there exists an open spot that has a track to a, close all the spots that a has a track to.

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

    Is this "simply" less than $$$\frac47n$$$ though? It's not obvious to me where that bound should come from in this solution.

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

      Justification for being under 4/7 bound

      Take any spot. It can have a track to at most 2 other spots. Each of those spots can have a track to at most 2 other spot, meaning there are at most 4 spots 2 tracks away from a specific spot. If we close the 4 spots, we have closed 4/7 spots involved.

      The only issue would be if a spot was in the last group for one set of spots, and in the middle for another set. This is avoided by checking in the order of possible middle spots, so if it would be a final spot, it would be closed before we consider it

      EDIT: Another way of explaining it

      Everytime we close spots, we close up to 2. To close those 2 spot, we need 2 open spots, a, and one that has a track to a. The one that has a track to a can only have a track to 2 spots, so it can only contribute to the closing of 4 spots. Thus, we always need at least 3 open spots to close 4 spots, so we never surpass the limit ( a would never be used again to close anything as everything it has a track to is now closed)

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

        I think there's an even easier way to justify a bound of $$$\frac 1 2$$$. Say we have node $$$a$$$ which has a parent $$$a'$$$ and children. It has at most 2 children, so we close at most 2 spots. We can also guarantee that $$$a, a'$$$ will NOT be closed therefore we close at most $$$\frac 1 2$$$ of the nodes. We have this guarantee since we only close nodes that are children of other nodes, and since $$$a$$$ wasn't closed before we got to it, it can't be closed in the future since that would need a node $$$i \gt a$$$ where $$$a$$$ is it's child which is impossible. Similar logic for $$$a'$$$ remaining open.

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

          That does not quite work, because a' can also have 2 children. say you had these tracks

          1 -> 2

          1 -> 3

          2 -> 4

          2 -> 5

          3 -> 6

          3 -> 7

          Looking at 1, we don't close anything

          Looking at 2, 1 has a track to it and is open, so we close 4 and 5

          Looking at 3, 1 has a track to it and is open, so we close 6 and 7

          Spots 4-7 are already closed, so we skip them

          Since we used spot 1 as a' twice, we ended up closing 4/7 spots, so the bound is not 1/2

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

      the worst case would be a perfect binary tree without any overlaps.

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

my screencast, finally not messing things up: https://www.youtube.com/watch?v=w8hClqVhDOU

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

what will be the rating of E??

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

So curious to see the Editorial....i don't know why is it taking so long?

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

Some post contest analysis for problem D (observations / pseudo-proof) :

  • For any two numbers in the sequence, if you calculate their AND and OR values, you'll see that the sum of squares of the AND and OR values is always higher than or equal to that of the two numbers.
  • As an example, let's take two numbers: 6 (110) and 5 (101). The OR gives 7 (111), the AND gives 4 (100).
  • Observe how this operation simply took the last 1 from the 5 and gave it to the 6 (hence 6 becomes 7), while leaving the first 1 in the 5 untouched (hence 5 became 4)
  • So every exchange just transfers the missing bits from the smaller number to the larger number, leaving the common bits intact with the smaller number
  • To maximize results, you want to get the largest possible numbers using the count of bits at each position. Count the number of bits at each position and start assigning them one by one. This way the largest number will have every available bit set, the second largest would have every available bit set from the remaining bits, etc.
  • Now just add up the squares of all elements
»
6 лет назад, скрыть # |
 
Проголосовать: нравится -11 Проголосовать: не нравится

Please tell a hack case

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

Man, at first for B I thought it said that the number of subsequences has to be equal to $$$k$$$. Does anybody know how to solve that version of the problem, i.e. writing $$$k$$$ as a product of ten integers and trying to minimize their sum?

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

    Should this work?

    Do prime factorisation of $$$k$$$ and then multiply the smallest two prime factors until there are less than or equal to 10 elements left in the array

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

    we will not be able to print the answer for very large primes in that case right ?

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

    At first i also had the same thought and i thought for this solution. Guide me if i am wrong somewhere. this solution is for k<=10^6. I created a vector of 10 int elements and assigned 1 to them(let's call the vector 'cnt'). I stored all the prime numbers less than 10^6 in another array say 'primes'. Then, i traversed this prime array and for each prime i calculated what is the maximum power of that prime that divides k (let's say p^m divides k) then i will just multiply next m elements of my cnt vector with p cyclically. After this i am just printing each character of "codeforces" same no. of times the value stored in cnt vector ex- if the cnt={6,2,3,3,3,3,3,3,3,3} then i will print"ccccccoodddeeefffooorrrccceeesss".

    This is my code for the main algorithm (t is the prime array): int x=0; for(int i=0;i<t.size()&& t[i]<=k;i++) { int c=0; long long power=t[i]; while(k%power==0) { c++; power*=t[i]; } while(c>0) { cnt[x]*=t[i]; if(x==9) x=0; else x++; c--; } }

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

My friends: how to solve problem C?

Me, an intellectual:

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

What if in Problem C we have to print the smallest k satisfying the conditions? Any Ideas

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

When will the editorial be released?

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

For those looking for solutions to A-E, I explain how I did them at the end of my screencast of the round.

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

how to solve D if we Have to minimize the sum of square

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

Event i can't solve problem B. This round is in another level:(

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

Why does my code for problem E give TLE? Any help would be appreciated. Link:-https://mirror.codeforces.com/contest/1368/submission/84298529

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

Peace

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

Hi! Thanks for your participation. I'm glad to announce the winners of the t-shirts! They are:

List place Contest Rank Name
1 1368 1 ecnerwala
2 1368 2 tourist
3 1368 3 Marcin_smu
4 1368 4 Petr
5 1368 5 Radewoosh
6 1368 6 Um_nik
7 1368 7 maroonrk
8 1368 8 eatmore
9 1368 9 snuke
10 1368 10 KAN
11 1368 11 hank55663
12 1368 12 neal
13 1368 13 Egor
14 1368 14 frodakcin
15 1368 15 xiaowuc1
16 1368 16 TLEwpdus
17 1368 17 orz
18 1368 18 79brue
19 1368 19 uwi
20 1368 20 Noam527
21 1368 21 244mhq
22 1368 22 natsugiri
23 1368 23 Errichto
24 1368 24 jhnan917
25 1368 25 Benq
26 1368 26 LayCurse
27 1368 27 zeliboba
28 1368 28 Yongaron
29 1368 28 _h_
30 1368 30 chokudai
78 1368 78 loup
85 1368 85 Aeon
111 1368 111 keymoon
149 1368 149 sqrtdecompton
153 1368 153 aropan
160 1368 160 cstuart
170 1368 170 hitonanode
181 1368 181 AngrySeal
207 1368 207 tribute_to_Ukraine_2022
210 1368 210 KayacanV
272 1368 272 Hakiobo
292 1368 292 _Samir
340 1368 340 alexwice
342 1368 341 zscoder
370 1368 370 amnesiac_dusk
408 1368 408 sansen
436 1368 435 sniffleheim
447 1368 447 demoralizer
469 1368 469 ouuan
496 1368 496 minato
»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Why is rating of the questions of last 2 contests not added?

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

Is it valid testcase for problem E ? If NO, then why ? 1 3 4 1 4 2 3 3 4 4 5