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

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

Трям, Codeforces!

andersen

Возможно, вы ждете от нас анонс финала чемпионата БГУИР, но пока мы только рады пригласить вас на Codeforces Round 675 (Div. 2), который пройдет 04.10.2020 19:05 (Московское время). Этот раунд будет рейтинговым для участников, чей рейтинг ниже 2100.

Задачи для вас кроме меня готовили andrew, hloya_ygrt, AleXman111 и Vladik. Мы думаем, что подготовили хорошие задачи на Andersen Programming Contest 2020. Квалификация. Потом мы отобрали лучшие из них для этого раунда.

Компания Andersen уже второй год проводит соревнование, которое в первую очередь предназначено для поддержки студентов региональных ВУЗов Беларуси и Украины (с этого года).

В первую очередь благодарим MikeMirzayanov и всех, кто причастен к развитию платформ Codeforces и Polygon. Не меньшая благодарность KAN за координацию — благодаря ему вы сможете понять наши задачи. А также всем нашим тренерам и родителям, которые научили нас делать все то, что мы умеем.

Разбалловка обещает быть такой: 500 — 750 — 1000 — 1500 — 2000 — 2750.

Всем удачи и чистого кода!

UPD

Поздравляем победителей рейтингового зачета:
1. Yukikaze_
2. lunabbit
3. kamer
4. Potassium_Fan
5. 2018LZY

И победителей общего зачета:
1. awoo
2. dlalswp25
3. tfg
4. Sugar_fan
5. hank55663

Разбор будет позже.

UPD

Разбор подъехал.

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

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

Notice the unusual start time :)

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

Will the two contests be held at the same time?

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

Will the two contests be held at the same time?

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

This contest starts 1 hour 30 minutes later than the usual time.

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

Thanks, this is a most excellent time for those of us on the American west coast (9 AM)!

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

Wait, where are the testers?

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

Are problems in proportion to scoring distribution? Or we are going to see another Codeforces Round 657 (Div. 2) where problems were much tough than their scores.

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

As a tester, I strictly recommend you to partisipate this round. Also I want some contribution.

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

Good luck and clean code

thanks :)

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

"Good luck and clean code to everyone!" Is this a hint for Implementationforces.

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

In China, I have to stay up late to participate in this contest. Hope my rating++.

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

Previous timing was better 8:05 pm(IST).

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

I wish to join in but 00:05 UTC+8 is too late for me. Anyway hope everybody has a nice contest.

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

Good luck and high rating to everyone!!!

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

00:05(UTC+8) is a bit late for the Chinese contestants.

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

Valorant statements again?

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

could you make my contribution from negative to 0 ?

I know I would add more negative from this comment but still I wanna give a try.

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

oppsss i got earlier here. 1.5 hrs still to go for contest

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

It will end at 12.04 am here. Hope I can have a sound sleep after completing a good number of problems. And good luck for everyone!

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

Hey Dear codeforces, first thank you for developing foremost and prime algorithmic platform and I know this process will continue, and second, I hope the ratio of codeforces's contest holding per days will grow to meet one contest every two sequential days. finally, I appreciate your efforts for creating a contest and hold it in codeforces's website:-)

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

Привет из Мозыря)

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

ЖЫВЕ БЕЛАРУСЬ!!!

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

ЖЫВЕ БЕЛАРУСЬ!!!

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

Best of luck guys!! Wish you all a good contest :)

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

Why am I not able to register?

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

so bad

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

kingmanas is openly cheating in this contest, I have proofs Manas what's the use of rating when you get it through cheating!!?

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

B should have been 1000 and c 1500

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

Слабые претесты в задаче E. Скорее всего у многих падет после системного тестирования.

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

