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

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

Hi Codeforces!

Programming Club, IIT Indore and Euristica 2018 are proud to present our flagship event, Divide By Zero! The contest will take place on Saturday, 7th April at 9:35PM IST.

Prizes : Codeforces T-shirts for top 15 participants overall and top 15 participants in India.

Thanks to the following people for making the round possible :

There are 8 problems, and 2.5 hours to solve them. The points distribution will be updated later.

Euristica, sponsored by Arcesium is the inaugral Programming festival of IIT Indore. It comprised of 10 events this year, spanning across various domains like Competitive Programming, Application Development, Cyber Security and Machine Learning. For more information, visit www.euristica.in .

Hope you guys enjoy the contest! See you on the leaderboard!

UPD: The scoring distribution is 500-1000-1500-2000-2250-2500-3000-3500.

UPD 2: Do give your feedback here : https://goo.gl/forms/xbsdMxnkA3XsG4092. Would love to hear your feedback, since that would help us get better!

We hope you guys enjoyed the contest and found the problems interesting.

UPD 3: You can find the editorial here.

Here are the list of winners who won Tshirts. We will contact you guys soon. Congrats!

Overall Top 15:

  1. EvenImage

  2. Benq

  3. Syloviaely

  4. ainta

  5. ko_osaga

  6. dotorya

  7. Um_nik

  8. uwi

  9. izban

  10. SpyCheese

  11. dreamoon_love_AA

  12. ilyakor

  13. chemthan

  14. JOHNKRAM

  15. eddy1021

Top 15 in India:

  1. gvaibhav21

  2. pranjal.ssh

  3. Baba

  4. yashChandnani

  5. teja349

  6. jtnydv25

  7. ajinkya1p3

  8. polingy

  9. hitman623

  10. GT_18

  11. Equinox

  12. sinus_070

  13. Shivram

  14. abisheka

  15. nishant_coder

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

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

I think it will be funny, thank you.

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

First palindrome lucky round of 2018! Sounds good

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

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

All Divide By Zero rounds:
--------------------------------------
2013
2014
2015
2016
2017
2018

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

All number is not able to divide by zero except these number 2013,2014,2015,2016,2017 and 2018.

So the divisors of zero are increasing year by year. :D :D :D

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

I hope one day i will get a T-shirt from Codeforces, I think it will be the best gift ever

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

Hope all the problem statements will be short and Contest will be enjoyable. :) :)

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

We have solved A & C & D of last Div.2 Round[#473] in videos

A : https://youtu.be/CClZZPYJmaI

C : https://youtu.be/bvDYHy9ESnY

D : https://youtu.be/d3iyS6rnuEM

Wait us for more videos after contest

https://www.youtube.com/channel/UCmWvb73kIq_oRThWd05Mtfg

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

Rated?

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

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

See you in the leadboard ! So let's paying for a miracle

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

I must choose "Divide by Zero or Manchester's derby!".

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

Should I watch IPL or participate in the contest? Help me!

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

The problems distribution?

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

What's wrong about the problem statement?

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

Hack page is not loading for me

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

why is it so difficult to check the problem statement for the first task? can I get my hacked attempt points back?

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

Will the round be rated?

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

In my opinion, E and F are too standart, maybe they would be better for educational rounds.

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

Thank you for the round with hacks. It was very interesting!

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

In problem C, I realized c[0] = c[1] is possible after locked..

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

How to solve D?

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

how to solve B?

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

    If instead of keeping ai and bi, we keep ci= | ai — bi|, then our task is to use k1+k2 operations to reduce the cost. So you'll go through the array, find the maximum and decrease the value by 1. If all the elements are 0 it means that you are in an optimal point and the way to go from here is to add 1 and then decrease 1 to the same position up until you don't have any operations left.

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

    Make a priority queue of the biggest differences between a and b. You can use the greedy approach then : just reduce 1 from the biggest difference that exist (i.e. remove biggest element from pq, reduce it by 1, and add the reduced number to the priority queue)

    If the priority queue becomes empty while you still have attempts, the minimum result will just be number of remaining attempts modulo 2.

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

      Why are we always reducing 1 from the biggest difference ? Why can't we reduce 1 from smaller difference ?

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

        since what counts is the square from the difference, it's always the biggest one that will give the biggest reduction : the reduction of a difference d gives a reduction in total points of :

        d²-(d-1)²=2d-1

        which is an increasing function in d (except for d=0 which is a special case), so it's always better to reduct the biggest difference first.

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

C?

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

    If you keep a sequence that is all 1's (ie 1 1 1 1 .. 1) the cost is 2^(no of 1's)-1. So you're going to find the largest k so that x>= 2^k -1 and then decrease x by 2^k -1 and add k equal values to your solution. You just have to be careful because the last k values should be larger than the others by at least D.

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

