radoslav11's blog

By radoslav11, history, 2 years ago, In English

We invite you to participate in CodeChef’s July Cook-Off, this Sunday, 3rd July , Rated for All. Time: 8:00 PM — 10:30 PM IST

Joining me on the problem setting panel are:

Also, if you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here. Hope to see you participating.

Good Luck!

  • Vote: I like it
  • +74
  • Vote: I do not like it

| Write comment?
»
2 years ago, # |
  Vote: I like it +27 Vote: I do not like it

As a setter, I setted.

»
2 years ago, # |
  Vote: I like it +6 Vote: I do not like it

Is there something wrong about test case of segmentation fault (div2C)?

»
2 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Nice, balanced contest. Thank you! Let me give some feedback for div1:

I only read (and solved) three problems, so will be a bit limited.

segfault: nice, easy problem. Mostly implementation, but requires a bit of thinking if you want to do it without pain.

LCM: A typical "random math" problem where you bruteforce the thing to see the pattern immediately without too much thinking. Not a big fan of those, but the pattern was somewhat surprising... Handling the case of all equal numbers in the sequence was super easy once I realized how to do it nicely, but took me ages to arrive at that conclusion. I liked how it wasn't "bruteforce then trivial", definitely a nice problem (although I was a bit annoyed at the start with "yet another bruteforce").

PQ: the idea is quite obvious, mostly an implementation exercise. I believe standard problems should appear in contests, so happy to see it. Even though it wasn't particularly brilliant.

Overall, I liked my first contest after a couple months. I was happy to see that only one of three problems I read were combinatorics, I'll consider coming more often :)

  • »
    »
    2 years ago, # ^ |
      Vote: I like it +16 Vote: I do not like it

    Thanks for the feedback! Really appreciate it.

  • »
    »
    2 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I thought about Subsequence LCM like this:

    Let R[i] = a[i]%M where [l,r] is the range of indices of the subarray and r-l+1 = M.

    Case 1: Let LCM(M,a[i])-a[i] = k; if R[i] = 0 for some i in [l,r] then then LCM(a[i],M) = a[i] => LCM(a[i],M)-a[i] = k = 0 => all elements in the subarray must satisfy LCM(a[j],M)-a[j] = 0 => all elements in subarray are multiples of M

    Case 2: if there is no element for which R[i]=0 then by pigeonhole principle at least 2 elements in the subarray must have same remainder with M. Let a[i]%M = r and a[j]%M = r. GCD(M,a[i]) = GCD(M,r) and GCD(M,a[j]) = GCD(M,r) let the common gcd be g.

    Let us assume the subarray satisfies the condition LCM(M,a[i])-a[i] = LCM(M,a[j])-a[j] =>(a[i]*M)/g — a[i] = (a[j]*M)/g — a[j] => (M-g)*(a[i]-a[j]) = 0. Since we assumed remainder!=0 for all elements, M !=g =>a[i]=a[j] Hence all elements must be equal

»
2 years ago, # |
  Vote: I like it +20 Vote: I do not like it

Who approved div1 A and B :cringe:

»
2 years ago, # |
  Vote: I like it +6 Vote: I do not like it

Contest was nice. Also I have a small question to codechef admins.. In some codechef contests it shows which test cases are accepted and which are not. But today it was giving verdict only "accepted" or "Wrong answer" not showing the label of test cases which are accepted and which are not.

  • »
    »
    2 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    The testfile-wise verdicts are shown in Subtask-type problems. Currently, Cook-Offs are the only contests which are not Subtask-type. So you can see the file-wise verdicts in all other contests, but not in Cook-Offs.

  • »
    »
    2 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    It's because of the format of the contest. Generally cookoff are ICPC styled where you will just get the feedback (AC/WA/RE etc). In Lunchtime/starters/Long you see the verdict of each test case

»
2 years ago, # |
Rev. 2   Vote: I like it +36 Vote: I do not like it

Thanks for the contest, I liked the problems. But, why so tight constraints for LCMSEQ?

»
2 years ago, # |
  Vote: I like it +16 Vote: I do not like it

Congrats everyone ! Hope you liked my problem ( median pairs ), and to see you participating tomorrow in Codeforces round #804!

»
2 years ago, # |
  Vote: I like it -8 Vote: I do not like it

Although this is completely irrelevant to the above post(apologies in advance) !! I needed a little help in this !!! I ran my code (https://mirror.codeforces.com/contest/1185/submission/162667577) across various other compilers and I am getting the expected output but for some reason, my code is not getting any output on the codeforces compiler, is it some compiler error or any other(extremely silly) error in my code?? A little help will be much appreciated!!

  • »
    »
    2 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Your pre_sum is out of bounds for i == 0 and .size() method returns an unsigned integer so you need to typecast it into integer.

»
2 years ago, # |
  Vote: I like it +11 Vote: I do not like it

Enjoyed the problemset although managed to solve only 3.Can someone provide a hint for STRBRK?

»
2 years ago, # |
  Vote: I like it +29 Vote: I do not like it
Thanks for the contest. Brilliant problems A and B! (especially B)
»
2 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Any similar problem to PQ? (Link)

»
2 years ago, # |
Rev. 3   Vote: I like it -6 Vote: I do not like it

CodeChef_admin Enjoyed the problems. Could solve first 2 in div1. The problems A and B were bruteforce and really liked implementing them. But the constraints were really tight for problem B.
Really enjoyed the contest. Hope we can have more Div 1 contests rather than lunchtime and Cook-off only.

  • »
    »
    2 years ago, # ^ |
      Vote: I like it +9 Vote: I do not like it

    Do you also cheat on Codechef or did you solve them by yourself?

»
2 years ago, # |
  Vote: I like it +1 Vote: I do not like it

It was a nice contest with great problems,Thanks.