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

Hi Codeforces,

I'm excited to announce the Canada Cup, the first Codeforces contest to be sponsored by Diagram!

This is a rated Codeforces round (with T-shirts!) for both divisions which will take place on October 22 at 11:00am EDT.

Although the contest is organized in Canada, all competitors worldwide will be able to compete and win prizes.

The problems for this round were written me (zxqfl) and the Codeforces team. I'd like to thank:

  • My coauthors for contributing great problems to the round
  • GlebsHP for his help in preparation
  • MikeMirzayanov for creating Codeforces and Polygon
  • Tatiana_S for translation into Russian

I'd also like to thank Diagram for sponsoring the round. Diagram is interested in hiring software engineers, so please take a look at the information at the end of this post if you're interested. For anyone outside of Canada, they'd like me to let you know that Canada has friendly immigration policies for software engineers.

Both divisions will compete in the same contest, which will consist of 7 problems of the same difficulty level as a regular Codeforces round. The contest will last for 2.5 hours.

The score distribution will, of course, be announced later.

Here is some information from the round sponsor:

Prizes

  • The top 100 competitors will get a Diagram T-shirt.
  • Local winners (Montreal): Dinner with Francois Lafortune (CEO, Diagram), founders of Dialogue, and other Montreal technologists
  • Local winners (Toronto): Dinner with Karel Vuong (Director, Diagram), founders of Collage, and other Toronto technologists

About Diagram

Diagram is a venture launchpad building the next generation of Canadian-based global technology companies. By assembling teams of world-class founders pursuing big ideas for innovation in the financial and insurance industries, and surrounding them with capital, expertise, and infrastructure, they are betting big on their companies and equipping them with everything they need to innovate and build a better future.

Diagram’s investment portfolio includes the companies featured below and they all work with teams that leverage modern frameworks, cutting edge technology, and complex algorithms to deliver wellness and prosperity to all.

Diagram's Investment Portfolio

Collage is re-inventing the way Canadian businesses manage HR, payroll, and benefits. By offering a 100% free and comprehensive platform, Collage automates paper-based and manual business processes and HR administration in ways that are efficient and secure at scale, enabling companies to spend their time on the more meaningful aspects of business.

Dialogue is the best part of your company's health plan. By offering a range of healthcare services for your team, Dialogue helps to keep them happy, healthy, and performing at their highest potential. Dialogue is using machine learning, natural language processing, and AI to process text conversations, video interactions, and imagery sent from patients to their chatbot in real-time to provide accurate diagnoses of physical and mental health concerns.

Applying to Diagram

For those interested in an opportunity with Diagram or any our portfolio companies, please apply here.

UPD Scoring distribution is 500 — 1000 — 1500 — 2250 — 2500 — 3250 — 3500.

UPD The contest is over! Congratulations to the top 5:

  1. eatmore
  2. paulwang
  3. zemen
  4. mnbvmar
  5. riadwaw

If you won a prize, you'll be contacted soon.

UPD Editorial: http://codeforces.me/blog/entry/47974

Анонс Canada Cup 2016
  • Проголосовать: нравится
  • +313
  • Проголосовать: не нравится

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

"The top 100 competitors will get a Diagram T-shirt."

Top 100 competitors in each division?

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

Does Diagram or your companies offer any internship opportunities for undergraduate students? If yes, how can I apply for it?

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

Is it rated?

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

It is clashing with the online qualifying round for ACM-ICPC Regionals of all sites in India. Most of the Indian programmers will miss this. :/

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

By the way, where is the announcement for Codeforces Round #377 ? It starts in a few hours...

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

Edit: Duplicate.

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

there is a tutorial for this contest ,right ?

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

Is there any separate registration for people residing in Canada ?

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

А условия будут только на английском?

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

What's happened with CF? Cannot access some pages including "Main"

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

The brand of this company is great.So I guess the T-shirt is great too.Hope my top 100 rank! To be a beautiful T-shirt's girl!

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

Too bad it conflicts with IEEE contest which happens on Saturday for 24 hours duration.

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

How many people are qualified as being "local winners"? Is it just the number 1? Btw, you're the best Jacob

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