What is the hack for C?

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

Is there an easier solution for E other than 3 dp's?

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

how to solve C ?

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

    the sequence of length n contains 2^n-1 sequences. Hence, the number X can be decomposed into powers of two minus 1. The degrees of the twos in this decomposition are the lengths of the sequences to be used. The degrees of the twos in this decomposition are the lengths of the sequences to be used. Collect on parts. The final sequence will look like:

    1,1,1,....,1+(d+1),1+(d+1),....,1+(2*d+1),1+(2*d+1),...where the number of identical terms is equal to the powers of the twos to which we decomposed X.

    If the number X cannot be completely decomposed into (2^i-1), then at the end of the answer it is necessary to add Another f distinct numbers, each of which will increase from the previous one by d+1.

    Do not forget to take into account that the length of the answer should not exceed 10000

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

Why is this simple dfs going TLE?

Source

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

Putting only case where sum of Vi is 0 in E's pretests...

Anyway, how to solve G? And is there any technique to deal with counting permutation?

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

Anyone knows Pretest 4 of question D

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

it really feels good to see my mistake in c after 1 min from the end of the contest

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

Initially the text in the problem did not appear properly, but surprisingly few were able to solve before it appeared properly.

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

Is NTT a must in problem G or it can be done with FFT? Or does it have some simpler solution?

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

    There is a work around to do FFT under large Modulo. But in this problem it might be risky, as it is time consuming. The idea is -
    Lets take C = 30000. Now partition each number A(x) as Ca1i + a2i, and B(x) as Cb1i + b2i. Then convolute P = a1 × b1, Q = a1 × b2, R = a2 × b1, S = a2 × b2.
    You can get the final result as (A × B)i ≡ C2pi + C(qi + ri) + si (mod M). It works because no number while doing fft corsses NC2 and fits into precision. But you can't do fft directly into the main polynomial, then a number can be atmost NM2, and that will overflow.

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

How to solve F?

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

"Вам нужно выбрать путь (возможно, проходящий по одному и тому же ребру или вершине несколько раз)"

"You need to choose a path (possibly passing through same vertices multiple times)"

Почему в условиях на русском (т.е. в переводе) внезапно появляются дополнительные условия? Без переключения на английские условия было непонятно, то ли веса на рёбрах должны неубывать (и рёбра могут повторяться), то ли должны строго возрастать (и рёбра повторяться не могут). Ну то есть, как так получилось?

В задаче A, возможно, была та же проблема про уточнение того, что начальная строка может быть пустой (либо это исправили в момент, когда я переключился на английские условия).

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

The point distribution is really unfair. I mean 2500 for F and 3000 for G, when there is a huge difference in difficulty :/

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

Is it rated?

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

What is the problem with this code?:(37063101

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

How Tricky!!

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

G : https://www.youtube.com/watch?v=E-i5nrl4SaI + https://www.quora.com/How-can-I-calculate-the-Stirling-numbers-of-the-first-kind. First was one of our icpc practice (and actually a famous DP practice problem, for a lower constraint), and second was pure googling.

To be honest, I still don't know what's the "First kind of Stirling number". It's always so fun to get a rating that I don't deserve!

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

Can someone point out what's wrong with my code for B? I still can't figure what did I do wrong.

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

37063254 Can anybody tell me what is wrong with this one?:)

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

what's the test 18 for E?

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

Laughed over people who get WA because of long long in B and made myself the same mistake in C. Stupid karma.

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

You really did intentionally generated pretests in E having zero sum over all vertices to break solution that don't consider zero-length pathes.

Welcome to the faggots club :\

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

