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

Автор Alexdat2000, 6 лет назад, По-русски

Сoronavirus work, coronavirus school, coronavirus rest, coronavirus time spending, coronavirus contest.

Привет, Codeforces!

Во 26.05.2020 17:35 (Московское время) пройдёт Codeforces Round 645 (Div. 2). Он будет рейтинговым для всех участников, чей рейтинг ниже 2100. Вам будет предложено 6 задач и 2 часа на их решение.

Задачи были придуманы и подготовлены Алексеем Alexdat2000 Дацковским, Илианом crazyilian Андриановым, Всеволодом sevlll777 Лепешовым. Мы постарались сделать интересные задачи, красивые условия и сильные тесты. Надеемся, что вам понравятся задачи и ваш рейтинг станет выше!

Мы выражаем благодарность:

UPD 1: Разбалловка: 500 — 750 — 1500 — 1500 — 2000 — 2500

UPD 2: разбор

UPD 3: Поздравляем победителей раунда!

Топ 5 официальных участников:

Место Участник Задач решено =
1 Ariadne.w. 6 6910
2 HackerMonk 6 6752
3 Potassium 5 5543
4 qwertz73355a 5 5478
5 SorahISA 5 5446

Топ 5 всех участников:

Место Участник Задач решено =
1 Egor 6 7821
2 kort0n 6 7495
3 Golovanov399 6 7365
4 nuip 6 7346
5 Geothermal 6 7332

Участники, пославшие первое правильное решение по задачам:

Задача Участник Штраф
A Geothermal 0:00
B IgorI 0:02
C KostasKostil 0:04
D neal 0:11
E Geothermal 0:27
F chemthan 0:40

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

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

"coronavirus contest"
I won't risk taking part in it.

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

I hope this would be a very good contest for everyone.

enjoy coders...

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

This is what we all love to have — "beautiful statements and strong tests".

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

I'll keep social distance between me and good results.

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

It's a Сoronavirus contest! Amazing! hope problem-set will be related to it!

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

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

As a tester, I can confirm that this contest requires programming and/or problem-solving skills. The problem statements may or may not be short, just as the pretests are possibly strong.

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

P R O B L E M — — — S T A T E M E N T S — — — W I L L — — — F O L L O W — — — S O C I A L — D I S T A N C I N G — — — N O R M S.

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

The time shown in calendar differs.

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

The funny thing is that when you go to Codeforces, whose logo says Make Codeforces, not Coronaforces, the first thing you see is that announcement

I hope that there will not be any new disputes on this topic

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

как тестер, я могу заявить, что авторам <= 16 лет.

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

Сoronavirus work, coronavirus school, coronavirus rest, coronavirus time spending, coronavirus contest.

