Tenka1 Programmer Contest/Beginner Contest (atcoder.jp) will be held on Saturday (time ). Please check http://tenka1.klab.jp/2017/index.html for details. The writers are DEGwer and hasi.
The point values will be announced later.
Let's discuss problems after the contest.
UPD:
The point values will be
Beginner contest: 100 — 200 — 300 — 500
Programmer Contest: 300 — 500 — 800 — 1400
It seems that you can easily buy bitcoins by Japanese Amazon Gift card. Search by yourself if you want to know more about it.
It seems, hasi joined the writer of this contest. (updated, thanks -emli-)
how to solve D ?
In problem D, this is not bitwise xor. Bitwise OR is correct. Once I misreaded, so I wrote this at the top of the comment.
Let's constder about the pattern of K = 13:
Let's constder about an another pattern, K = 22:
So, you can divide [1, K] into logK parts (maximum). The complexity is N * logK = O(NlogK).
Unfortunately I still don't get one point. For K=13, you can choose 0001 from the first group and 1100 from the last group. Their bitwise OR is 1101 which is <= K.
But you could also choose 0111 from the first group and 1100 from the second group, their bitwise OR is 1111 which is > K.
How does this dividing into parts account for this?
When we do bitwise
or
of the values ai we can get one of the following numbers:1101 = 13
1100 = 12
1011 = 11
1010 = 10
1001 = 9
1000 = 8
0111 = 7
0110 = 6
0101 = 5
0100 = 4
0011 = 3
0010 = 2
0001 = 1
0000 = 0
That is, when we do bitwise
or
of numbers from set A, we can get all kinds of numbers ranging from 0 to K.So, our first guess is to go through all of these 14 numbers and collect the numbers ai which fit the pattern:
Now we can optimize this algorithm. Let's say S0110 is the set of {ai} such that theirs bitwise
or
gives 0110. Namely, S0110 = {0000, 0010, 0100, 0110}.Now let's look at S0111 = {0000, 0001, 0010, 0100, 0011, 0110, 0111}.
As you can see S0110 ⊂ S0111. Even more — the set S0111 contains all the sets S0000, S0001, S0010, S0011, S0100, S0101, S0110.
That means we can use only S0111 and skip the sets resulting from patterns 0000, 0001, 0010, 0011, 0100, 0101, 0110. After this skipping our original loop will look like this:
This has improved our loop almost twice, but we can get rid of a few more patterns in this loop.
Do you understand now?
Here is my blog post about D :)
What about rating changes?
Sorry, because of the trouble in E we decided to make it unrated.
mind if I ask, what was the trouble in E? How about the prize?
UPD: the trouble in E is due to the error in constraints. Here's the statement on the site:
"We deeply apologize, but there was a mistake in the constraints of Problem E.
In the English version of the statement, the constraints said "2 ≤ N ≤ 10^5", but the correct range of N is "2 ≤ N ≤ 5 × 10^4". The Japanese statement also mistakenly stated that "2 ≤ N ≤ 4 × 10^4".
We will regenerate the data under "2 ≤ N ≤ 4 × 10^4", the lowest constraint among the three, and rejudge all solutions that was not accepted. Once again, we are terribly sorry for the inconvenience caused by this inconsistency."
Looks like only 3 people were affected by the issue. Couldn't you make this round unrated for them if they got negative rating change and rate it for the rest?
According to chokudai's tweet, the affected person was only seven people (Hec, hogloid, kawatea, logicmachine, nuip, E869120, TangentDay), and all of them would gain rating if it was rated. Though seeing this tweet, he proved the existence of people who affected by the mistake which is not getting AC for this problem. That's why he decided to be unrated.
Hello, how can I get the Lottery prize?
Be lucky.
I solved D problem firstly in Beginner Contest, as i remember there is also prize money for Beginner contest(First AC).
Any news DEGwer or hasi?
I think the first to AC should apply to both contest, which means you have to be faster than the regular contest as well.
Yeah I solved D problem of the Beginner contest faster than who solved D problem in the regular contest.
From what I see from the standings page, tourist solve D in 02:14, while you solve it in 16:05.
I thought all the prizes are only usable in Japan only (and spefically I thought the T-shirt is given to Japanese participants only) so I think I chose not to receive prizes back when I was registering. Is it still possible to get prizes now? I didn't remember it was stated that T-shirts can be shipped internationally and I remembered it was written that the T-shirt and energy drink was for Japan only in the registration form when I registered. (though I'm not sure about this since it was a week ago)
I think it's still possible now. Please edit information and apply settings.
Where do I edit information?
https://tenka1-2017.contest.atcoder.jp/settings/participants
Thanks for your help! Apparently the registration form only asked about the gift cards and didn't say anything about the T-shirt or energy drinks so apparently I was mistaken.
When will div1 rated? div2 has rated for a while.
Great contest. Learnt a lot from solving them ... Took me many months actually till I got to a level where I could do the C and D of this contest but I finally did ! :)
Here is the repository of all my solutions to the Beginner Contest.
I have also written an editorial of D here.