@CF :((

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

My solution of F fails(returns 2) on this test:
3 2
1 2 1
2 3 1
But got accepted! :-?

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

Problem D was really a very interesting problem.

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

Not that I'm complaining, but this solution 37079339 for G passed all tests (3493 ms), while on test "100000 32768 32768" it works 4461ms in "Run On Server" tab. It is strange not to add such a test, given that 2n - 1 is the worst case for logarithmic exponentiation.

(if anything, I'd complain about such an ambiguous TL, which allows to pass only some of the solutions)

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

For the 3rd question I assumed that the elements of the array should be distinct and then for next 1 and half hour I was busy solving the question,also with 3 failed pretest.Later Did I recognised that no-where it was mentioned that the element should be different. Feeling so stupid.

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

Ok contest, the problems were kinda standard-ish, but at least the pretests and tests weren't dumpster fire quality and everything that needed to work (server) worked. sebinechita could learn from this.

F was way, way too easy. It's LIS, just with a graph, and it's solved exactly like LIS, just with a graph. I spent about 10 seconds thinking about how to solve it. It would've been better to use something with difficulty between E and G rather than below (this) D.

My rating increased! by 2 points

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

Top 15 Indians:
gvaibhav21
evil666man
Baba
yashChandnani
teja349
jtnydv25
ajinkya1p3
polingy
hitman623
GT_18
Equinox
sinus_070
ShivRam
abisheka
nishant_coder

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

i think problem D E and F have same diffilculties

nice problem and rapid rating update anyway

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

IN PROBLEM "A" it is written that-> " they have made sure that at this point, at least one 'a' and one 'b' exist in the string." how have they given test case with only bbbbbbbbbb!!! this seems unfair

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

Can anyone tell me what's wrong in my solution 37078196 for D. And why commenting this line gives AC. m=m-(pow(2,t1));

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

Got wrong answer in Problem C pretest 1.

vector < int > v = {1, 2, 3}; printf("%lld\n",v.size());

Output in codeforces ( GNU++11 5.1.0 ) : 55834574851

output in my pc ( g++ follows c++11 ) : 3

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

    You can't print a variable of data type size using printf and %lld, you should cast it to long long first or use cout

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

    With printf you need to be very careful about types. If you give the function a parameter of the wrong type, it will print garbage.

    And here is the problem. The size of the type of v.size() is not standardized. It doesn't have to be a 64 bit integer (although g++ will usually use 64 bit). However Codeforces uses a g++ compiler where v.size() is only 32 bit.

    Solutions: cast the variable to a long long, or simply use cout << v.size() << '\n'; :-P

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

      Or use %zu to printf a variable of type size_t (which is the return type of vector::size).

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

      The size of int, long and long long isn't standardised either. The C standard only requires that they're enough to hold specific ranges. In the same way, size_t only has to be able to represent the return value of sizeof().

      Different types are differently represented in memory, and you should be very glad implicit type conversions exist in the simplest cases at all (casting a 4-byte int to an 8-byte long long could give you 4 bytes of garbage, but it doesn't).

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

When will we get the Editorial of this contest?

TIA. :)

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

During the contest my code for D kept getting TLE. Now it's AC in 2 seconds. The servers are really unreliable; I had to spend a bunch of time optimizing AC code with good complexity. :/

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

This was an amazing contest! When will the editorials be published?

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

How Solve E?

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

I saw many of my friends AC 4 problems but fst 3 of them! I have too say E and F are too standard ,Why don't put int the Education contest!?

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

where is the editorial??

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

Hey guys!

Before the official editorial comes, here are some of my thoughts on problem A, B, C, D, F: RobeZH Blogspot Article

I am glad to hear any suggestions or questions! Thanks!

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

problem F http://codeforces.me/contest/960/submission/37093065
KAN this solution got accepted but fails on this test case
4 5
1 2 3
2 3 4
3 3 5
1 3 5
3 3 6

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

I gotta a native question that hou can I get purple? Desire to improve my ability of coding...

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

    It is not the right place to ask such question. If you search on google, you will find plenty of posts regarding such question and replies on Codeforces and Quora. If you still think that you need to ask something regarding this, you may create a blog post on codeforces or ask on quora.