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

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

418 I'm a teapot

Hi everyone! >///<

I'd like to invite you to Codeforces Round #418 which begins at 15:05 MSK on 7 June. Please note that the timing is unusual.

This is my first round here! KAN reviewed the contest and helped me through the preparation process, while Alladdin, FalseMirror and Tommyr7 tested all the problems, and MikeMirzayanov and the awesome Codeforces and Polygon platforms made all this happen miraculously. This wouldn't have been possible without your efforts!

The round is rated for the second division, and participants from the first division can take part out of competition. As usual, there are five problems and two hours to solve them. The problems will feature... Well, let's wait and see :)

The scoring distribution will be announced later.

Hope everyone few bugs and fair ratings. Looking forward to seeing you then!

UPD 1 Scoring will be 500-1000-1750-1750-2500. It's recommended to read all problems' statements so as to find the problems that suit you — we tried quite hard to make them clear and interesting.

UPD 2 The round is delayed for 10 minutes due to technical issues. Apologies.

UPD 3 System test is done. Congratulations to the winners!

Div. 2 Top 5

  1. memanon
  2. marmoset
  3. liu_runda
  4. yieldar
  5. Krydom_Yuudachi

Overall Top 5

  1. xumingkuan
  2. HellKitsune
  3. natsugiri
  4. yancouto
  5. irkstepanov

Hope you all enjoyed the contest. You all did a great job! The editorial is on the way, please be patient :)

UPD 4 For the impatient, here are the tutorials for problems A to C. More are coming!

UPD 5 The complete editorial is out. Cheers!

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

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

Is it rated?

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

выйду в div1, скриньте

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

Just in case anyone is scratching their head: https://httpstatuses.com/418

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

Возьму 156 место скриньте

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

why always scoring distribution is announced later ?

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

Hmmm... It seems like Alladdin and amethyst3 are brazzers

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

Hope to see a

NORMAL CF ROUND

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

As a tester, wish everyone good luck and have fun!

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

Haven't seen a Chinese round for ages. Cool.

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

Hope it could be easier than last Chinese Round

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

418 I'm a teapot so for this round you will enter as a normal water(current rating )and exit as hot water(current rating+154).

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

The time when the contest will be started it is 'Iftar Time' (Fast Breaking Time) for Muslim in southern Asia. It will be better and helpful to us if the contest starts an hour later from that time. cyand1317

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

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

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

Have you noticed that the round number is the reversed contest number ?

Contest number is 814 and the round number is 418.

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

Problem C and D have the same score!Amazing!

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

A 1750 C always makes me upset :(

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

Data structures and Constructive algo related problems may be exist in today's round...mathematical term too :)

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

10 min extensions seems to be a template.

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

Contest extended by 10 mins ... :)

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

contest delayed?

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

10 minutes fact!!!!!!!!!!!!!!!!!

Coding ended(Ramadan and Iftar fact).

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

Everytime :(

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

Contest Delayed , Maybe a good time for more contribution .

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

It won't be a normal Codeforces round if it is not delayed :D

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

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

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

10 minutes delayed???

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

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

A Codeforces contest really cannot be regular without a 10 minute delay, can it :)

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

clicked 'ok' to go to contest arena and then 10 minute delay!

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

Show the time of the contest 10 minutes later so then u don't have to delay it every time !

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

why there's always 10 minutes delay?

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

10 mins again

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

10 minute delay is a tradition now in Codeforces

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

May I ask, what kind of of technical issues causes delay by 10 mins?

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

A ten minute delay for me to make a beverage, thank you!

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

