O--O's blog

By O--O, history, 2 years ago, In English

Hello, Codeforces!!!

Here's the invitation link of our discord server for contest discussion and announcements.

We are happy to invite you to TheForces Round #5 (PerfectForces), which will take place on [contest_time:425963]

You will have 2 hours to solve 7 problems

Thanks for participating.

Winners are:

  1. AndreyPavlov
  2. IzhitskiyTimofey
  3. siganai
  4. TyroWhizz
  5. DrearyJoke
  6. Svyat

Editorial

Solutions are opened.

Here is a group archive of our previous contests

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

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

I am waiting for nice problems!

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

[Deleted]

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

is it rated? or just for practice purpose.

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

thanks for helping the community

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

i am not able to register

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

    Maybe something went wrong. Everyone can register.

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

am I alone who received browser alert with this blog entry?

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

what's the expected complexity of the round? like div2?

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

Did you like the contest?

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

How to solve F?

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

    Hint: 2 * 3 * 5 * 7 * 11 * 13 * 17 * 19 * 23 has 512 divisors

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

How to solve Problem B Cube Sum for Perfect 100 points

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

    Prefix sum + Binary search after precalculation upto 1e6.

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

    Precompute the cubes of each numbers till 1e6 and also store prefix sum of the cubes. Now for query part use binary search to find indexes of l and r in cubes array and use prefix array to find the sum.My solution

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

    $$$1^3 + 2^3 + ... + n^3 = (\frac{n * (n + 1)}{2}) ^ 2$$$

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

      Yeah I have also come up with this formula but it was running for only samples :(

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

        It works!

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

    Take the cube root of l and r , let it be lc and rc respectively. Then required ans is (rc*(rc+1)//2)**2 — (lc*(lc+1)//2)**2 . As sum of cubes from 1 to n is (n*(n+1)//2)**2 .

    My Code :


    def perfect_cube(n): x = int(n**(1/3)) while True: if x * x * x <= n: break x -= 1 while True: if x * x * x >= n: break x += 1 return x - 1 def is_perfect_cube(n): x = int(n**(1/3)) while True: if x * x * x <= n: break x -= 1 while True: if x * x * x >= n: break x += 1 return x * x * x == n mod = int(1e9)+7 for _ in range(ii()): l,r=li() lc,rc=perfect_cube(l),perfect_cube(r) if is_perfect_cube(l) and is_perfect_cube(r): # lc+=1 rc+=1 elif is_perfect_cube(r) and not(is_perfect_cube(l)): rc+=1 # print(lc, rc) # lc-=1 ans = ((pow(rc*(rc+1)//2,2,mod)%mod - pow(lc*(lc+1)//2,2,mod)%mod)%mod) print(ans)
»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Why Pratice Mode isn't enabled? I had to give virtual contest to submit $$$G$$$. I failed G by few minutes :(

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

    Anyways... Nice Problems. Enjoyed solving G :D

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

      how to solve F

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

        I precomputed primes upto 1e7 using Linear seive. and made a set of pairs $$$($$$ no of divisors, smallest number $$$)$$$ and did a single loop [upto 1e7] and taken the number into account, whose no of divisors are greater than max no of divisors present in the set.

        Code

        Submission

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

Thanks a lot for the contest bro, I really liked it. I'd recommend you make a facebook page where you can announce the contest date.

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

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

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

can you guys please make a discord server or some other type of group that we can join so that we get notified ...as most of the times blogs don't show up and we miss these contests

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

It is very hard to participate in your rounds i am very active on codeforces but still could not see your blog.

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

Very interesting gym, enjoyed it. Thanks to the organizers. If they need tester, I would help them with pleasure (never was tester before).