Автор awoo, история, 3 года назад, По-русски

Привет, Codeforces!

В 23.03.2023 17:35 (Московское время) состоится Educational Codeforces Round 145 (Rated for Div. 2).

Продолжается серия образовательных раундов в рамках инициативы Harbour.Space University! Подробности о сотрудничестве Harbour.Space University и Codeforces можно прочитать в посте.

Этот раунд будет рейтинговым для участников с рейтингом менее 2100. Соревнование будет проводиться по немного расширенным правилам ICPC. Штраф за каждую неверную посылку до посылки, являющейся полным решением, равен 10 минутам. После окончания раунда будет период времени длительностью в 12 часов, в течение которого вы можете попробовать взломать абсолютно любое решение (в том числе свое). Причем исходный код будет предоставлен не только для чтения, но и для копирования.

Вам будет предложено 6 или 7 задач на 2 часа. Мы надеемся, что вам они покажутся интересными.

Задачи вместе со мной придумывали и готовили Адилбек adedalic Далабаев, Иван BledDest Андросов и Максим Neon Мещеряков. Также большое спасибо Михаилу MikeMirzayanov Мирзаянову за системы Polygon и Codeforces.

Удачи в раунде! Успешных решений!

Также от наших друзей и партнёров из Harbour.Space есть сообщение для вас:

Harbour.Space

Привет, Codeforces!

Мы рады сообщить, что регистрация на летний лагерь Leagues of Code открыта! В этом году Harbour.Space University и Leagues of Code организуют лагерь программистов на Менорке с 1 по 15 июля!

Наш летний лагерь — это обучающая программа, которая научит участников соревновательному программированию. Мы приглашаем учащихся в возрасте от 10 до 18 лет, заинтересованных в улучшении своих навыков или стремящихся к интенсивному обучению на высоком уровне. Участники будут разделены на классы в зависимости от их уровня и предыдущего опыта. Занятия будут проходить на английском языке.

Присоединяйтесь к лагерю программистов, в котором примут участие самые яркие звезды программирования!

Вот самое главное о лагере:

  • Длительность: 2 недели
  • Даты: с 1 июля по 15 июля
  • Место: Менорка
  • Уровни:
  1. Зеро: Наш курс "Зеро" предназначен для тех, кто не имеет опыта программирования. Благодаря интерактивным урокам и интересным мероприятиям они будут изучать основы программирования и создавать прочную основу для будущего обучения

  2. Начинающий: Наш курс программирования для начинающих предназначен для участников, которые имеют некоторые базовые знания в области программирования, но хотят поднять свои навыки на новый уровень. Курс охватывает основы программирования при уже имеющихся знаниях, уделяя особое внимание решению задач, критическому мышлению и учебным проектам.

  3. Средний: Станьте программистом, погрузившись в основные концепции веб-разработки и разработки игр. Нет опыта программирования? Без проблем! Мы поможем вам начать, и к концу буткемпа вы станете программистом-ниндзя с крутым проектом за плечами!

  4. Продвинутый: Готовы испытать себя? В нашем лагере вы будете решать алгоритмы как профессионал и соревноваться как чемпион под руководством медалистов.

Готовы присоединиться к нашему летнему лагерю на Менорке? У нас есть 30% скидка для участников Codeforces, использующих код CODPARMEBO30.

Зарегистрироваться→

UPD: Разбор опубликован

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

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

"Unfortunately, due to network issues, we are forced to reschedule the round. Let's do it in the coming days. Apologize."

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

Hope contest will provide positive delta to all.

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

Хочу пожелать всем удачи на предстоящем соревновании! Надеюсь, я смогу решить две задачи!

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

Can I cancel my registration? I dont think I can attend today for the new, rescheduled date.

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

    If you don't submit anything your rating won't change. Also you can cancel your registration by going to ghe registrants page, and press the X sign next to your handle

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

Hi, what is the difference between a normal div 2 and an educational div 2?

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

almost 30k registered in edu round *_*.

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

Hope to perform better

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

I want to request a feature where participants can submit their own authored and properly documented solutions. I know people do share the approach they used to solve the problem but I feel if something other than editorial is available, it can be helpful to each and every one.

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

    thread with comments is usually not too long + people upvote some interesting solutions, so i dont quite understand why you need it

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

      It would be nice to quickly find approaches to the particular problem you need. Ctrl + F doesn't always work since people phrase their questions in different ways.

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

      Leetcode does this and I would say it is very good. You have access to detailed explanation of solutions in different methods and languages. Codeforces users are generally more experienced so I guess we can find solutions on our own, but sometimes I still struggle to find solution (if the editorial is hard to understand) for 2400+ problems.

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