I really hope this does not mean the problems will be themed on the coronavirus.

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

      Ah. What an absolute shame. I really thought Codeforces would have the decency to not use a virus responsible for killing hundreds of thousands of people to simply make the statements more amusing. Also, some people retreat to websites like CF to not think about the ongoing situation and reduce anxiety; sadly, this act completely defeats that purpose.

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

        Yeah, they should maintain absolute distance from it. But who knows may be the problem statements will be anti-corona.

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

        I hope problems will be related to fighting coronavirus.

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

        Your concern for the fresh wounds of the world is commendable, but all the same, different people having different coping methods. For some, breaking the taboo by incorporating it in humor and mundane activities in daily life is a way of normalizing the scope of the tragedy! Given the huge volume of jokes and memes spreading on corona, I think not that the humanity's response has been to shy away from involving corona in different aspects of life. For those who, rightfully, are sensitive to the topic, they have been notified and can skip the contest or solve some virtual in the meantime. As for fighting corona, if we take it seriously in our real life measures, I don't see the harm in using it as a theme in the virtual world. All my respect to those who have lost loved ones.

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

          good words

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

          While your argument isn't completely untrue, I highly suspect that this is a result of the lack of creativity of the authors rather than a motive of "breaking the taboo". To compare this with memes about the subject is borderline absurd. My argument is why must problems be themed on issues which have the potential to hurt the sentiments of a significant amount of people? Why must they skip taking this contest due to the lack of originality and thoughtfulness of the authors? While we are at it, why don't we "normalize" other tragedies such as the forest fire in Australia or even the 9/11? What's stopping us from creating problems about terminal illnesses such as cancer? In the end, problem statements are supposed to enhance the contest through light humor not become a reason for people to decide not to participate in a round beforehand.

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

            Which tragedies are normalized and which ones aren't is a complex question beyond the reach of this discussion. I've heard though plenty of jokes about terror groups, and lots of WW2 games glorifying the traumatic event are frequently released.

            That being said, society will often make a clear distinction between acceptable and unacceptable. If (I doubt) there is an uproar over the covid problems (we still don't know what they will be like) we will inevitably see it in due time..

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

I'll wear my mask during the round. Gotta play it safe

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

I'll sanitize my laptop before attempting this contest.

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

I request you guys to take it as JOKE

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

Can you please clarify the exact timing ? It differs from that of the announcement and the contest page !!! @Alexdat2000

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

300iq always makes so interesting contests :D

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

I don't want beautiful statements, I want short statements.

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

your your rating increase in English version, Alexdat2000

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

I'm tester of this round. I like problems very much and i strongly recommend everybody to take part in this contest

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

I hope I can get a big positive $$$\Delta$$$, good luck to everyone!

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

Alternatives to names Alexdat2000

Coronavirus and Programming, Coronavirus and Sanitization , Coronavirus and Social Distancing , Coronavirus and Quarantine , Coronavirus and Prediction, Coronavirus and Symptoms.

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

After the contest everyone should be quarantined for 14 days. :p

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

Deleted

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

i don't want to end up in lockdown

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

Stay home and Code because Codeforces will never let you go away from coding. These days are really helpful for many developers like me who now has interest in coding. Thank you MikeMirzayanov.

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

i hope to find nice problems and nice ideas

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

Давайте сделаем специальный контест под названием "Coronavirus Contest", будет рейтинговым либо для всех, либо для зараженных коронавирусом (надеюсь таких на Codeforces нет)

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

That illustration looks like it's from a Rick & Morty episode. "Covid Riiiick!"

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

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

Nice score distribution:)

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

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

What about social distancing???

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

.

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

Corona Virus Contest! Expecting Bats in problem statements!!

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

Hope "Accepted" wouldn't make social-distancing from "Pretests Passed" :)

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

Would be wearing a mask inside my home for the first time, thanks to Codeforces :)

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

I bet there gonna be a bit masking problem!

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

The problem setters of this round are hosting their first round on Codeforces.Best of luck to them!

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

Deleted

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

I'm in!

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

By the way Image of corona Virus in post can be like original corona virus with pricking peaks and magenta colour. for real feel.

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

Nice flop. I pretty much knew the meme was gonna flop but still went with it.

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

Is it r̶a̶t̶e̶d̶ sanitized?

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

Коронавирус, кет кет кет Коронавирус, нет нет нет

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

Make sure everyone sanitize their code before compiling.

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

Prevent corona-unrate virus through queue-distancing.

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

Scoring of C and D are same. Let's See #ofsubmission(c)?#ofsubmission(D) (? = </>).

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

Coronavirus contest should include bit-mask problems

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

bulmanupje? kut!!

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

As you got used to it, upsolving is on us 5 mins after the round ends:

https://youtu.be/KfiUrDLad4Q

On Algopedia. Bring your masks!

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

Изменится ли рейтинг, если я зарегистрировался на контест, но не смогу принять в нем участие?

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

It is strictly recommended to hate 300iq

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

I'm hoping vaccine for corona virus is found by scientists in problem statements

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

is the new rating system starting from this contest?

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

I like it

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

How do you prepare yourself 30 minutes before the contest?

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

Expecting a question to maximize social distance between all people on a grid.

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

Nice problems, thanks for your effort, but in my opinion the gap between problems were just too much(they were growing harder so fast), you could have added two problems to make it a nice div1 contest.(i know its not as easy as it seems to be)

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

I came here after solving D (in between contest).

The problems are nice, the statements are ugly.

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

C and D do not deserve same points. Change my mind :|

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

