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

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

Hello, Codeforces! On 6th October at 19:30 MSK the Codeforces Round 271 (Div. 2) will take place. Div1 participants can take part out of competition, as usual.

I am Ciprian Olariu (scipianus) from Romania and this is my first round on Codeforces. It is more special as it is held right after I became red on Codeforces. I would like to thank Maxim Akhmedov (Zlobober) and Gerald Agapov (Gerald) for helping me to prepare this round, Delinur for translating the statements and also MikeMirzayanov for Codeforces and Polygon platform.

In this round the main characters will be Mole and Marmot, two good friends, and you will help them in their activites.

Please note that this round will have an experimental duration of 2.5 hours and 6 problems. The scoring will be 500-1000-1500-2000-3000-3000.

I hope you will enjoy the round. Good luck and have fun :)

UPD : To avoid overlapping Topcoder SRM #635 and Bayan 2015 Contest Warm Up, we decided to move round to Monday 19:30 MSK

UPD 2 : The editorial was published here

UPD 3 : Round has finished. Thanks for participating. Congratulations to the winners:

stonebuddha

Syloviaely

vanhanh.pham

__PLEASEDONTHACKME__

LOVESY**

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

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

6 problems? why not add one problem to take place the DIV1? :(

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

Crosses with SRM 635: TopCoder schedule

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

OMG, doesn't Bayan Contest Warm Up round overlap with this?..

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

Те, кто уже зарегистрировались должны будут повторять регистрацию, или нет?

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

I think the time should be changed because at the same day there would be a Bayan contest and it would be held 2.5 before your contest while it's duration is 3 hours. Edit:oh adamant was faster than me.

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

And now, the age of 2.5 hours contests...

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

Now the date and time should be fine. Sorry for inconvenience.

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

The contest ID is lucky "474" :D

The contest will be great, hope that!

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

why without div1

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

I always attended contests like "Happy New Year Contest" , "April Fool Contest" etc etc . But never attended an "Eid Contest" ;) (Luckily today is Eid Festival here in Bangladesh :) )

So , Eid Mubarak to all Programmers :) :)

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

Oct. 4 — SRM 635
Oct. 5 — Bayan Warmup
Oct. 6 — CF Round 271.. div2

Nice three days :)

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

Good luck!! I think everyone will enjoy this contest.

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

It's Eid contest for some contestants :D.Today is Eid(Eid-ul-Azha is the 2nd largest festival of Muslim community) here in Bangladesh including some other parts in the world. And some other countries were observing Eid in last 2/3 days. Happy Eid Mubarak to you all :).

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

Did anybody receive any emails? 4 Hours to contest and no email for me yet... . Or maybe because I'm div 1? (sry, first unofficial round :D) Luckily I found out through one of my friends.

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

2.5 hours seems a challenge, hope my battery is enough

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

All eyes again on worse ...

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

Denial of judgement??

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

My problem A is now like this I don't know is it hacked.

00:03:08 Pretests passed [pretests] → 8107570 However,The hack says 117673 2014-10-06 20:26:22 SINUS waltz7l9 A — Keyboard N/A Ignored What does this means?

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

Why isn't possible to hack using generator file?

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

00:03:08 A Denial of judgement [hacks] Hey ! my points!

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

In C problem, can any 4 moles make a regiment or 4 consecutive moles make a regiment? Please clarify ASAP..

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

Problem E is very interesting, I like it. hope to learn easier solution

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

Can binary search pass the time limits for problem B?

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

How do you do D?

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

    Let's f[n] be the number of good sequences with length n. Formula is f[n] = f[n-1] + f[n-k]. Then if g[n] = f[1]+f[2]+...f[n]. Answer to a, b is g[b]-g[a-1].

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

    If I am correct than we have a recurrence relation:

    for n and k, where n is the maximum of all (a[i], b[i]) (to be safe n can be set to 100000, the maximum length of sequence) and k is the number of 'W's consecutively.

    T(n)=T(n-1)+T(n-k)

    base case T(0)=1, T(1)=1 and for all (n-k<0) T(n-k)=0

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

      Would you clarify/prove why the relation is actually correct?

      It is clear that the first summand in the recurrence corresponds to combinations when 'R' letter is added to combinations derived from T(n-1) step. By it seems that there are more than one way to do it, no?

      The question is the same for the second summand.

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

        Think of this problem as the coin change problem. You've got 1 coin of value 1 and 1 coin of value K. What is the number of ways of putting this coins in a row such that their sum is equal to N?

        I hate dynamic programming. However much I try to understand the concept, I always fail at it.

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