Clashing with ACM ICPC India Regionals :(

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

...

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

T Think There was Register option for this contest. But not now.

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

hope to see good statements and new problems away of hacking :D

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

Has anyone noticed that the contest starts at 11am EDT instead of 11.05am EDT?

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

I just had some beer and feel a littie drunk, but I really don't want to miss this round, good luck to me.
Does Anyone have this experience ?

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

I don't need a T-shirt ,, i need +200 and i'll be more happy ,thanks

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

I love combined rounds!

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

i am being unable to register in the round..!! :/ anyone else facing the issue??!!

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

Where is the contest registration link? Is it the application to Diagram?

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

unfortunately, the contest will be delayed for 5 minutes :p

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

Score distribution?

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

Why there is no rng_58 in the leaderboard? :)

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

Number C : Poor statement. can't understand a single line.

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

My submission for C is running forever on test 2, where submissions made after my submissions are already judged. If I resubmit, I would lose points. Could you please look into it?

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

Really nice contest and problems!

Thanks, author(s)!

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

solution for problem E please
My brain is burning

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

Is greedy correct for problem D?

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

how to solve D?

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

I really like D. Why don't you make B's input simpler by having a space?

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

.

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

Well, this time I would get D if there were 2 seconds more...

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

How to solve C?

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

spent too much time on C and didn't have enough time for D, didn't find an easy wa to handle the tie cases.

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

I think the statement for problem G was ambiguous : what to do when a node receive messages from its parent and one of its children at the same time ? I had WA on test 4 even with the slow code I was using to test the fast code...

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

    There is the statement about this situation in the problem:

    "If some copy of Alice receives messages from children nodes and also receives the answer she is waiting for at the same instant, then Alice first processes the answer, then immediately continue as normal with the incoming messages."

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

Sadness is when you pass E but failed C and D T_T

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

Image

Solve E and gain 1090 points. I love this game but not rating! :)

And hello Div.2. :)

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

sad... Failed System Test on B&C

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

Can someone explain the solution for C ? Thanks.

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

    It's only impossible if there are two of the same letters next to each other. Also it's easily understandable that there will be exactly one letter that appears twice in the input string, since each letter must appear at least once and there's only one extra letter.

    Let's say that this was the letter 'A'. Then the string looks like this:

    s1 + "A" + s2 + "A" + s3

    I got AC by constructing the matrix like this:

    3333333A222

    111111111222

    It's always possible to get the input string by starting at the left start of the 1s, going right, taking 'A', getting the 2s by going right then down then left then back to 'A', then going left (and maybe down and right) to take all 3s.

    Of course, s1 and s3 are of varied length and can even be empty, but then simply make the one that's too long "spill" into the row above or below. Also you have to be careful to write the string s1 in reverse order.

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

    look at this comment

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

How did my solution for E pass system tests =)))))) I'm pretty sure it would get TLE tho xD

this one

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

No upsolving or something wrong with me? :)

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

:)

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

Why we can't submit for practice ?

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

Is it just me or no one can see others' solutions? :/

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

worst problems ever no idea just code

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

:(

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

Is F a greedy? I cannot submit now,plz someone who got F accepted tell me,thank you!

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

    (I didn't AC it)

    I think it is: always take the photo with the biggest sum of A and B. But the tricky part is to, at each point in time, check if it's possible that both players want to pass their turns, ending the game early. I'm pretty sure I've got the DP for this down, but I couldn't complete it during contest.

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

    Yep. It can be done greedily if you regard the value of a card as a+b since the scores that the two players get are a,0 and 0,b in both cases, where the difference would be a and -b respectively. So you can set this value for each card and greedily select the pictures.

    Of course you still have to handle some other cases :)

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

      Hey, could you please explain they way you derived this strategy ?

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

      Thank you,I've got F passed.From my point of view,the game is a little bit like the go chess,because both sides need to correctly calculate every step's value and choose the most valuable one.

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

        Hey, could you explain the idea of your solution?

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

          consider a quadruple x,y,xx,yy mentioned in the description,there are three condition: 1.x<=yy&&y<=xx. In this contion,the one who goes first suffers losses.So no one goes first,and this condition makes no sense. 2.doesn't satisfy the 1st contion,but satisfy x+y<xx+yy.In this condition,one will definitely get profits(as x>yy or y>xx),but he will get more profits only if he goes second,but the opponent will just let it be .And if the one who is to get profits want to "cash his check",he has to offer to go first.As is explained above, ans+=x-yy(or xx-y). 3.other conditions. We can assume the value as x+y(if the first is done,xx+yy),and apply a greedy strategy that obviously choosing the most valuable one from all the 3rd contions(if this one is the first then add the second into the priority_queue)one by one,using a priority_queue. Sorry for my poor English and wish you can get AC.

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

almost got jcvb

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

when I will be able to submit my solution for problem C. When problems will be added to problemset

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

Why did my submissions get ignored!? I'm 100% sure that I have written ALL of the code MYSELF. What's wrong!?

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

why cant i practice now

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

cute problems :)

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