1st half hour solved A,B and rest of time just thinking about solution C and D.but fail to find any way to reduce time complexity.This called life of pupil :( sad life :(

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

C was certainly not worth 1500.

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

Looks like more of a Maths Contest than a Coding Contest, special credits to "C".

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

pls check for problem B I have checked my code's sample output on 3 different compilers but when I submit it is giving wrong on pretest 1. If anybody can tell why this is happening I will be very grateful.

void solve()
{
    ll n;   cin>>n;
    ll a[n];    loop(i,0,n)     cin>>a[i];
    set<ll> S;
    unordered_map<ll,ll> M;
    loop(i,0,n)
    {
        S.insert(a[i]);
        M[a[i]]++;
    }
    ll cnt=0,cur,nany=0;
    for(ll x : S)
    {
        nany+=M[x];
        if(cur+M[x]>=x)
        {
            cnt+=nany;
            nany=0;
        }
        cur+=M[x];
    }
    cout<<cnt+1<<nl;
}

int main() {
	fast_io;
	
	test{
	    solve();
	}
	return 0;
}

THANK YOU

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

Nice problemset. Thanks!

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

1358B - Maria Breaks the Self-isolation Now I see what the point of grannies near to my house is

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

Loves the problemsets, but apparently statements are too long. Would have been nice if statements were a bit shorter

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

Me after solving C

Me after solving C

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

Humorous and awful......

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

Интересно что за 12й тест был в задаче D.

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

adhocforces

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

Problem D was failing in Pretest 12. could you tell me why. here is my code

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader;

public class TheBestVacation { public static int getMaxSum(int arr[], int x) { int s = 0; int maxSum = 0; for (int i = 0; i < x; i++) { s += arr[i]; } maxSum = Math.max(s, maxSum); for (int i = x; i < arr.length + x; i++) { s += arr[i % arr.length] — arr[(i — x) % arr.length]; maxSum = Math.max(s, maxSum); } return maxSum; }

public static void main(String[] args) throws IOException {
    BufferedReader sc =
            new BufferedReader(new InputStreamReader(System.in));
    String[] s = sc.readLine().split(" ");
    int m = Integer.parseInt(s[0]);
    int x = Integer.parseInt(s[1]);
    String[] days = sc.readLine().split(" ");

    int totaldays = 0;
    int arr[] = new int[m];
    int i = 0;
    for (String _s : days) {
        arr[i] = Integer.parseInt(_s);
        totaldays += Integer.parseInt(_s);
        i++;

    }

    int input[] = new int[totaldays];
    int idx = 0;
    for (int j : arr) {
        int k = 1;
        int a = 0;

        while (j > a) {
            input[idx] = k;
            k++;
            a++;
            idx++;
        }
    }

    int sum1 = getMaxSum(input, x);


    System.out.println(sum1);


}

}

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

Hello Specialist Rank

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

Very informative problem statements for a hard time like this pandemic.

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

Why did $$$n = 2$$$ have to be allowed for F?

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

i have written a recursive function for C but it gives tle on pretest 4..could someone help me convert it into a dp solution using memoization or something like that?

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

Recent contests are just about finding patterns and adhoc solutions rather than any algorithms.

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

How to solve E?

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

How come so many people solved D?

What is the trick in D?

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

I know that C was easy 1 line formula and so and so...... I don't get that, I m very stupid!! Now plz explain the logic!!

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

    You need to think about the max possible sum and min possible sum. For example, take (1,1) and (3,3) as the coordinates. The grid is like this:-

    1 2 4

    3 5 8

    6 9 13

    As you can see, max possible sum will come when we go column first and then row i.e. 1->3->6->9->13. min possible sum will come when we go row first and then column at the end i.e. 1->2->4->8->13. Now you have to realize the difference in the terms . Draw 2-3 examples you will get it.

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

Im so sad...Problem C was really EZ but I spent most time of the contest and I couldn't solve it ;-;

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

    Same thing... I don't know how, but just multiplying difference between x and y + 1 works

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

      You need to think about the max possible sum and min possible sum. For example, take (1,1) and (3,3) as the coordinates. The grid is like this:-

      1 2 4

      3 5 8

      6 9 13

      As you can see, max possible sum will come when we go column first and then row i.e. 1->3->6->9->13. min possible sum will come when we go row first and then column at the end i.e. 1->2->4->8->13. Now you have to realize the difference in the terms . Draw 2-3 examples you will get it.

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

        It's not best way. I count it like summ of number in row 0 1 2 3 4 5 ... 5 4 3 2 1 0 and it wasn't correct for some of cases where n != m. The main problem is to count all these numbers.

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

          Try to look at my submission. I know it is not the best way but the question was not obvious to me when I tried it in the contest.

          Try to look at my formula in the submission. If you don't get it, I will explain how i arrived at it.

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

These were one of the worst problemsets ever, if we want to read newspaper we would go to other site not here

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

secrof tnemetats

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

I tried to use something of sort of exponential search for D, but couldn't write it. Is the algorithm below correct for Div2D?

  1. If $$$max(d_i) \ge x$$$ then we can just choose that month in reverse order, that is $$$max+(max-1)+..(max-x+1)$$$

  2. If not then we set end point at a month and try to reach as far before as possible. For this we can concatenate $$$d$$$ with itself so it becomes size $$$2n$$$ and precalculate arrays presum and presumsq each of size $$$2n$$$ (presum array is for presum of $$$d$$$ and presumsq is holding presum of $$$\binom{d_i+1}{2}$$$

Is this correct approach, what is the correct approach

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

I spent most of the contest trying to calculate sums of difference series in question C until I figured out the simpler solution... oof

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

Question B exposed my reading skills.

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

How To solve E if $$$x \lt = 0$$$ $$$?$$$

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

can C be solved using recursion+dp?

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

I feel like I'm getting worse each contest. Took an awful amount of time for A,B and I'll barely stay expert thanks to C

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

Problem C is cool.(Only after you get it)

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

I can't figure out why my solution for E gives WA. I did the following:

  • If the sum of $$$a$$$ is positive, answer is $$$n$$$.
  • Otherwise, if $$$x$$$ is not negative, there's no answer.
  • Otherwise, let $$$w$$$ be the smallest integer such that the sum of $$$a_{n-w+1}, a_{n-w+2}, ..., a_n$$$ is positive. If all subarrays of size $$$w$$$ are positive, $$$w$$$ is the answer.
  • Otherwise, there's no answer.
»
6 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Misinterpreting and misreading questions since 4-5 rounds. Fucking up every contest like a boss.

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

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

It took me to see comments to get the pattern in C and still don't understand. please explain why it works

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

    You need to think about the max possible sum and min possible sum. For example, take (1,1) and (3,3) as the coordinates. The grid is like this:-

    1 2 4

    3 5 8

    6 9 13

    As you can see, max possible sum will come when we go column first and then row i.e. 1->3->6->9->13. min possible sum will come when we go row first and then column at the end i.e. 1->2->4->8->13. Now you have to realize the difference in the terms . Draw 2-3 examples you will get it.

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

This competition is very innovative , and I believe that as long as we work together, we will be able to defeat the virus one day. Let's work together to eliminate the virus!

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

man I made terrible decisions this contest I could have solved C if I didn't try to hack unhackable A,B problems :'(

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

    when k=(x2-x1)=(y2-y1) ans=k*(k+1) — k=k*k which is same as (x2-x1)*(y2-y1)

    otherwise if (x2-x1 < y2-y2) than totDiag = (x2-x1+y2-y1 — 1 — 2*(x2-x1)) = y1-y1 -(x2-x1) -1 (here k=(x2-x1))
    ans=(x2-x1)*(x2-x1+1)+ totDiag*k (where k=(x2-x1))
    ans=(x2-x1)*(x2-x1+1+totDiag)=(x2-x1)*(y2 -y1)

    anyway the answer is (x2-x1)*(y2-y1)+1

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

waiting for editorials !!!

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

No DS ALGO required. Quite adhoc(bad) problems.

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

I was so surprised when I used the translator for the D problem. Is it… funny? UPD : The editorial pic is ridiculous.I am so disappointed.

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

тильт

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

bad statements,for problem D.

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

Why I can't submit now?

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

ratings down again. Special A B and C problems took me more time than before to solve them. And I didn't have much time to implement D, what a pity.

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

My idea to Solve C is completely different just find maximum value of all paths from source to destination and also minimum value of path from source to destination and out put max — min+1 as answer.

Though when I went submitting it contest was Over and ratings RIP.

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

For C, We know that sum will be least if we go from (x1,y1)->(x2,y1)->(x2,y2) and sum will be maximum if we go from (x1,y1)->(x1,y2)->(x2,y2). So the answer is basically each sum between max_sum and min_sum since sums need to be unique.

Now you can also notice that max_sum = min_sum + no. of rectangles below it. Hence the answer is 1+(width-1)(height-1). Try to draw a grid and check this to understand better.

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

"Solve this problem and get the cookie, or the coronavirus will extend the quarantine for five years and make the whole economy collapse!"

One of the best quotes from statement I've ever seen xDDDDD

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

I really enjoyed F statement

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

Problem C took forever, as I was trying to prove the solution. The problem writers had presented another problem (D) with the same score, so in retrospect, perhaps focus should've gone there instead..

The gist of the solution is that if you take any rectangle block, then all possible sums range from a begin value to an end value, covering every value in between. The smallest value is if you run along row 1 and then down the last column. The largest value is if you run down column 1 and then along the last row. So for one of the examples (x1=1, y1=2, x2=2, x4=4), the sums range from 25 to 27, resulting in a total of 3 (i.e. 27 — 25 + 1) values.

The proof roughly lies in the fact that at each position, you can move to the right or down. Moving down = 1 + moving right (by virtue of the layout of the numbers). The more right that you move from any position, the smaller your score gets relative to the score had you gone down instead.

I ended up with a needlessly complex solution (by calculating the number of diagonals and their lengths) rather than simply realizing that there are always (y2-y1)*(x2-x1) + 1 total possible sums in a grid of (x1,y1) to (x2,y2).

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

Anyone else who found D to be much more easier than C ?

I'm still not able to figure out how is (x2-x1)*(y2-y1)+1 working !

Tho intuitively i was guessing the answer to be (x2-x1+y2-y1)!/(x2-x1)!*(y2-y1)!, the simple mathematical approach to go from A to B in a matrix when only going down and right are allowed . Why is this approach not working here, can someone give an example when sum of values of 2 paths will be same in this approach? And from where on earth did (x2-x1)*(y2-y1)+1 came from?

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

    let X be path.

    Then

    XXO
    OXO
    OXX
    

    and

    XOO
    XXX
    OOX
    

    will have the same sum on any 3x3 subgrid. With some experimentation, we find that the sum is directly correlated to the number of "O"s on the top right section of the path.

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

    Like Failure said, RDDR weights the same as DRRD, always.

    The minimum possible path is going full right, and then down, whereas the max possible path is going down then right. You can manipulate the paths by one block to obtain a still valid one that weights 1 less or 1 more. Therefore $$$max$$$, $$$min$$$, and all values between are possible.

    The number of paths is precisely $$$max - min + 1$$$. To calculate $$$max - min$$$ what you can do is pairing the elements in both paths if they are in the same diagonal, take the differences and add them up. There are two ways to notice this is equal to $$$(x_2 - x_1) \times (y_2 - y_1)$$$. The first way is to imagine the differences as distances in the grid. Then it's pretty clear that the sum is the area of the rectangle.

    The second one, which was the one I used, was expressing the sum in terms of the minimum and the maximum between $$$h = x_2 - x_1$$$ and $$$w = y_2 - y_1$$$. The sum can be easily separated into two triangles and a diagonal section:

    $$$max - min = min(h, w) \times (min(h, w) + 1) + (max(h, w) - min(h, w) - 1)\times min(h, w)$$$.

    Working out the formula gives $$$max - min = h \times w$$$, but I didn't really notice that during the contest, I just sent the formula above.

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

      Maybe I can give a more easy justification for (x2-x1)*(y2-y1) + 1. It is obvious that the maximum path is D...DR...R and the minimum path is R...RD...D . Now to see these many distinct paths one can observe that including one cell in the minimum path increases the path sum by one. This is because each diagonal contains an increasing sequence. At most you can include (n-1)*(m-1) cells giving you the correct answer.

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

    We find the sum in the maximum sum path (DDD...RRR), and the sum in minimum sum path (RRR...DDD). All the values between these values are possible. (Change one DR pair to RD pair to decrease the sum by one). Now, the difference between the sums can be found easily, every D-R pair will be swapped once. Therefore, the answer is (count(D)*count(R))+1.

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

Does anybody else thought that C is just finding number of different paths from start to end ?? And finally ended up finding number of ways to loose your contest rating ...XDD

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

Imho, problem C should cost similar to A or B. Adding more samples would make this problem a problem A. Though, the formulae was pretty hard for me to derive. But very easy for some participants just to guess it.

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

    For me I didn't guess it but counted the difference between minimum and maximum sum paths and noted that all intermediate sum paths can be achieved. But in the end I realised the same thing as you said, that taking some cases one can guess the formula.

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

Alexdat2000 , In problem D, I've found an accepted solution which is giving wrong output for this case:

3 3
1 1 1

The actual answer of this case is = 3. But the solution is giving 1 as output. Kindly add this type of case in the dataset of problem D.

Submission Link: https://mirror.codeforces.com/contest/1358/submission/81555078

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

Thanks a lot Alexdat2000 for setting this round... Finally became CM :)

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

Very happy to reach expert for first time :-D

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

[Deleted]

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

became expert in this round.solved D problem for the very first time.

thanks for tbe wonderful round.

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

The contest was terrible! Really boring problems! C and D were SOOOOOOO boring!

If you want to give me down votes because of this, give me! I'm not afraid of it!

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

Is Div2B is same as the problem here with a different granny story? #Justasking.

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

I thought this was an excellent contest with some very interesting problems. Hats off to the problem writers for doing a fantastic job!

However, I have one criticism of problem F:

Please stop guaranteeing things. It isn't clear when you guarantee something whether this is a constraint on what input is legal, or a hint to make the problem easier. This ambiguity is completely avoidable if you just say 'we can show ...' instead of 'it is guaranteed'.

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

F was so hard to me....

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

The problems are interesting as well as the pictures in Tutorial except problem D:(

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

After reading problem D, I really felt the author's pain and how lonely he's been feeling in this quarantine. I pray for you that you get to see your girlfriend soon!! ;>

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

As i am new to this platform i am not able to understand its rating system which got changed recently i solved 1 problem in stipulated time but got -66 can any one explain me ? and how rating change works for a new account i was not able not understand the post

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

Since whatever he did is not clear so its not ethical to say anything about him right now, If he cheated,please stop it,If not,I am very sorry to him.I am keeping the attached blog as it was very helpful for many. Original Blog

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

Could someone please tell why this fails for D?

https://mirror.codeforces.com/contest/1358/submission/81573541

#include <bits/stdc++.h>
 
using namespace std;
 
long long sum(long long e, long long s)
{
  return (e * (e + 1) / 2) - (s * (s + 1) / 2);
}
 
int main()
{
  long long n, x;
  scanf("%lld %lld", &n, &x);
 
  long long maxDays = 0;
  vector<long long> v(n);
  for(int i = 0; i < n; i++)
  {
    scanf("%lld", &v[i]);
    maxDays = max(maxDays, v[i]);
  }
 
  vector<long long> v2;
  v2.insert(v2.end(), v.begin(), v.end());
  v2.insert(v2.end(), v.begin(), v.end());
 
  int start = v2.size() - 1;
  int end = start;
  long long tx = x;
  long long ans = 0;
  long long h = 0;
  if(maxDays >= x)
    ans = sum(maxDays, maxDays - x);
  else
  {
    while(end >= 0)
    {
      long long diff;
      while(tx && end > 0)
      {
        diff = min(v2[end], tx);
        h = h + sum(v2[end], v2[end] - diff);
        tx = tx - diff;
        if(tx)
          end--;
 
        // cout << "tx " << tx << " diff " << diff << " h " << h << " end " << end << " start " << start << endl;
      }
 
      ans = max(ans, h);
      if(end < 0)
        break;
      h = h - sum(v2[end], v2[end] - diff);
      tx = tx + diff;
      if(start == end)
        break;
      else
      {
        h = h - sum(v2[start], 0);
        tx = tx + v2[start--];
      }
 
      // cout << "tx " << tx << " diff " << diff << endl;
    }
  }
 
  printf("%lld\n", ans);
}
»
6 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

Can div 2 c be solved using dynamic programming

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

I did see your love to Сoronavirus. Seems you are really happy to play with it.

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

Idk why people have been joking around with Coronovirus while not seeing people devoting their lives to control it. Sorry for not being humorous.

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

Is the problem in love with the coronavirus?Did they kiss?Why are you making jokes about the coronavirus?Just because you didn't die of coronavirus?This is no fun at all.Here's a bowl of bats for the problem maker:-)Wish you enjoy it:-) Does Naha mean the reversation of Wuhan? 出题人就是个傻逼。出题人给爷爬。你自己不感染很狂?

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

出题人 May I inquire after your family

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

Респект, парни!

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

deleted

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

Can anyone check why my code for problem D doesn't work? I used the idea from the editorial and for every small given test it works but when it comes to those where n=200 000 it fails. My code: https://ideone.com/rLE5jx.

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

The photos in solution post are clearly racist. We need you to delete it immediately and apologize. This isn't funny at all. Freedom of speech does not mean you can say anything unthoughtfully at your will. I couldn't imagine this happened at codeforces.com. If it happen in my university, you will be subjected to charges from Student Council of Accountability!! The result could be complete expulsion from school. Pledase delete the photo, apologize to whom it may concern and stop playing with politics,boi.

You are too young as a boi who hasn't finished his homework to play with politics.

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

I started a few months ago. I didn't participate any contests but just do it as practice to improve my overall algorithm ability.

I am SO SHOCKED that Codeforces would allow this kind of racist content (problem D). I know that some people mentioned this is and got downvoted. I don't like downvotes (in fact I think this is my first comment), but I think I need to standup against this type of nonsense.

  1. I am okay with you mocking with COVID, but does it really need to be "Coronavirus-Chan"? Do you really need that "Chan" part? That's clearly insult to any Chinese/Eastern people (This is a surname used in China, Hong Kong, Taiwan, Singapore and many more places).

  2. Do you really need a picture of an Asian lady holding a cooked bat? That suggests the virus coming from people eating bats. But this is clearly not the case. Even in China, most people don't eat weird things like this.

  3. Every country got hit by COVID and many people die from it. My family member died because of it. When I looked that problem D, it is very unpleasant to work on it.

Can we keep this place a politically neutral place and only about algorithm and technologies?

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

    I agree with the concerns raised about Problem D's presentation. Using 'Coronavirus-chan' trivializes a global tragedy. The Japanese honorific '-chan' (often used for endearment toward girls or cute things) paired with a deadly virus is deeply inappropriate. This framing -- combined with the narrative of 'visiting' and 'hugging' COVID-19 -- mocks the suffering of millions worldwide.

    Additionally, linking the virus to East Asian culture via '-chan' risks perpetuating harmful stereotypes. Many in the community, myself included, find this offensive and distracting.

    Suggestions for Codeforces Admins:

    • Replace 'Coronavirus-chan' with a neutral fictional entity.
    • Remove any culturally charged references to avoid marginalizing participants.
    • Add a content warning for future contests to prevent similar oversights.

    This platform excels at technical excellence -- let’s keep it inclusive and respectful so we can focus on problem-solving without unnecessary pain.

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

Bad Statement....

Why Problem D's picture still exist? lol

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

We want the fascinating problem instead of racism

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

It's still a stupid decision to choose coronavirus as the contest's background even if the virus was over and it has been 5 years since the contest begun. Though it has great problems, I gave the post downvote 3 years ago. And just a few days ago, Luogu, which is another OJ, deleted the problem so I won't be able to solve the problems unless I solve them on CodeForces, and that means I have to go through the stupid "coronavirus" thing.

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

比赛出题人,该罚!