I received 10 penalties because I set INF to 1e16 for problem D. Feel free to laugh :') https://imgur.com/a/F5VcnwL

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

when that error came up I got almost sure that the contest is cursed. I submitted at 10 seconds remaining am I the last correct submission though.

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

how to solve c?

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

How to solve B?

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

My approach in D was to iterate on the number of elements to remove, If we remove i elements then we'll remove those which contribute most to the number of inversions(leftmost 1s or rightmost 0s) Is there something wrong?

Edit : Just saw some solutions of other people and looks like I went completely off tracks..

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

i try some inversion contribution type things in d problem But i didn't get anything Any hint for d problem

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

    I used standard dp with memoization for: position, whether there was a previous 1 in the array, and whether we swapped

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

    After trying some cases, you will found out that swapping elements $$$\ge 2$$$ times is worse than deleting an element. Therefore, you only need to check the minimum number of elements to delete for not swapping and swapping once.

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

    Try to think about greedy, what is the relationship in position between numbers that should be removed, and those that should be kept?

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

Can someone teach me or refer me to a resource where I can learn to make my DP not ugly? I learned DP on Leetcode and for multidimensional DP I will do something like:

int dp[MAX_N][b][c][d] = {};

memset(dp, -1, sizeof dp);

But this doesn't work on Codeforces because testcases may be <= 1e5 and initializing the DP array for this many testcases results in TLE. So on Codeforces like this contest's problem D I ended up using:

vector<vector<vector<vector<vector>>>> memo(s.length(), vector<vector<vector<vector>>>(2, vector<vector<vector>>(2, vector<vector>(2, vector(2, -1)))));

But surely there's a better way to do this, right?

»
3 года назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится
Problem B and Google Calculator
»
3 года назад, скрыть # |
 
Проголосовать: нравится -25 Проголосовать: не нравится

include<bits/stdc++.h>

using namespace std;

define endl "\n"

define ll long long

int main() { ios::sync_with_stdio(false); cin.tie(0);

int t; cin>>t; while(t--) { string s; cin>>s; map<char,int>mp; for(auto i:s) { mp[i]++; }
if(mp.size()==1)cout<<-1<<endl; else if(mp.size()==4)cout<<4<<endl; else { if(mp.begin()->second==1||mp.begin()->second==3)cout<<6<<endl; else cout<<4<<endl; } }

}

Why this code don't work 1st problem... Can anyone help me out?

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

in C++20 inbuilt sqrt() is giving wrong answer but in C++17 it's accepting?? sqrtl() worked for C++20

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

How did so many people figured out answer for B is sqrt(n-1) is this some known concept or if someone could share how they landed up on this solution.

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

In the beginning 5min, the server was heavier than usual, hope the situation becomes better until the coming Div1+2.

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

    Hi, a totally unrelated question but it would be great if you could help me. Can you look at my profile and tell me whether I am doing something wrong coz I feel like I am unable to solve D questions of DIV2's. I usually practice in the range 1400-1900(sometimes 2000, but not often).

    I get it I need to solve harder problems to solve 4th question but then should I stop solving < 1600 rated questions and just focus on the harder ones?

    Thanks!

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

      When practicing, you should not solve easy problems. I won't give an exact rating because it depends, but the easiest problems you should solve when practicing should probably take you at least 45 — 60 minutes to solve completely (from first reading the statement to getting AC). Obivously I'm not saying that you're not allowed to solve some easier problems every now and then if you find something you'd like to solve, but know that it is really effective if you just focus on the harder problems.

      Also remember that it is (almost) equally important to be able to solve easy problems fast and with very few or no wrong answers in contests. The best way to practice this is by doing contests; the second best way is by doing virtual contests. But I'd still say that most of your practice should be doing hard problems if you want to improve quicky. It will take a lot of effort but I promise it is worth it. And don't feel demotivated if you can't find the time of motivation to solve hard problems on some day. You should practice when you feel like it and you should not force yourself to do it (unless you actually want to, but then it's your own choise).

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

        I'll try to stick too it.. but most of my <1600 rated problems are for speed practice :/. I try to do a couple of 1700-1900 ranged questions everyday so that I actually feel myself struggling a lot and then I do a couple of managable ones to improve speed

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

      First of all, the difficulty of D2D is not so stable. Sometimes it's 1400 and sometimes 2400. So it's better to aim to solve Xdiff than Xth question.
      In my experience,

      • (Stable rating -500 or lower): You must solve this task almost 100%. Good to use for the practice of speedsolving.
      • (Stable rating -400 to -300): You must solve this task with high probability, but sometimes you can't solve this (and if that case, the problem includes a new concept for you)
      • (Stable rating -200 to +200): 50% zone. Practice and gaining the probability of solving the problems of this range is the fastest way to growth (but don't forget, practicing only in this zone isn't enough). It's good to use VCs including these problems.
      • (Stable rating +300 or higher): Challenge zone. Too much practice in this zone isn't effective(or even harmful?), but it's good for learning the process to solve very difficult problems.