how to solve C?

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

    Consider the contribution of each digit to the sum. For each digit count the number of subarrays before it which were deleted. In this case the contribution is fixed. Consider 1,2,3,4 and the contribution of the 3 for all subarrays before it which could be deleted. The contribution would be 30 * (number of such subarrays) which is 30 * 3.

    Then count the contribution for the subarrays after it which can be deleted. This required some weird sum manipulation. Consider 1234. Consider the digit 2. There can be one subarray of size 2 after the digit 2 which can be deleted and 2 subarrays of size 1. So, the contribution of 2 would be 2 + 20 + 20. This can be written as 2 * (1 + 20). If you do this, you'll see a pattern.

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

    Consider the given string in reverse. Now for each position $$$i$$$ from 1 to $$$n$$$, let us calculate the contribution of $$$s_i$$$. In case the removed substring was to the right of it, then the contribution of $$$s_i$$$ is $$$10^{i-1}s_i$$$. The number of such substrings are $$$n - i + 1 \choose 2$$$. In case removed part is to the right, then the contribution is $$$s_i\sum_{z=1}^{i-1}z10^{z-1}$$$. The summation can be maintained while iterating over the string.

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

    https://medium.com/@harryjobz/bargain-a6cf0b9a5262 I have explained it here since the actual explanation is too long to write it here

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

Some one please tell me what is the procedure of B I try for 1.5 hour but failed on test case 2

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

What were the hacks on E?

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

What is up with MLE on D? M is upto 1e5 that should be doable in 256 mb?

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

Is there an elegant way to solve C without keeping track of all the edge cases?

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

How to solve D ?

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

I got that there is some prefix and suffix stuff and modulo of long strings involved in C..but how to solve it in linear complexity?

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

    For each number at ith index, try to see how much contribution it can give to final answer.

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

    Observe the pattern :

    S = "12345"

    Removable Sub-Strings :

    length_1 = '1', '2', '3', '4', '5'
    length_2 = '12', '23', '34', '45' length_3 = '123', '234', '345'
    length_4 = '1234', '2345'
    length_5 = '12345'

    Strings Left after removing the above Sub-Strings :

    '2345' (after removing '1')
    '1345' (after removing '2')
    '1245' (after removing '3')
    '1235' (after removing '4')
    '1234' (after removing '5')
    '0345' (after removing '12')
    '0145' (after removing '23')
    '0125' (after removing '34')
    '0123' (after removing '45')
    '0045' (after removing '123')
    '0015' (after removing '234')
    '0012' (after removing '345')
    '0005' (after removing '1234')
    '0001' (after removing '2345')
    '0000' (after removing '12345')

    '0's are appended at the first for the ease of understanding. You can ignore them.

    Contribution of every index in the total sum :

    0th index ('1') = 1 * (4*pow(10,3) + 3*pow(10,2) + 2*pow(10,1) + 1*pow(10,0) + 0*pow(10,4))
    1st index ('2') = 2 * (------------------- 3*pow(10,2) + 2*pow(10,1) + 1*pow(10,0) + 1*pow(10,3))
    2nd index ('3') = 3 * (---------------------------------------2*pow(10,1) + 1*pow(10,0) + 3*pow(10,2))
    3rd index ('4') = 4 * (------------------------------------------------------------1*pow(10,0) + 6*pow(10,1))
    4th index ('5') = 5 * (------------------------------------------------------------------------------10*pow(10,0))

    Hope it helps !!!

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

Am I missing some simpler solution, or was online part of problem F simply "take offline solution with a segment tree, add persistency on top of that to make it online"?

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

The problems were really interesting and amazing,but the score distribution is very low for these difficulty level problems

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

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

another horrible contest

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

really bad score distribution. E was more easier than C(atleast to me). imo the only reason E had less submissions is just because it was E.

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

The difficulty level of this round is much higher than a div2 round

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

D is similar to Timus 1205

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

Guys, did you all even face server slow done in last 10 minutes? I tried to go for hacks, but the main site itself wasn't loading. I am doubtful that this round shall be rated, if its the problem for many.

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

System testing results on E are such a massacre that it probably would've been too much even for good old days when having CF problems that allow hacks wasn't frowned upon :)

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

