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

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

We will hold AtCoder Beginner Contest 156.

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

We are looking forward to your participation!

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

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

.

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

    Positional notation (or place-value notation, or positional numeral system) denotes usually the extension to any base of the Hindu–Arabic numeral system (or decimal system). More generally, a positional system is a numeral system in which the contribution of a digit to the value of a number is the product of the value of the digit by a factor determined by the position of the digit. In early numeral systems, such as Roman numerals, a digit has only one value: I means one, X means ten and C a hundred (however, the value may be negated if placed before another digit). In modern positional systems, such as the decimal system, the position of the digit means that its value must be multiplied by some value: in 555, the three identical symbols represent five hundreds, five tens, and five units, respectively, due to their different positions in the digit string.

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

    Quoted Wikipedia

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

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

Problem E, my idea:

r1 + r2 + ... + rn = n , such that 0<=ri<=min(k+1,n) (ri is the no. of people in that room) ,

what's wrong with this ?

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

how to solve E ??

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

how to solve F?

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

    Let x = x%m, d(i) = (d(i)%m!=0)?d(i)%m:m. Note that a(i)%m >= a(i+1)%m if a(i)%m + d(i) >=m. You would have to find the count of these which is nothing but a(n-1)/m. The answer to the problem is n-1 — a(n-1)/m.

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

My approach of D is to calculate all the combinations ((2^n)-1) — nCk(n,a) — nCk(n,b), but the results are wrong.

Is this apprach wrong?

This is my code:

https://atcoder.jp/contests/abc156/submissions/10292388

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

How to solve E ??

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

How to solve problem C (rally)

I'm taking a mean of array elements for point P but failed to get AC in all test cases.

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

How to calculate nCr%p, when n=10^9 and p=10^9+7? I got the formula for problem D(2^n-1-nCa-nCb), but couldn't solve it.

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

Quick solution sketches:

  • A: Implementation.
  • B: The number of base-$$$K$$$ digits in the representation of $$$N \gt 0$$$ is equal to 1 plus the number of digits in $$$\left \lfloor{\frac{N}{K}}\right \rfloor$$$, where $$$0$$$ is considered to have no digits.
  • C: The bounds are small enough to compute the total stamina spent for each choice of meeting point.
  • D: We are asked to compute $$$2^N - 1 - \binom{N}{a} - \binom{N}{b}$$$ modulo $$$10^9 + 7$$$, where $$$N \leq 10^9$$$ and $$$a,b \leq 2 \cdot 10^5$$$. We can compute $$$\binom{N}{a} = \frac{N!}{a!(N-a)!} = \frac{N \cdot (N-1) \cdot (N-2) \cdots (N-a+1)}{a!}$$$ quickly as both the numerator and denominator have only $$$a$$$ terms.
  • E: After moving people around, some rooms will decrease in population while others will increase in population. All rooms which decrease must contain no people. Suppose there are $$$x$$$ empty rooms. There are $$$\binom{N}{x}$$$ ways to select them. We can apply stars and bars to find that we have $$$\binom{N-x-1+x}{x}$$$ ways to distribute the people who left the empty rooms into the non-empty ones. Note that it is not possible for all rooms to be empty, or for more than $$$K$$$ rooms to be empty.
  • F: Before handling query $$$q$$$, compute $$$d'_i = d_i \mod m_q$$$. Instead of counting the number of times $$$a$$$ strictly increases modulo $$$m_q$$$, we'll count the number of times it strictly decreases and the number of times it stays the same. Each time we add some $$$d'_i \in [0, m_q)$$$ to produce a new element of sequence $$$a$$$, the value of $$$a$$$ modulo $$$m_q$$$ decreases iff we cross a multiple of $$$m_q$$$, and it stays the same iff $$$d'_i = 0$$$. We can compute the starting and ending values of $$$a$$$ to efficiently determine the number of multiples of $$$m_q$$$ we'll cross. We can also efficiently compute the number of $$$d'_i = 0$$$ occuring in the $$$n_q - 1$$$ terms of $$$d'$$$ which will be used.
»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Isn't problem C the same as this problem?

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

All problems solution with explanations by tmwilliamlin168. Link : https://www.youtube.com/watch?v=3fnkK4wPU14

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

E was an interesting question. How to solve F?

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

Just noticed that there is an english editorial available

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

How to solve the Problem D?I've been thinking for a long time but i can't find a way to prevent time limit exceed.

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

I still don't understand the E......

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

Where can i see failed test cases after contest in atcoder ?

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

For those having difficulty in solving E.

I have explained my solution in my submission.

thank me later :)

https://atcoder.jp/contests/abc156/submissions/15300567