Just a reminder that Code Jam Round 1C starts in under 7 hours.
Let's discuss the problems here after the contest.
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
Just a reminder that Code Jam Round 1C starts in under 7 hours.
Let's discuss the problems here after the contest.
Name |
---|
Reminder: 1 more hour
GL & HF!
ez
can't submit more and says it ended even though still 30 min
Maybe this will help, though you are out of time
Why can I sometimes see a "not solved" sign for a hidden test set in the scoreboard?
I am guessing that happens when you submit something that pass subtask 1, and then after that submit something that doesn't.
Shouldn't they took the last submission that passes the subtask one?
I have it:) My actions was
1) Solve C-small & submit it (this automatically shows pending for C-large)
2) Submit my new solution of C-large, but it fails on C-small (this makes "not solved" sign for a hidden test)
The rules are a little bit strange.
If the last submission passed the visible tests, then this submission will be used in score, and the hidden test set gets a "?".
If you submit an additional submission, that doesn't pass the visible tests, then you still get the points for the visible tests from the earlier submission, however you don't get the points from the previous hidden test (even if it would have been successful). Therefore the scoreboard shows a "-".
This happened to me in 1B, because I accidentally submitted my solution of the third problem on the page of the first problem. To receive the points for the hidden test case, I had to resubmit my solution of the first problem.
Same with me !
Only I had problem with solving second problem in C++?
On local testing my solution didn't get score, because it didn't print the last line. But I printed and problem was in script. I decided to submit on server and got accepted.
Solution
Maybe you needed to cout.flush()?
endl always flushes stream but as I said i had problem only with printing last query in last test. To ensure I added cout.flush in the end of code. But it didn't help.
I've downloaded your solution and run it locally. It works fine on my laptop:)
:( something wrong with my laptop. Do you use windows(like me) or linux?
Ubuntu 16.04
gcc version 5.4.0 20160609
What's the proof for task B?
I hated all the problems in the 3 rounds xD.
In my opinion, the last one from round1B was the best and I still can't solve it.
Anyone sees why this code gets RTE on problem 1 large? Thanks in advance.
I used LIS for third problem Test Set 1, but got WA. :(
Notice that the answer doesn't need to be monotonic. For example
Here the answer is to stack the 3 ants.
Yes, I know and my code passes this case.
Your program fails on this case
It reports 4 when the real answer is 5. I noticed that you are not covering all cases in your dp because the best answer up to the second number is take both the first and the second, so you will update that entry in the
lis
table as 2 and never will take into account discarding first number and taking second number onwards.My answer was indeed lis. The entry
lis[i]
stands for what is the sequence of sizei
with less weight. At first the table look like this:Taking 0 elements has weight 0, and taking more than 0 elements has infinite(oo) weight (since we can't do that). I iterate through all numbers from the begining and update the entire table on each iteration. You don't need to store inifinite values explicitely. It works in time because the size this table will not grow over 139 elements. The answer is the size of the table. Watch my code for reference.
Thank you so much!
Wow, solution to C is very clever. It took just few character changes (few n's to 200) to get my solution to small test pass also large test, but I was completely unaware of this during contest.
I decided to write solution for small and then think about large. My solution was basic n^2 LIS-like algorithm (dp[l] = min weight of correct subsequence of length l among current prefix of the array). After thinking I realized that I don't have to change it for large input!
The sum of the top k ants' weights grows exponentially (with base 1 + 1/6) and thus the current bottom ant's weight too. Therefore, the maximum sequence length is around log(109, 1 + 1 / 6) ≈ 135. This is pretty ok for final complexity 6 * 10^5 * 135.
Solved it by accident as well and was disappointed about it. Task that can be solved by accident doesn't while trying to solve easy subtask doesn't seem a very good one.
The concept of task where actual values are much smaller than quick worst case estimate isn't bad but it should have a way of exceeding time or memory limit if not noticed. Like multidimensional array, having interesting states non sequential or requiring some code to quickly handle non interesting cases. Programming language task in round 1B was better at this.
I guess it was possible a write a DP with N*N array that wouldn't fit in memory.
Yeah it feels the challenges are much more relaxed now.. and more participants pass than in previous years. Maybe they want to attract more new players.
The last subround of round 1 is usually easier. I think it's because all the hard core ones already advanced, and the organizers want to make it more enjoyable for the less experienced crowd.
Why is the base is 1 + 1/6 ? I cannot quite understand the explanation of official editorial provided regarding to this problem (the large test)..especially when they said that the length is maximum 139. Any of your further explanation is appreciated :D..thanks in advance
When You have ants x1,...,xn then xn*6 > x1+...+x(n-1) -> xn > [x1+...+x(n-1)] / 6 -> x1 + ... + xn > x1 + ... + x(n-1) + (x1+...+x(n-1)) * 1/6 = [x1 + ... + x(n-1)] * (1+1/6)
Thank you for your explanation :D
I wrote my solution for C small, and unexpectedly it passed C large. I used the approach described for C large in editorial, but I didn't realize that maximum stack height is so low (I stored state in map where keys are stack size and values are min weight for that size). If it was old Code Jam platform, maybe I would not even submit C large and would have lost more points!
What's wrong with this approach in A large?
For every character at every index store those characters that appear at index + 1, also store all characters at a given index separately, now if there's a character at any given index that its possible subsequent doesn't cover all the possible characters at the index + 1 position, automatically say that any string is the answer with these two subsequent characters changed.
aaaa abaa baaa bbaa aaba abba aabb aaab
Here at each position all pairs are possible. But e.g. you can choose bbbb.
Perhaps I didn't make my approach clear enough, here's the code which passed that testcase link
So your code returns "-" but there are many solutions, e.g. BBBB.
Oh! so there's a solution to that! I assumed you meant that BBBB is a wrong output!
Thanks for your feedback.
I get excited often with interactive problems but both interactive problems so far have been boring.
This Lollipop problem is more interesting from Mathematical/Theoric point of view than from Algorithmic/Strategy Design point of view.
I expect interesting interactive problems in next rounds.
Problem A passes with randomized solution. Hunch paid off My Code
you don't even need randomize, a complete search would pass too as long as you break.
Break where exactly? I got a TLE on the hidden set with my complete search solution.
see this. I suspect you repeat searching the same character many times.
i also got TLE but when i add one condition that if one solution is already found then we didn't need to call recursive function for any state and got AC.
Scraped scoreboard for all rounds so far in GCJ 2018.
https://docs.google.com/spreadsheets/d/10q6bxqgnd0U9KNzGFvAl7Ik6kWZ8_wbfiUMRN-cJdXE/edit?usp=sharing
would be nice if there's a column for country in it as well
Yes! Working on it.
Thanks for participating Round 1C, and congratulation to those in the top-1500 and qualified to Round 2. See you in Round 2! :)
I am the author of the first problem. I still find it amazing that the last sample case fits into a testcase, and one of the valid output (presented in the sample output) is a valid English word :')
Context: "Help I'm Trapped in a Factory" is a meme, and of course it's only a joke. I am not really trapped in a Code Jam factory. (and no one is; Google does not enforce anyone to work in Code Jam)
Can someone help me in telling me what's wrong in my solution for C-small for problem 3 of this round ?
Below is my solution:-
Please do let me know some test case where this fails ( for C-small it self ) and what is the logic error here. Thanks in advance!