LMydd0225's blog

By LMydd0225, history, 3 hours ago, In English

2007A - Dora's Set

Hint 1
Hint 2
Hint 3
Tutorial
Implementation

2007B - Index and Maximum Value

Hint
Tutorial
Implementation

2007C - Dora and C++

Hint1
Hint2
Tutorial
Implementation

2006A - Iris and Game on the Tree

Hint1
Hint2
Hint3
Tutorial
Implementation

2006B - Iris and the Tree

Titbits
Hint1
Hint2
Tutorial
Implementation
Bonus

2006C - Eri and Expanded Sets

Hint1
Hint2
Hint3
Tutorial
Implementation - two pointers
Implementation - sparse table
Bonus

2006D - Iris and Adjacent Products

Hint1
Hint2
Hint3
Tutorial
Implementation

2006E - Iris's Full Binary Tree

Hint1
Hint2
Hint3
Hint4
Hint5
Tutorial
Implementation

2006F - Dora's Paint

Here're two methods. Method $$$1$$$ is my method, and method $$$2$$$ is some testers' method.

Method 1:

Hint1
Hint2
Hint3
Hint4
Hint5
Tutorial
Implementation - method 1

Method 2:

Hint1
Hint2
Hint3
Hint4
Tutorial
Implementation - method 2
  • Vote: I like it
  • +40
  • Vote: I do not like it

»
3 hours ago, # |
Rev. 5   Vote: I like it 0 Vote: I do not like it

Congratulations Tourist for crossing 4000 rating!

»
3 hours ago, # |
  Vote: I like it +28 Vote: I do not like it

Congratulations for tourist for reaching $$$4000$$$ rating, which is the highest rating on Codeforces ever! I'm proud to see that in my contest!

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

Thanks for the quick Editorial and congratulations for tourist for reaching $$$4000$$$ rating! I can't to believe that, but that's true!

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

Can someone suggest me what minor changes should be done in this submission-278848822 so that it passes 5th case without TLE !! Thanks

  • »
    »
    3 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Your solution's time complexity is O(m*n), which exceeds 10^8. Instead of updating the entire array, update only the maximum value as explained in the editorial.

  • »
    »
    3 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You are basically brute forcing on entire array for each operation. Basically you have time complexity of n*m. Instead there's a hack that you don't need to update whole array for each of m operations. Instead maintain a maximum element value and update it each time.

»
3 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Instead of solving div1B I solved the bonus mid-contest O_O

»
3 hours ago, # |
  Vote: I like it +6 Vote: I do not like it

»
3 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Probem A

void solve(int T)
{
    int a, b;cin>>a>>b;
    if(a&1)a--;
    cout<<(b-a+1)/4 <<endl;
}
»
3 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

I can't believe i solved B with relative ease but took 4-5 attempts for A, am I the only one who found A that hard? :(

If i was able to solve A rather quickly I would have probably solved Div. 2 C for the first time :(

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

I have a very stupid question in problem C

Xa+yb = S
if(gcd(a,b)) == 1 
then there is a combination. 

but what if this combination has a negative number like X is negative then what ?

  • »
    »
    3 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Read Hint 1. As it is mentioned, if you add $$$a$$$ or $$$b$$$ to all the elements except $$$c_i$$$, it is the same as decreasing $$$a$$$ or $$$b$$$ from $$$c_i$$$. So it doesn't matter if $$$X,Y$$$ are negative.

»
101 minute(s) ago, # |
  Vote: I like it 0 Vote: I do not like it

nice set, liked Div1 A,B,C

»
88 minutes ago, # |
  Vote: I like it +3 Vote: I do not like it

LMydd0225 In Div1 D, when you rewrite the condition as $$$cnt(1,i)\geq cnt(\dots,n)$$$ should not be $$$k$$$ instead? and second, array $$$[k,1,k]$$$ doesn't fullfill $$$cnt(1,1)\geq cnt(\frac{k}{2}+1,k)$$$