Why so delay ? Why we can't submit the solution till now ? When the problems will be added to problemset ? Why till now, we can't see other's code ? Is there any reason for this ?

Update: Now it's ok :)

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

http://codeforces.me/contest/725/submission/21684455 what is 7th testcase,why its showing wrong answer for 7th testcase please help

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

please .. why all my submissions skipped after the contests ?? .. during the contest I changed my laptob and IP is that relative ?

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

wrote 26 instead of 27 in problem C, dropped ~350 rank

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

Rating is calculated separately for divisions?

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

WA: for (int i = 0; i < 12; i++) AC: for (int i = 0; i < 13; i++) Lesson well learnt. :''D

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

I don't understand problem A, can someone tell me, how this statement make sense?

"In the second sample, any starting position will result in the ball falling from the field."

I'm still under the impression that is a typo, where it should say, any starting position will not result in the ball falling from the field.

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

can D be solved using Segment tree ?

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

Are editorials coming ?

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

Moose!

It's like Canadian cattle eh?

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

Pretests of B cover all cases except for where n = 4k + 3, leaving opportunities for hacking and necessity for system test, while maintaining a reasonbly strong testset. +1 for this setting (๑•̀ㅂ•́)و✧

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

I forgot to write "+1" in my D submission so I got a WA. I won't forgive myself...

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

I am thinking of solving problem G in this way, but I am not sure if this is correct.

  1. Build the heavy-light decomposition chains. O(N)

  2. Sort query by increasing pair(time+depth[initiator], initiator_id). O(MlogM)

  3. Upon query, ask the expected time that you will reach Bob, use the segment trees to binary search for the position you will get answer from. Each takes O((logN)^3)

  4. Update the segment trees, set the value of each node on the path to (time of response + depth[Node]), which is a geometric sequence(*Edit: arithematic sequence). Each takes O((logN)^2)?

I have heard that it is possible to use lazy propagation and keeping other values to maintain geotric sequences in a segment tree but I have never implemented it... Any thoughts?

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

Problem E:

100

1

5

What is the answer?

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

Problem D:

9
4 70
32 56
32 65
77 78
5 29
72 100
0 55
42 52
66 72

Can anyone explain this to me,why this test is 7 but we can give 77 78 2 balloons right? So it should be 6. Thank you!

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

    Final rankings:

    1, 72 100

    2, 66 72

    3, 42 52

    4, 32 56

    4, 32 65 (UPD: Dang it formatting)

    6, 5 29

    7, (4-2) 70

    8, 0 55

    I think you misunderstood the statement and ranked 6~8 incorrectly, note that "It means that one's place is equal to the number of teams with more balloons, increased by 1."

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

When will the problems be available for practice?

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

Will the editorials be published?

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

This is the first time I win a prize on Codeforces, so I want to ask people here a few things. How long after the contest will the sponsor contact me? And how long does it usually take until I can receive my prize?

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

When will be editorial???

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

Editorial please.

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

How is this possible that points drain was not adjusted? This is by far not the first contest coordinated by GlebsHP with longer duration and few of them already had adjusted drain. Not adjusted drain is complete cancer, adjusting drain should have already became a habit without any exceptions.

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

Did anyone receive the T-shirt? As the last line of the blog mentioned, I have been contacted (multiple times) but the T-shirt has still not arrived. :(