Can problem C be solved using Dynamic Programming?

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

    Yes you can calculate an AGP by dp see the below comment of mine!

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

    One more dp solution for problem C: 94861783

    I store 3 things:

    1. value of substring that ends in current pos and has no crosses

    2. (count, sum) of substrings that end in currend pos and last digit is crossed

    3. (count, sum) of substrings that end in current pos and last digit is uncrossed, but it already has some cross before

    1 transition is just prev*10 + current

    2 transition: we can cross current digit only if we have previous digit crossed, or if we take substring without any crosses and put first cross now, hence count is 1 + all that end in previous digit and last is crossed, and value is just sum of same things: value ended in previous digit and all sum of values that crossed in prev step. Since we don't add anything to the end we don't need to multiply.

    3 transition: we can add new digit (uncrossed) to any sequence that ends in previous digit and last is either crossed or not crossed (but already has some crosses before). (it's sum of 2 and 3 in dp) also we multiply it both by 10 and add current digit respective number of times. Because if we have 3 sequences that end in previous digit and we can add new digit to all of them and and this will create 3 different combinations.

    And the answer is sum of all sequences where last index is crossed and last index is not crossed but it has some crosses before.

    I'm not sure that it helps anyone, but I was so glad this solution worked, so I couldn't help but share with you guys.

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

C is simple if you make AGP sequence using dp. I got this during last moment but implementation finally completed 5 minutes later Sad lyf.

For ith digit in the sequence how many times it is included is simply.

(i*(i+1))/2 *10^(n-1-i) *d[i] where d is digit sequence + .

(1*10^0 +2*10^1+ 3*10^2.............(n-1-i)*10^(n-i-2 ) )*d[i].

I hope the intented solution is similar.

PS : ACCEPTED ! 94711408

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

nice pretests on E, F

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +46 Проголосовать: не нравится
int a,b,c,d;
d =  a+b+c-1;
cout << d << endl;

1000000000 1000000000 1000000000
Unsuccessful hacking attempt
    Why? 
     |
     |
     v

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

The reason why we need testers — Codeforces Round 675

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

Can anyone give me an example where (a[i][j] + a[n-i+1][j] + a[n-i+1][m-j+1] + a[i][m-j+1]) / 4 will not be the best choice when both N and M are even.

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

Horrible pretests on problem A, I've already seen 5 submissions that shouldn't have passed systests get Accepted. For problems like this, where there are many, many solutions, why aren't the pretests adequately comprehensive to handle this?

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

I spent half an hour debugging before I realized that for B, you choose the median of the 4 numbers, not the mean... and I'm in AP Stats. rip.

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

    Yeah, its a while ago I was solving a problem that asked us to equalize all elements of an array where you could only use an increment. I misinterpreted it as equalize using either an increment or decrement. Broke my head for 15 min to either prove that it was equalized to median or most frequent element or avg, and gave up, only to realize I had read the q wrong. But luckily after the contest when searched up upon the misinterpreted problem, I found this — proof

    Happy learning!

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

Problem E: Test case 46 wrong answer 141st lines differ - expected: '430 hhccc...io', found: '428 ccccc...io' Isn't my string lexographically small ? 94701491

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

Problem A: When your all attempts' mistake was "int" instead of "long long"

4389192af8296910d732e82baa1778b2.jpg

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

In the 2nd test case of 2nd question if we convert the matrix to 4 3 3 4 5 6 6 5 4 3 3 4 its still following palindromic condition and we require 36 operation and 36<42 then is there some error..plz help

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

Wrong answer on problem E:

wrong answer 141st lines differ - expected: '430 hhccc...io', found: '428 ccccc...io'

Excuse me?

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

I am afraid of the round which affiliated with some local CP competitions.....

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

One of the worst div. 2 contests i ever written. Very huge gap between problems C and D. And problem F, seriously? Basic ST problem only for write two different STs without any idea, it is problem for educational round not for competitive. So upset that I only read this problem 7-8 minutes before the end and done it 30 seconds later contest ends :'(

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

wrong answer 141st lines differ — expected: '430 hhccc...io', found: '428 ccccc...io'

Why don't these two h need to be removed

test case 46

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

Can anyone please tell me what is wrong in this code for div2-C problem? i got WA on test 6.

94699300

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

wrong answer 141st lines differ - expected: '430 hhccc...io', found: '428 ccccc...io' can someone explain? Got it.explained in above comments.

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

Got a wrong answer on test 46 for problem E. wrong answer 141st lines differ - expected: '430 hhccc...io', found: '428 ccccc...io' How is the expected answer correct here? (hh should have been removed, right?)

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

Can anyone tell me why there are so many 'Wrong answer on test 46' for Problem E (including me,T_T)?

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

If you get WA on test 46 of problem E, this case may be helpful:

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

F for the bois, who thought mean would give the minimum number of operations instead of the median.

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

Problem D

in the input line, should it be :

1 <= n * n <= 10^9.

instead ?

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

94699532 why it give wrong answer on pretest 2 ?

Thanks in advance

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

I did a quick explanation of problem D — I don't do many of these, so let me know what you think!

https://www.youtube.com/watch?v=oJcU9RWnoU0&feature=youtu.be

(tldr: look only at "adjacent" nodes instead of full graph)

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

94699532 why I am getting wrong answer on pretest 2 in Problem B ?

Anyone explain me

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

In Problem D , can someone prove why just connecting instant location to all four adjacent sides will work ?

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

    (Incorrect sample, this only works for point->lines or point->rows or line->line or row->row... not point->point) Image that you are on the spot (0,0) and have 2 instant-moviments at spots (3,5) and (7, 8). If you add all forwards edges: - (0,0) -> (3,5) = 3. - (0,0) -> (7,8) = 7. - (3,5) -> (7,8) = 4.

    You can see that for all triple path xyz (with x->z greater than x->y), the total length will be x-> y + y-> z.

    Then, you only need add edges to the nearst spot.

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

Can anyone prove why the answer is the median of the 4(or less) elements in problem B?I googled it and used the function from here, but it doesn't explain this very well.

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

Thanks for these quality problems :)

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