»
3 года назад, скрыть # |
 
Проголосовать: нравится -6 Проголосовать: не нравится

I'm waiting for the proof of B.

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

I think the round should be made unrated

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

Problem B might be my least favorite problem ever, hopefully I can understand the solution when the editorial comes out, not just have people say they've guessed it :D

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

OOOOOOOOOOMG!I finally passed a C in div2

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

Badly stucked in B.

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

Other than a terrible Div2 B, this was a great contest.

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

B is so hard. how does it get so many ACs? What's the solution for B? I used binary search for even and odd count of points on one side and do a sum series. But it's so complex. What's the easier solution?

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

...(sorry for multiple comments caused by internet connection issue)

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

First time solved div2 A-F in 1.5 hours. (1801B - Buying gifts: What did you say?)

A: We can count the occurence of each color. There are only 5 ways to divide 4 bulbs into different colors: 1111, 112, 22, 13, 4. The answer for these situations are 4, 4, 4, 6 and -1.

B: The optimal way to place chips: choose an upper bound k, place chips on all points (x, y) with |x|+|y|<=k and (k-|x|-|y|)%2==0. We can find the optimal k by binary search.

C: We consider array {s[i]}=a[1]+a[2]+...+a[i], where 0<=i<=n, then {s[i]} will have exactly n*(n+1)/2-k inversions. First we let s[i]=i, the initial inversion number is 0. Then we swap some pairs of adjacent elements to increase the number of inversion. We can do this like what we do in bubblesort: first for j=0...n-1 do swap(s[j], s[j+1]), then for j=0...n-2, then for j=0...n-3, and so on. Every swapping will increase inversion number by 1. When we reach n*(n+1)/2-k we stop swapping and output {s[i+1]-s[i]} as answer.

D: It's optimal to use at most 1 swap operation (that's something like 00010111 -> 00001111). We need to choose an index i, remove all occurences of 1 on its left, and remove all occurences of 0 on its right. But if there are something like ...[1]0|11..., instead of removing [1], we can move it to right by swapping and save 1 coin. Similar for something like ...00|[1]0... , so we can solve the problem by prepare prefix-sums, suffix-sums and look for all choices of i.

E: Consider for all pairs of (c, d) with same value of t=c+d. Let v1 and be the current volume of water in the first and second tank. Then in the whole process, we have 0<=v1<=a and 0<=v2<=b. since v2=t-v1, we can write the second inequality as t-b<=v1<=t, then we have max(0, t-b) <= v1 <= min(a, t). Then for all possible values of c in this range, the lower bounds and upper bounds of v1 are the same, so we can let f(v;i,t) be the value of v1 after we do the i-th operation if v1=v before the operation and v1+v2=t, then the answer is the composition of functions f(_;1,t), f(_;2,t), ..., f(_;n,t). We can observe that every possible compositions can be determined by a tuple (f0, x1, x2), which means:

-if x<x1, f(x)=f0.

-if x1<=x<=x2, f(x)=f0+(x-x1).

-if x>x2, f(x)=f0+(x2-x1).

For each value of t we can find the answer for (c, d) with c+d=t by doing function compostions by some caseworks, and we can solve the problem in O(n*(a+b)+ab).

