maroonrk's blog

By maroonrk, history, 3 weeks ago, In English

We will hold AtCoder Regular Contest 148.

The point values will be 300-500-500-700-800-1000.

We are looking forward to your participation!

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

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

It seems that C is easier than last one. I'll try to solve more problems. rating++

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

Hope cross 1000 and A~C!

Although I usually get AB or only A.

»
3 weeks ago, # |
  Vote: I like it +7 Vote: I do not like it

Hope the contest is great!!!

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

In the front of the support!

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

rp++!

»
3 weeks ago, # |
  Vote: I like it +1 Vote: I do not like it

Easy ABC! I can get higher rating. Thx problem provider.

»
3 weeks ago, # |
  Vote: I like it +14 Vote: I do not like it

In fact,I think B is easier than A...

(Maybe I'm strange.

»
3 weeks ago, # |
  Vote: I like it +39 Vote: I do not like it

Atcoder modulo contest

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

D is a good problem!

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

i didn't solve C,how weak am i!

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

In A, why is my submission giving WA: https://atcoder.jp/contests/arc148/submissions/34801963

I am checking all the prime factors of a[1]-a[0] to be the possible candidates for M. And I have also handle all equal case

  • »
    »
    3 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    4
    5 5 15 20
    
  • »
    »
    3 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    why dont you try to get gcd of all adjacent number instead. Since a[i] mod x = a[i+1] mod x then (a[i+1]-a[i]) mod x = 0

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

during contest: hmmmmm F should be either montgomery reduction or barrett reduction but idk how to implement either......

after reading the editorial: I KNEW IT

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

Like, D can be solved without bipartite graphs. Just record the frequency of all numbers and then do some case processing.

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

Guys, how to stop writing artificially complicated solutions? Almost every time I try to solve a problem, a lot of hard solutions come to my head. How to write simple solutions, how to come up with such ideas? I will be glad to all your advice!

P.S.: Look at my ARC148 problem A solution to understand my "skill" of complicating solutions: https://atcoder.jp/contests/arc148/submissions/34792833

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

Where is E and F's editorial?

»
3 weeks ago, # |
  Vote: I like it +8 Vote: I do not like it

Could you check this solution to problem E or give a hack to it:

https://atcoder.jp/contests/arc148/submissions/34801743

Thanks very much!

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

Can problem B be solved in O(N) using idea of KMP or some other algo?

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

    I tried to find the substring to reverse by searching the lex max postfix (of the substring starting at the first 'p') using suffix_array(). That would be O(n log n)

    But for some reason that did not worked.

»
3 weeks ago, # |
  Vote: I like it +45 Vote: I do not like it

Are the tests for problem D a little bit weak?

https://atcoder.jp/contests/arc148/submissions/34790673 will fail on 2 16 0 1 2 3

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

Anyone please explain Problem C's approach.
Thanks in Advance

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

    Mark all the vertexes from query. Then iterate over them. Add to ans amount of descendants of current vertexes because they should be picked if they are not marked. And 1 to ans if parent is not marked else substract 1.

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

Can anyone explain D? Can't understand from editorial.

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

This submission for C has a complexity of $$$O(N^2)$$$ yet passed. It can be hacked by :

Input
Output
»
3 weeks ago, # |
Rev. 2   Vote: I like it +12 Vote: I do not like it

Thanks for participating, hope you enjoyed the problems!

After the contest, we found a more intuitive solution to the problem F from the participants' submissions. Briefly, we can compute ab / 1000000007 by using 996491781/998244353^2 as an approximation to 1/1000000007. For more details, see this editorial(In Japanese).