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

Автор atcoder_official, история, 13 месяцев назад, По-английски

We will hold AtCoder Beginner Contest 428.

We are looking forward to your participation!

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

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

No C++ 17 or 20 is wild

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

language brainfuck is among availible languages, wtf

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

Strange start time.

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

Did you update the contest start time?

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

Is the contest delayed by 30min? Technical issues of the new judge?

upd:according to contest page it is delayed and new judges won't be used

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

Is it rated?

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

Hope it will be high quality.

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

why did E<<<D???

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

The comparision of tuple in E gives TLE under correct time complexity.

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

Don't know why E was even included in this contest. D >>> E imo.

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

E is such a classic problem.Bad E.

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

(The favs only)

This is too bad.How the difficulty gap between D,E and F,G so big?

And E is too classic that it is a shit here.

Though I spent too much time on D,I think it's a good problem here.

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

Wow! Coder ME competed in Atcoder Beginner Contest 427&428 and gained -97 rating points! Share it!

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

Rubbish Round

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

Could the new judging system be opened for testing before the next competition starts? I don't want to face a completely new and unfamiliar system when I get to the ABC contest.

By the way, long live chez scheme!

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

My Java code strangely TLE and has an O(n) complexity. I tested it locally, timing the read from n to the output, and it only took 1300+ms. I can't figure out why it times out. I've never encountered such a Java timeout before. Does this mean Java won't be able to use DFS for 5e5 data in the future? Here's the submission link. I think it's due to the OJ system changes. Could atcoder officials please check it out?

https://atcoder.jp/contests/abc428/submissions/70268852

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

swap(D,E) please

D is terrible for me and I got rating-9 at last

E is too simple for this place.

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

How to approach problem C can anyone please help

  • »
    »
    13 месяцев назад, скрыть # ^ |
    ← Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится
    In order to the answer the queries on the fly, we can keep track of 2 things
    1. Invalid prefix count : Number of prefixes where count(close) > count(open)
    2. Sum : count(open) - count(close)
    
    Now, we only have 2 cases to:
    
    case 1 : If Invalid prefix count is not zero, it means that there are some closing brackets that do not have any  corresponding opening brackets to pair with. Hence such a string can never be 'good' , unless such closing brackets are not removed. Eg : () | ) | (())
    
    case 2 : Invalid prefix count is zero (This means every closing bracket can be paired with an opening bracket. But is the vice-versa true ? (may or may not be) Because this does not sure that all opening brackets have corresponding closing brackets). We can ensure this using sum.
    i,e If sum is zero, then count(open) = count(close) and since no invalid prefixes, we can say this is 'good'
    
    
    
    Implementation
»
13 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

my approach for D (This could help to understand better)

1 <= x <= d
F(c , c + x) => to_string(c) + to_string((c + x))
             => fixed prefix + varying suffix

and this suffix varies from : [c + 1 , c + d]

Initial thoughts calculate : find L , R:
    L = F(c + minSuffix)
    R = F(c + maxSuffix)

    ans = count(0....R) - count(0....L-1)

But this wont work ... why ?

say, c = 4 and d = 80
     suffix varies : [c + 1 , c + d]
                   : [5 , 84]

    L = "4" + "5" = 45
    R = "4" + "84" = 484

    when we use count(0....N), it consides all numbers in [0....N]
    which includes perfect squares with prefix other then 'c' => (81 , 100 , ...)


Solution!! : Break the suffix range into blocks

something like this,
[1 , 9] [10 , 99] , [100 , 999] , ....

Once again say, c = 4 and d = 80

L = "4" + "1" = 41
R = "4" + "9" = 49

L = "4" + "10" = 410
R = "4" + "99" = 499 -> greater than (maxR:484), so bound to maximum
               = 484

ans = [count(0...49) - count(0...41-1)] + [count(0...484) - count(0...410-1)]


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

My issue

Why is my own code for D wrong? In the editorial, it says that we can use floor(sqrt(x)) instead of the function f(x) to compute $$$\lfloor \sqrt{k} \rfloor$$$. But when I use floor(sqrt(x)), the judge result is this. However, when I finish my code according to the editorial, my judge result is this. Could anyone explain the reason please?