F: The optimal solution is: Fill fuel for the remained journey at cities with b[i]=1, and fill fuel to reach the next city at cities with b[i]=2. Thus when we leave a 1-city, we have at most k-a[i] liters of fuel for following 2-cities, which means we can save min(k-a[i], a[i+1]+...+a[j]) liters of fuel, where [i+1, j] is a maximal block of 2-cities. So the answer of all 1-cities are the same, and for some 2-cities we need to consume more fuel because we lost the opportunity for saving fuel.

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

    Holy hell, the inversion model and solution for problem C is really cool. Now the model approach (which was written by me) looks lame.

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

      This also allows a linear time solution for problem C(as it just boils down to building a permutation with k inversions): https://codeforces.me/contest/1809/submission/198841950

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

        My solution can also be improved to linear, although I wrote it in recursive fashion without improving, so it works in $$$O(n^2)$$$. When designing this problem, I envisioned an approach which gradually reduced the problem to smaller values of $$$n$$$ and $$$k$$$.

        Basically, I consider two cases:

        • if $$$k \lt n$$$, it's quite easy to build the answer. Although I impose an additional constraint (which I'll need later) that the sum of elements in the whole is greater than $$$-1000$$$. Even with this constraint, it's quite easy: I make something like $$$[-1, -1, -1, \dots, -1, 100, -200, -1, -1, -1]$$$, where $$$100$$$ is the $$$k$$$-th element of the array. All segments ending with the $$$k$$$-th element are positive, all other segments are negative.
        • but if $$$k \ge n$$$, I reduce $$$k$$$ by $$$n$$$ and $$$n$$$ by $$$1$$$ by making sure that all segments containing the first element of the array are positive. So, I set the first element to $$$1000$$$, and arrive at the same problem with reduced $$$n$$$ and $$$k$$$.
        • »
          »
          »
          »
          »
          3 года назад, скрыть # ^ |
          Rev. 3  
          Проголосовать: нравится +6 Проголосовать: не нравится
          • I did a much simpler solution in O(n)
              int i=1;
              while (k>n)
              {
                  cout<<"1000 ";
                  k=k-n;
                  n=n-1;
                  i++;
              }
              i=1;
              cout<<(k*2-1)<<" ";
              i++;
              while (i<=n)
              {
                  cout<<"-2 ";
                  i++;
              }
              cout<<endl;
          
          • Now, Understand my intuition,
          • solving for k<=n:
          • Print kth odd number and then print -2 (n-1 times)
          • Why?
          • To understand, see these test cases, You would understand the reasoning by your own observation:
          • n=4 k=1 :-> Array={1,-2,-2,-2}
          • n=4 k=2 :-> Array={3,-2,-2,-2}
          • n=4 k=3 :-> Array={5,-2,-2,-2}
          • n=4 k=4 :-> Array={7,-2,-2,-2}
          • So you get it now if k<=n then kth odd number and rest all -2's will give you k positive sub-arrays.
          • Now if k>n,
          • Then print 1000 and
          • change k to k-n and change n to n-1
          • And until k remains more than n
          • Keep printing 1000
          • Then ultimately k will become k<=n
          • Now you already have the method to print an array for k<=n
          • Feeling like you do not know what's going on?
          • Then Feel it by these test cases,
          • n=4 k=5 :-> Array={1000,1,-2,-2}
          • n=4 k=6 :-> Array={1000,3,-2,-2}
          • n=4 k=7 :-> Array={1000,5,-2,-2}
          • n=4 k=8 :-> Array={1000,1000,1,-2}
          • n=4 k=9 :-> Array={1000,1000,3,-2}.
          • If you still do not get it then just make observations by my given test cases and you'll be infering the solution itself

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

    What is this notation, {s[i]}=a[1]+a[2]+...+a[i] or {s[i+1]-s[i]}?

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

    Is there a simple proof that at most 1 swap is optimal? I have a proof but it doesn't feel direct enough.

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

      Can you explain your proof?

      I have an idea but I'm not sure if it is correct or not.

      Think about when you have 2 swaps.

      Case 1: Swap same element [Example: 100]

      You can just remove the 1 instead of swapping.

      Case 2: Swap different elements [Example: 10 ... 10]

      After swapping both pairs, the second 0 will still be after the first 1, and it would be more optimal to just directly remove the second 0.

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

    And how did you notice that the number of inversions corresponds to the subarrays of the required sums? Thank you.

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

    why not only remove ones in d why both zeroes and ones????

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

there's no way to get a correct answer on B unless you binary search the square root, did none of the testers notice this?

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

