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

Автор chokudai, 6 лет назад, По-английски

We will hold AtCoder Beginner Contest 164.

The point values will be 100-200-300-400-500-600.

We are looking forward to your participation!

Addition: About the Unrated ABC163

We are sorry for the inconvenience.

The server down during the last contest was caused by a sudden access to the ALB, and we found that we could solve this problem by doing Pre-Warming.

Also, the bug where the problem statement does not show up has been resolved by changing the caching algorithm. The problem with submissions showing up as IE (Internal Error) was due to the Judge server's scoring algorithm being different than in the past. This too has already been fixed.

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

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

Just out curiosity, rating 1999 in Atcoder is roughly how much in CF?

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

hope everything will be fine this time!

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

hope everyone will get full marks this round!

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

Hope it will never have problems(like 163) this time...

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

I hate Matrix Construction.

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

    I have given up.

    F is too hard to solve for me.

    • »
      »
      »
      6 лет назад, скрыть # ^ |
      Rev. 2  
      Проголосовать: нравится +8 Проголосовать: не нравится

      Am I the only one who did a randomized solution for F?

      My method was like this:

      • First, decompose the matrix into 64 layers, with one layer for each bit, since bits on different layers don't affect each other.
      • Then, for each enforcement that's "AND = 1" or "OR = 0", set the corresponding row/column to 1 or 0.
      • If there are collisions (one cell set to both 1 and 0) then immediately return impossible,
      • Otherwise, for each of the cells that were neither assigned 0 nor assigned 1, randomly assign it 0 or 1.
      • Check if the resulting matrix fulfills requirements.
      • If not, randomly assign them again. If you have assigned them enough times (100000) and each time it failed, return impossible,

      Code

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

        Unfortunately your solution fails against the following test case. Your solution outputs -1, but a valid answer exists.

        Test Case

        Similar input with larger input leads to TLE too.

        • »
          »
          »
          »
          »
          6 лет назад, скрыть # ^ |
           
          Проголосовать: нравится +8 Проголосовать: не нравится

          Ah, I see — this is one of the test cases with exactly one solution? Thanks for hacking my wrong method!

          I initially expected that there would either be a lot of possible outputs or none at all. Turns out I was wrong :)

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

    I like problem F last time. But I have to give up this time.

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

How did you think of D?

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

E is much difficult

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

My first Atcoder contest...wow, this is beginner? I'm stuck on D. Feel like an idiot.

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

How to solve E?

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

How to solve D ?

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

The English Commentary for Problem D: Multiples of 2019 is here

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -8 Проголосовать: не нравится

How you solve D? I used brute force but it gave me TLE? Do you have any ideas?

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

Am I mistaken in saying that today's ABC D has an identical solution to ABC 158E? The two problems seem to be asking for exactly the same thing.

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

Are standings hidden ?

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

What's the approach for D ? I used the stoi and substr function , got WA.

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

The problem F can be easily solved by maximum-flow with lower bounds. See this submission.

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

My approach

This is my approach which got me TLE I pre-computed all the modulo values but to find (L, R) pairs I had to use a nested for loop. Can someone please tell me how do I find the number of (L,R) pairs in O(n) time ?

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

My D approach
k starts from 0
Iterate from right and calculate (10^k%2019+digit at i-th index)%2019
store this in map and for every element in map calculate NC2 of that frequency

This problem is like calculating number of subarrays having sum%m as 0

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

    can you please explain why this problem is like calculating number of subarrays having sum%m as 0 ??

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

      You are given a array you calculate prefix sum at every i-th index mod m
      Now if prefix sum at two index(suppose i & j) is same then there is a subarray from (i+1,j) whose sum will be zero. So we can store each sum in map and choose any two index having same sum in NC2 ways. In this question instead of prefix we calculate suffix sum + power of 10. And we can choose indexs in NC2 ways.

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

Why $$$0 \lt = a_{i, j} \lt 2^{64}$$$ in problem F? For some weird unsigned long long practice? :)

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

I made me nervous that my codes were always CE. Actually,it's the "time" keyword that made this problem. Hope you all learn from my lesson.(How silly I was!) GL and HF.

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

Can someone explain easy to implement solution for E?

»
6 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

HELP!!!

For problem E:

I used dp.

$$$dp[i][j][k]$$$ means now standing at the $$$i-th$$$ node ,and have $$$Min(600,j)$$$ silver coins the $$$minimal$$$ time to go to k.

We can use $$$dp[i][j][k]$$$ to update other situation as follow.

  • $$$dp[i][j][k]+d[i]$$$ to update $$$dp[i][max(j-c[i],0)][k] $$$
  • $$$dp[i][j][k]+(the—time—from—it—to—i)$$$ to update $$$dp[it][Min(600,j+(the—number—of—silver—coins—required—from—it—to—i))][k] $$$

And I used shortest path to update it,but I fail in the second test which is line(pass all of the others!),what's wrong?

https://atcoder.jp/contests/abc164/submissions/12395345

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

For problem F, without noticing $$$U,V \lt 2^{64}$$$, I used long long instead of unsigned long long and got WA for 2 times.

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

Can I solve D recursively ?

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

Thanks for the quick English editorial !

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

my first contest at atcoder. the first three questions felt pretty easy.But got stuck on the D th problem if anyone can make a video tutorial on that.it would be a great help

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

Not terribly important, but I'm just going to point out that there's a typo on English B where Takahashi's name is misspelled as Takashi once.

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

If we do not consider time efficiency, is it possible to use the differential constraint system to solve the F problem? I used it but got wa

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

I wander why this submission on F failed in only one test

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

For question E, I have a test data that let my code that Accepted in Atcoder now to output wrong answers.

Data is: 3 2 1 1 2 1 2 1 3 2 4 1000000000 1 1000000000 1 1000000000 1

my code that Accepted in Atcoder now : https://atcoder.jp/contests/abc164/submissions/12437105

If row 111~115 is uncommented, you can use this data

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

Does E allow SPFA to pass

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

If anyone need explanation ,code and example for problem D here

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

I made video tutorial on first four problems . It may help you . Link

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

I accidentally found a "hack" for F; this solution is wrong but passes: submission

Error details
»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

2 1 0

1 2 100 56

1000000000 1

1 52

this test case would hack some of the accepted solutions for problem E correct answer should be 57

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

Probably a hack for E?

input:

2 1 0
1 2 50 1
1000000000 1
1 1

correct output:

2

correct code

incorrect code

The difference between them is at line #57.

Let me know if I’ve made a mistake.