What is the 4th pretest in problem E?

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

What is pretest 3 on D?

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

Can anyone tell me the correct process to hack by generated input. I tried it in two contests. It shows invalid input with this message — "FAIL Expected EOLN (stdin) [validator A_valid.exe returns exit code 3]"

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

Tried hacking at the last minute, but I got an 'Invalid Input' error, even though I'm pretty sure that the input format was correct. Do trailing spaces at the end of a line cause that?

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

Any other solution of E aside the segtree?

UPD : sorry i mean E but i wrote D

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

Задача Е, претест 4, ВА. Как бороться, что я упустил? Много падений на нем было

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

what is the solution of E?

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

Problem E was in Andrew Stankevich Contest 29 Task B : Financial Software

the two problems are almost the same :D

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

I implemented everything except for E (even though I have an idea with Normalizing coordinates + DP + 2 Fenwick trees), and I'm very curious about a not so messy solution for E (maybe some greedy may work, not sure though). Anyway thumbs up for the round, scipianus.

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

How I can solve problem C?

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

[submission:8118906][submission:8118827] My two submissions for D. I used the recurrence dp[i], if (i-1>=0) dp[i]+= dp[i-1] dp[i]%=MOD if (i-k>=0) dp[i]+= dp[i-k] dp[i]%MOD

and then summed from a to b using another array. Why is my solution failing ?. Pretest 3 precisely.

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

Its My first time i Cleared D & E pretest.. Even though its Midsems here i couldnt resist this contest.. Hats of to the problem setter for making this contest so much fun..

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

I thought that I ignore a content when I read a statement, but... Today's blindness and worms eating were not nice. Really :)

What about making more positive problems next time? (Rethorical question)

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

One of the best Codeforces contests I have ever competed in! The problems were awesome! Kudos to the setters :D

»
12 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится
main(){
    int i,d=10000-3;
    cout<<d;
    cout<<endl;
    for(i=1;i<=d;i++){
        if(i!=d)    cout<<1<<" ";
    }
    cout<<endl;
    cout<<d<<endl;
    for(i=1;i<=d;i++){
        if(i!=d)    cout<<d-2<<" ";
    }
    cout<<endl;
}
This is correct hack or invalid input? Problem B
»
12 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Weak pretests for B = Happy happy me :)

»
12 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится
int a[100000];
      .
      .
      .
      .
    for(i=1;i<=n;i++){
        cin>>a[i];

При n<=100000. КАК ЖЕ У МЕНЯ БОМБИТ

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

problem D is easy problem!!!

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

Как по мне, задача F легче C

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

Mb such contests will reduce rating dispersion (more problems => rating estimation is better). But it will be harder to prepare good round.

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

Great round, I enjoyed the problems a lot.

(maybe I say this because I solved a lot :P)

Edit: reached div1 :D

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

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

Tourist scored more than 10k points in this contest. Is this the first time this has happened?

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

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

How does tourist solve all problems in 30mins of which he does the first one in a minute?

How can he manage that much reading, typing speed.

Does he do screencasts like Petr? I'd love to see a screencast of him competing.

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

Задача E. Интересно, я один думал, что последовательность должна начинаться в 1?

Я всегда буду внимательно читать условие, особенно после WA.
Я всегда буду внимательно читать условие, особенно после WA.
Я всегда буду внимательно читать условие, особенно после WA.
Я всегда буду внимательно читать условие, особенно после WA.
Я всегда буду внимательно читать условие, особенно после WA.
Я всегда буду внимательно читать условие, особенно после WA.
Я всегда буду внимательно читать условие, особенно после WA.

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

I think this solution should not pass. Maybe the test cases were weak.

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

I think 2.5 hours long contest with 6 problems is more enjoyable than 2 hours long contest with 5 problems. Looking forward to participating in more rounds in this format.

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

I hadn't had integer overflow bug for like a year, but now it just came back from E! (I assumed h <= 1E9). Thanks for warning me to be always careful.

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

Problem B: 8122368

Time Comlexity: O(mlog(n)).

Why TLE?

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

Can anyone look into my solution it is giving TLE but i am not able to understand why ??
http://mirror.codeforces.com/contest/474/submission/8123046

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

I saw successful hacks with test containing char 'q'. Is it valid? I think no.

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

EID MUBARAK All the problem solver :)