You can solve B by this observation: one way to start placing chips is to start at [0,0] and then place chips a total distance 2 from the first one on positions [0,2], [1,1], [2,0], [1,-1] etc., forming a kind of a "star" this way, following this pattern you can place 8 + 1 starting chips, then each next amount of chips is greater than the previous one by 8 and the distance is going to increase by 2, so we end up with an arithmetic series which total sum is equal to:

1 + (k / 2) * (8 + (k-1) * 8), this should be equal or greater than the total amount n of chips that we want to place. After solving the quadratic, the minimum distance would be equal to 2 * k.

Another way to start is by placing 4 chips on positions [1, 0], [0, 1], [-1, 0], [0, -1], this way we can minimize the initial cost of placing chips to 1. Similar to the previous case, each next step we can place 8 chips more than the last step, each time increasing the total cost by 2.

In this case we end up with sum looking like this: 4 * k^2 = n, so the total amount of times k we should place portions of chips should be equal to k = sqrt(n) / 2 (careful with the rounding). The total cost in this case will be 1 + (k-1) * 2.

After we calculated the cost for each of two methods we should take the minimum one, that is our answer.

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

...(sorry for multiple comments caused by internet connection issue)

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

Anyone know B test2 5002nd input?

wrong answer 5002nd numbers differ — expected: '999999999', found: '1000000000'

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

Why in problem B, data

1

1000000000000000000

The answer is 31622776 is an unsuccessful hack?

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

We found a guy **https://codeforces.me/profile/LUFFY_02** LUFFY_02 he has created three fake accounts __LuFFy LuFFy___ -LuFFy- he use to do correct submission from his official account and hacks his solution in fake accounts by putting a edge case on test cases for getting successful hacks. 198783958 198783958 198784476 198784572 198783173 198780641.

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

Unethical hacking attempts are going on in this contest. I'm unsure if the hacks contribute to the rating for this event, but similar hacks can be performed in other contests. I have explained how this is being done there. https://codeforces.me/blog/entry/114270

Please check out and make sure this won't happen further

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

Awesome Problem F!

Solution Sketch

198831015

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

Spent 1.5 hr making useless drawings for B.

Cyan color will suit me.

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

Am i the only one who solved D by DP , maybe i overcomplicated it :(

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

Could someone help me out with how to combine observations in problems like D, I was able to find out that if I perform a swap operation, both the numbers should reach their correct positions , like on 0010111 -> 0001111 , but I wasn't able to do anything after that. I don't understand why I can't come up with a solution even after getting good observations. Please help

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

    I will omit the part about importance of proving observations. Considering the fact that you and I are green as hell, I think having at least "proofy" gut feeling of correctness, or being unable to construct counterexample should be enough to solve ( guess).

    Your so called observation: if I perform a swap operation, both the numbers should reach their correct positions. What do you exactly mean by that? One way to interpret: perform swap only if it yields to correct position. But then it means that all of the performed operations are deleting, excluding only maybe the last operation. I won't continue because your observation is wrong anyway. What I intended to show by writing all of this is that, as you could not evolve your idea even if it is wrong shows me that you can't interpret your intuition in terms of strict statements and/or you don't really understand what observation means, have little to no experience of proving statements. I think you should try proving all of your observations or construct counterexamples during practice. At first it is hard, but as you gain experience in proving things, and gain experience, it will really become a second nature. Good observation for this problem will be (don't read if you want to try again):

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

Using sqrt function doesn't work if you use C++ 20 but works if used in C++ 17. Could someone explain what's wrong here?

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

About problem F:

Don't get me wrong, I'm not trying to say that this problem should not appear in the contest, it's ok and seems like a lot of people liked it, but there is much harder version of this problem from joi 20-21. It's a really cool problem, for those who solved problem F, I recommend to solve it as well, here is the link and you can submit here.

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

    is there any english editorial of it?

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

      I'm not sure, I didn't find it. But here is a short solution. I hope it will help in case you don't know what to do.

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

in Educational Codeforces Round 145 (Rated for Div. 2) in problem 1809B - Points on Plane during the contest i have submit code with C++20 and had Wrong answer on test 2 and after the contest i submit it again with C++17 and had been Accepted 198780726 Wrong answer on test 2 198858827 Accepted anyone to say why?

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

I solved B using binary search...didn't think of any other methods during the contest. Learned a lot! Epic round huge thanks to the authors!

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