6000 People registered for the contest. 10 minutes delay means 6000*10 minutes = 1000 hours = 41 days of their life. Just saying. Waiting sucks.. :(

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

normal codeforces round = The round is delayed for 10 minutes due to technical issues

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

It's about Monogatari! Now it is somewhat interesting. 8-)

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

Anyone else facing the issue of getting logged out constantly? I had to login at least on five separate occasions during the contest. Not complaining, genuinely want to know whether mine was an isolated case or not.

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

this B made me crazy
waiting for the end of contest to see test 6

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

In problem C, n*q should pass but my solution got TLEd on pretest 10. :/ why?

I used sliding window, total operations 2 * 1500 * 200000 = 6 * 108

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

What is intended complexity of B solution? I solved it in O(n) and now i'm scared that i've missed something.

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

And how to solve D?

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

    Not sure if I will get AC, but I constructed a tree, where x is parent of y if circle y is inside x. Then dp: f[u][x]=maximum area of subtree u if there are x nodes in the first set.

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

what is generator command line argument ??

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

Is the following solution to D correct? It passed pretests, but I'm not entirely convinced. If circle is inside odd number of circles or 0 circles add its area, else subtract its area.

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

Great round!

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

I must be misunderstanding problem C. Can someone explain to me why this solution is wrong?

For each subsequence of s and each character c:

  • moves = count of c in subsequence
  • best[c][moves] = max(best[c][moves], length of subsequence)

Then for each query (m,c) just output best[c][m].

I'm pretty sure my code has no bugs but I keep getting WA on pretest 7.

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

I solved B but i'm interested how did you guys solve it??

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

Yeah, it's time to compile error in 20 seconds before the contest ends(27649694).

The reason was that locally I have kotlin 1.1, but cf has only 1.0. Comp error appeared twice in this contest. So sad =(

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

What is solution of Task C? I think there is pre-calc and DP, but what is rule for dp of this problem?

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

Thank you Chinese for this round :D

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

Как решаеться задачa С

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

Very fast System testing!!!

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

I was logged out several times (using google account) which is not nice. Please fix it!

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

What's the intended solution for E? I drafted a O(n^4) (roughly) DP solution for it yet somehow it fails me even on the sample test cases. :/

http://ideone.com/kOBovo

Edit: nvm, I am completely off the track.

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

RIP B

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

What is f**cking going with cf? Why I'm loosing task because of compilation error with "M_PI" in GNU C++14, although it's work on my compiler, which is GNU C++14 too?

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

I can't understand why Reyna solution 27632209 for problem A got WA?!!!

Checker comment Can't find file C:\Contesters\Work\invoker-prod\work\codeforces2\e034999a3f1f1dd18b018c40c84c8c46\check-f7e8e87d48909eaa32eeaee49e520cf4\run\output.fd0138e687.txt.

What is the meaning of that?!!

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

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

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

why i got a wrong answer like this?

Can't find file C:\Contesters\Work\invoker-prod\work\codeforces2\838e4a3610786f013367ecfa30b8ac63\check-b58f02c6459228487139e47a79e2e72e\run\output.fd0138e687.txt.

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

What was the approach to solve problem B?

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

    Just split in two cases, one with only one number who differs, and another with two, use a set in the first case (you need to know the number who is missing) . And in the second case, generate the two possible vectors and use two sets, insert each vector in a different set, and print the one with setsize == n.

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

    ok, at first, there is a simple observation. a and b can only have at most 2 different positions where the numbers aren't same. So you should think of these 2 cases.

    Case 1 : Only 1 different position(Sample testcase : 3) Here, u should check which is the missing number from 1 to n, and put that into that position

    Case 2 : 2 different position (Sample testcase : 1, 2) Here, there should be 2 missing numbers from 1 to n. try putting them into those positions and see if the permutation is valid. One of them will be valid and that's your answer

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

After seeing the system test, I wish I worked on hacking B. I saw no one was hacking B and thought maybe those pretests were quite good. Alas!

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

Why does greedy approach work in D? In each step of dfs(start from outer circle) try to put new circle to part where it gives positive area. http://codeforces.me/contest/814/submission/27649536

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

What was wrong with test case 22 in B? My output seems to be correct? :/

http://codeforces.me/contest/814/submission/27638764

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

How my code for Problem C got accepted? I made ans[2000][26] in my code and i was using ans[x][26] in my code. (Due to linear storage of data in cpp? )

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

Can anyone tell why my C fails? Thanks a lot.

Basically for each alphabet I created a vector of <Cost, Profit> where Cost number of color is to be recolored and that would result in a subsegment of that color of at least length Profit. And for each query I just find the upper bound base on m and calculate the answer.

http://codeforces.me/contest/814/submission/27647932

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

Rating update please. I will be expert for the first time :)

It is really very good feeling!

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

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

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

didn't know CF compiler was so fast that it would support complexity of O(2e5 * 1e3) or O(n * q) for C

»
9 лет назад, скрыть # |
← Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится
please help me to understand the below solution has loop as (in main()) for(w=1;w<=9000000000000;w++)  {  r=r+2;  } even then why its not giving TLE? 
link here
»
9 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Pretest so weak, FST so much . TnT...

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

Please note that the ratings are not final now and are going to change a bit because of the issue with a couple of submissions. We will rejudge them and update the ratings, don't worry.

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

Did anyone else assume the garland to be circular. :(

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

This is the biggest increase of rating ever in codeforces Right ???

This is the biggest increase even after he was hacked on A and B.

(If you can't see the photo click here)

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

    Well this is weird ... on Mhammad1's profile it shows that his rating change is 803 but on the friend's rating change list it shows that his rating change is 681 ... is this a bug ???

    On the friends rating change list it shows that his rating before the contest was 100 but it actually was -22 ???

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

Please Help! Why does testcase 6 fail? Submission

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

Ребят обьяснити почему во 2 задаче к тесту 4 3 2 1 3 4 2 1 2

не подоходит вариант 4 2 1 3

у меня это выводит он вроде правильный а засчитали как неправильный

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

I solved the D without DP and it worked. code

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

For question B, I ran my code in c++14, it gives the wrong answer on test 39 but the same code i tested on c++11 (also on my machine), it gives the correct answer. If is a cf bug? here is my code http://codeforces.me/contest/814/submission/27655109.

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

    In the function findNum, you check temp[i] != 1 without previously initializing the temp array. So it's up to the compiler to initialize that array with anything (even 1s). The same solution with explicit initialization passes in C++14: 27657207

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

The first letter of the second word of the problems' name are "aeiou", and prepositions are also different. Interesting name ~ :).

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

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