Problems were very educational, Thanks.

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

Me: I have been doing competitive programming for 8 years

Also me: Use average instead of median in B (fortunately it was considered on the pretests c:)

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

Can someone tell me why this submission for F gives runtime error? I can't seem to find any overflows or index out of bounds

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

aropan Can you please help in providing test case 42/46 for problem E? If I understand correctly many people are struggling in figuring out that. Even from the comment section I am unable to find any suitable hacks for my solution. Would be very helpful if both the test case can be broken down in some smaller string and shared in the announcement or editorial.

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

Screencast of somehow managing to submit n^2 for C and failing E, with solutions for at least A-D

whatever, this comment will be buried anyway

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

Can someone plz explain where my code for problem C went wrong, i was able to pass the sample tests given in the problem. Thanks in advance and i wish you a +120 rating delta the next contest!

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

Bruh... My soluon for F got TLE during the contest's systests and AC during the upsolving. I didn't change a thing! Look at my two last submissions.

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

After debugging problem E for around 2 hours it's finally accepted :|
Yay me -_-

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

I'm totally surprised that my code for problem E passed pretests, and also worked for the first 85 tests in systest. I had at least 10 errors and typos (HUGE errors). I still can't believe what happened. This is what I get for using hashing, binary search and sparse table in a problem that can be solved using a stack.

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

What complexity was C supposed to be? I found an n^2 (n being number of digits) solution but didn't bother coding it cause I figured the complexity was too high.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -23 Проголосовать: не нравится
#include <bits/stdc++.h>
using namespace std;
int main(){
    while(true)
        cout << "So Bad !" << endl;
}
»
6 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

Problems were really good especially C. It was that type of problem which i had not solved in the past. Thanks codeforces for such contest. Hopefully , I am becoming specialist according to codeforces rating predictor.

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

Thanks for the round! Finally got Div 1 :D (exactly on edge, 1900)

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

In problem A, why isn't a+b+c-1 a possible answer ?

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

94730877 Problem B Can anyone help me to find the bug in my submission, thanks a lot~

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

Can anyone explain the problem A? I don't understand what it mean by "no three of its corners lie on the same line, and it does not cross itself".

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

If you search in Google "queries in range of lcm modulo", you can find a Codeforces blog in which an user asks for almost the exact statement of problem F from this round, and provides a link to the original problem

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