In Question C, It's giving wrong output on test case 7,i.e, n = 17, k = 48 my output is 2 4 6 8 10 12 14 16 18 -79 -500 -498 -496 -494 -492 -490 -488 this output is having exactly 48 positive subarrays. but codeforces is showing wrong answer. It is request to codeforces to see this issue asap as my rating will affect vastly in this case. here is my submission link : https://codeforces.me/contest/1809/submission/198828726

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

Damn I suck at Geometry, my brain froze at B :(

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

Why is this guy Mido. submitting all these different solutions ( 198880211, 198880252, 198880324, etc) for Problem A while giving different edge cases that would fail to let AhmedSayed. hack all of them? This is weird...

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

Great contest! I have a editorial video (dicord discussion) on this contest, where problem A, Problem B, Problem C and Problem D have been discussed. you can view it here- video editorial!

Thanks!

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

Educational contest(×) Reverse pair contest(√) problem C and E are good as problem conversion exercises

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

Failed to notice in D operation 2 is always better than swapping as long as the swapping letter is not consecutive
Though it makes me wonder: what if the costs of two operation is given in the form of a, b? I think I got a solution but not sure about it.

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

Where's editorial

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

Question c Why did my code make an error at the test point of 17 48: https://codeforces.me/contest/1809/submission/198828047 but When I modified the output rule, it passed: https://codeforces.me/contest/1809/submission/198884256

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

Update in Ratings?

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

B is a Good problem

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

Is this contest unrated ?

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

same code :

WA : c++ 20 : 198836355 AC : c++ 17 : 198857463

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

Upload the editorial please. Can someone explain how to solve E. I can't come up with any kind of logic

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

Did anyone else miss the fact that $$$1\leq b_i \leq 2$$$ in problem F? :(

I know it can be solved without that restriction, but that simplifies the problem a lot.

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

Please release editorials soon.

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

Was this round unrated because the blog says this was rated ??

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

When will the ratings be updated? I am so much excited to cross 1200 for the first time.

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

Hi guys, I hope I'm not bothering you with my question, but I've seen that I haven't been classified in this last contest, could someone tell me why...

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

So the rates still don't be updated yet?

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

Have the final tests run? I don't see any failed system test, only hacks

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

Can anyone please suggest a good Rating predictor extension or website..? The waiting for this rating update is too long.....

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

Auto comment: topic has been updated by awoo (previous revision, new revision, compare).

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

Why it take longer time for educational rounds rating update?

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

I need +42 to reach specialist, and the carrot extension is showing + 56. Hope, I reach in this contest only, even if I miss by few points, after this contest, I have confidence that I would definitely reach specialist in the next one!!

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

Can someone tell me how much times does educational round takes to update the rating ig there is a delay as compared to other contests?

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

I am sorry guys, since i am mastering, Mike gonna make all of you wait 1 more day

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

Finally!

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

I noticed something weird regarding rating changes. Me and the person next to me both got the exact same rank (226) and our initial ratings are only 1 apart. However, our rating changes are significantly different (+137 vs +172). Heres the picture for reference https://imgur.com/a/vU5nqyT.

Does anyone know why this happened?

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

    I suspect it's because it's only frgnhite's 6th contest, and their true rating was not shown prior to the contest. Users start from a rating of 1400, but it is shown as starting from 0 (to not discourage people), and so, are shown a reduced rating to show progress. After each of the initial few contests, this reduction is reduced, until eventually (at 6 contests maybe) it shows their true rating.

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

Can someone explain me this rating change ??? Like I just saw a higher rated coder who got higher rank than me got more rating changes??? Also some peoples with 0 problem solved and wrong submissions got +ve del???

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

    For the first situation that's natural...if the rank is high enough why not...? For the second the first 6 contests of each account works in particular with a base line of 1400(that's if you just meet the level you'll precisely reach it after 6 participations,+500/350/250/150/100/50),and in the quick ranking one gains more rating points(turning negative to positive inclusively). Pretty hard to get a negative rating change in this peroid

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

I really liked problem E, it reminded me of IOI21 Candies.

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

Hi I have a problem. My submission is https://codeforces.me/contest/1809/submission/199501601 and it told me that in test 2, the 22nd test point I got wrong answer. The input is "22 232" and my output is twenty-two 2 and one -41. I think my output is correct, can anyone help me?