can we solve problem A by trying to give it a shape of trapezium? ceil(sqrt(a[0]^2+(a[2]-a[1])^2) a[] is sorted.

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

When will editorial be posted?

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

Can we solve problem C something like this?

    //dp[i][0] - possibilities with deleted substring ended before i
    //dp[i][1] - possibilities with deleted substring haven't started until i 
    //dp[i][2] - possibilities with deleted substring continuing.. from somewhere to i
    dp[1][0] = 0;
    dp[1][1] = (s[1] - '0');
    dp[1][2] = 0;
    for(ll i=2;i<=n;i++)
    {
        dp[i][0] = ((dp[i-1][2]*10 + s[i]-'0')%mod1 + (dp[i-1][0]*10 + s[i]-'0')%mod1)%mod1;
        dp[i][1] = (dp[i-1][1]*10 + s[i]-'0')%mod1;
        dp[i][2] = (dp[i-1][2] + dp[i-1][1])%mod1; 
    }

I know these are incorrect transitions , but can we solve this problem in this way (using these states)?

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

who can give me the solution?thanks a lot

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

Would anyone check my code for problem D? it's wrong on the 4th test case. 94750634 thanks.

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

for problem E, this input: aaffdfouurtytwoo shoudln't the lexicographically smallest longest suffix after the operation be dfortytw instead of aadfortytw? Can someone tell me where i misundertand the question? thx in advance.

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

why no editorial till now..

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

Can anyone explain my issue in 94735674. I save lcm of [i , i+2^j) in dp[i][j]. I also save the numbers with their factorized form.

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

Does anyone see why this doesn't even pass the sample test case 2? I seem to be following the same method as solutions, but I don't see what's going wrong.

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

Has anyone tried to solve the version of problem C in which you can delete any subsequence (not only consecutive elements)? At first I thought it was such variant and it turns into a cool problem too.

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

    Is it possible to solve this faster than O(n^2)?

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

      Yes, we can compute the value for each digit. We know that for a digit $$$a_i$$$ (1-indexed) we can choose $$$2^{n-i}$$$ subsequences to the left side (values with power of 10 greater than mine that do not affect my value), regarding the values to my right we know that depending on the number of values that we choose the power of 10 of my value changes, so we can calculate for every quantity we choose in $$$O(n)$$$ (we'll optimize this). The formula is $$${i-1 \choose 0} \cdot 10^0 + {i-1 \choose 1} \cdot 10^1 + \dots + {i-1 \choose i-1} \cdot 10^{i-1}$$$.

      If we simulate the first few values we can see that we get the drawing of the pascal triangle (It can also be seen through simply looking at the formula because each value of the row has a different power of 10). Using this fact we can imagine how we can build the $$$i+1$$$-th row based on the $$$i$$$-th. To do so we can 'shift' the $$$i$$$ left by multiplying it by ten and then add to last one, this way it is noticeable that the values of the $$$i+1$$$ are the sum of two consecutive values on the $$$i$$$ and it follows the recursion the pascal triangle is built upon.

      An argument could be made that when we take each value mod 10 and 'pass one' to the next power (because each item must have at most one digit, but in the pascal triangle there are terms with more than one digit) this idea would break but from what I've seen it (stress test) it doesn't and we can simply calculate this value by taking the correspondent power of 11 ('shifting' one by multiplying by 10 and adding the last one is the same as multiplying by 11). This way if we precompute the powers of 2 and 11 we can calculate the answer to every digit in $$$O(1)$$$ by $$$2^{n-i} \cdot 11^{i-1} \cdot a_i$$$, thus leading to $$$O(n)$$$. This specific problem didn't allow us to take the complete set but we can easily remove this single value in $$$O(n)$$$ too.

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

why editorial is not published yet

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

Can someone please tell me where did I go wrong in this solution for C?? I am taking left and right contribution of every digit but it just isn't working.

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

Eagerly waiting for the editorial of Problem F .

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

It's 10/6/2020 6:05 UTC, 30 hours after the contest, and no editorial is published. Shouldn't editorials be written well before the contest? Or is there some reason that you can't post them online?

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

Is there any possible way to estimate the number of spare nodes to declare when using Persistent Segment Tree ? Or to be exact the F problem, which turned out to consumed up to 4e7 nodes ?

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

When is the editorial coming? I really want to see Problem B and C as they were tricky. Tried looking at other peoples solutions, but cant get it

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

Since the round was nice and had interesting problems, they will destroy it by publishing the editorial when your spirit to up solve the problem and learn something new dies -_-

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

shall we even expect editorials for this contest?

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

I have an alternate solution to the problem C. My solution : Alternate Approach In this, I assumed dp[i] to be the required sum of the numbers if I consider first i digits of the number. Now, I have two choices either to include the last digit or not. If I include the last digit then the sum of the numbers will be equal to 10*dp[i-1]+(i*(i+1)/2)*(ith digit). Here i*(i+1)/2 indicates the number of times in which ith digit will appear in one's place. Now coming to the 2nd possibility, i removed the last digit and in the question, it is mentioned that we can remove a continuous segment so I will have to add all those numbers which will form upon removing the digits one by one from right to left. That value is val2 variable in my code. I used 0-based indexing!! dp[0]=1st digit.