Hello everyone!
Another year has gone by. The last Codeforces contest of this year will be tomorrow, 29 Dec, 15:35 UTC.
The round details:
- combined div1+div2
- 8 problems
- 2.5 hours
- rated!!!
I'd like to thank the following people for helping with the round: KAN, winger, AlexFetisov, zemen, xiaowuc1, MikeMirzayanov. Without them, this round would not have been possible.
Scoring distribution will be posted later. Make sure to read ahead on the problems, since there may be some later problems that are easier for you. I hope to see you all at the contest, and good luck on the last chance to increase your rating this year!
EDIT1: The scoring distribution is 500-750-1000-1750-1750-2000-2750-3500
EDIT2: There will be a five minute delay for starting.
EDIT3: Editorial is here: http://codeforces.net/blog/entry/56713
EDIT4: Congratulations to the winners!
Is it rated or not?
yes is rated!!!! , this is clarificated in the round details.
how can i post a picture XD!!!
Take it easy! He is just doing his best to get highest downvote this year! It's going to be the last chance! :))
Be careful, you wrote "17:35 UTC" instead of "15:35 UTC".
Thanks for the catch. It's fixed now.
HEY IS IT RATED???
HEY WHY ARE YOU NOT REPLYING??? I WANT OFFICIAL ANSWER
lewin realization for 2018: "Don't mess up with contests date/time".
Related: http://codeforces.net/blog/entry/54265#comment-383393
I need to work on it ;) Thankfully someone caught it this time.
I've wondered are cf names case sensitive?
I read your name as "Noe Inadal" (when it is clearly Noel Nadal)
Wat
It's ok, I just checked.
Noe it is not.
Expert this contest!! Good luck to all and have fun, hopefully 7k will participate. Thanks Mike for everything this year.
Mathematically speaking, would the ratings of Div2 participants be affected in any way in a Div1 + Div2 contest as opposed to only Div2 contests?
We don't even know if it's rated or not yet.
It is, check the last bullet point
Weird
I think it's not rated for me
"Make sure to read ahead on the problems, since there may be some later problems that are easier for you." — smelling something fishy. Hoping it will a be memorable contest.
And rated...
It is rated!!!!
What does the Good Bye contest say: "Long time no C"
Haha it was so funny that I forgot to laugh.
This blog enetry was post 45 mins ago and you already commented 8 times... this is funny for me
"Make sure to read ahead on the problems, since there may be some later problems that are easier for you"
Love the suspense! Can't wait!
B is tougher than D lol.
Can't wait to participate the contest, if I don't drop to div2 I can then finally propose a CodeForces contest. :D
Note to self: Don't stay overnight for a programming contest ever again.... ZzzzzZZZZzzzz
Well, will that contest be rated?
You can propose a contest if you are expert.
Except it would take me another 15 contests to propose one. :/
Serious question, do they give priority to Div1 problemsetters over Div2? If so I didn't know.
I don't know, but they probably give higher priority to high quality questions?
According to the coordinator, proposals are reviewed in "the order in which they appear on the list," which is most probably chronological order, I suppose.
Wish everybody high rating in the last contest in this year and good holiday mood!
Why are wishing high rating in a not rated contest.
Have you gone mad? Why couldn't you see that this is a rated contest!!! It is written clearly on the post. Stop irritating peoples with your irrelevant comments.
You too!
Mathematically, "everyone" can't have a rating increase :(
what if everyone got the same place as their rating points rank?
2 people can have the same rating but not the same rank, so it still can't happen.
they can if they get same exact scored
Does it matter if they have different ratings. Will rating change though?
Wish everyone "non-decreasing" rating!
Wish everyone " increasing " rating !
Wish me increasing rating! I don't care about other persons' ratings.
Wish you increasing rating!
Happy new year codeforces !
Will the ratings be calculated separately for div 1 and div2 even though we are in the same contest? I feel that, unless rating changes are calculated differently, div 2 participants will be less likely to gain rating if they are in the same pool as div 1 participants.
that just means div1 people gain more rating!
I think otherwise. As the cf rating formula uses rank/(expected rank) as rating change coefficient, Div. 2 participant's are expected to be after div1 ones, so if they do a bit well they could get way bigger change that normal div.2. But if div1 gets beaten by few div2 people he'll farther from first place whereas expected ranks stays the same.
PS. Out of my experience I do get biggest changes on combined rounds.
good or bad big changes?
Good ;)
I hope 2017 ends making me a Specialist.
What happened in 2015?
It was in queue.
I believe in you. Don't let me down
Will try my best.
I bet for 10K+ Registrants! <3
Last year there were 9.5k
It will be a bigger contest! Great!
we beat last year by ~300 registrants...not a huge jump but progress none the less
9.8K! Missed by 200, Will be ready next year with a few fake accounts :)
So what's your New Year's Resolution ?
Try to get yellow. :/
Do. Or do not. There is no try
May the (code)forces be with you, always.
may the code force be with you
May the force code with you.
You, will. You are gonna be the next great from India :)
DIV1
New year CF color changing to nutella so I can feel powerfull ;)
Are both div1 and div2 participants taken into consideration while calculating the rating change of a div2 guy?
Yes
Editorial right after the contest will be great, hope you will work on it.
better done than said.
"With Great Power Comes Great Responsibility"
If this contest goes unrated MikeMirzayanov will give 100 + rating to everyone , Happy coding guys and girls !
There is no point in rating if it's not earned.
Rating is just a reflexion of your brain's state.
So true! Don't let just rating be the only ultimate motive of your problem solving.
How to solve D ? Update: I have mistakenly commented here. :p :p
Please, do not use my profile image! Thanks :)
hihihihihahahahaa
Restrations.. :p 2015 2016 2017 Pending.....
educational round rating update and goodbye 2017 will overlap :|
PS: For the first time you can enter a round with a rating and end it with another one!
Probably Lewin is thinking of a script such:
P.S. : baw bekesh biroooon!
LoL there is already another div2 contest in the new year!
Why still do not turn on New Year's magic?
was looking for that comment.. it's been a while since last I saw my name in red :)
maybe because it's not the new year yet
Codeforces is reliable, as usual...
Considering that educational round's system-testing will happen during this contest , wouldn't it be too much of a load for the server since this contest is anyways going to have much more traffic that average?
It's not your problem. Just worry if its going to be rated
educational round testing will start after end of this contest. It was mentioned in it's blog.
Good luck everyone on the contest and in new 2018 year!
I want to believe that codeforces will have less lags in next year then in this year!
And also thanks to the guys who created an anime-contests, they was really good. I want more anime-contests in the future, does anyone else want it too?
No anime sucks
NANI?
WEEBS.....
Butthurt is not good reason for bad attitude.
http://codeforces.net/blog/entry/54234
Will we be able to change our handles this year?
My rating changes at Good bye contest:
+129
Starting new year with less rating doesn't feel like a good bye from 2017 :(
Your expression, that is:
Good bye yy: yy*21.5-43382.75-(-1)^(yy)*32.25
So, Goodbye 2017 you will get 15 increasing rating.
Won't the questions sorted by difficulty like in regular contests?
Good luck to all the participants! I hope all the participants will get high rating! Happy New Year 2018!!!
I guess there must be a question on tree(Christmas tree)
There is a comment for 2 year ago.
Good luck. Have fun!
I wonder if there are T-shirts for the well-performed?
I'm looking forward to that!
We are waiting for
Scoring distribution
The contest is combined for both divisions The red contestants:
me too
There is a comment for last year.
And the green contestants be like
4500 registrations and 8.5 hours left. I think we'll have at least 8.000 participants. I hope that the site will work
祝大家元旦快乐!
Happy new year Codeforces!!!
scoring distribution will be 500-750-1000-1500-2250-3000-3250-3500.
Let's hope we can see the fight between tourist and jqdai0815
I want to see tourist vs Petr
It's like Messi vs Ronaldo :D
Not interested at all...
Will magic color effect be activated this year ?
Yes
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░██████░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░█████████░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░████████░███░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░█████████░░███░░░░░░░░░░░░░░ ░░░░░░░░░░░░░███████████░░░██░░░░░░░░░░░░░ ░░░░░░░░░░░░██████████░░░░░░██░░░░░░░░░░░░ ░░░░░░░░░░██████████░░░░░░░░░██░░░░░░░░░░░ ░░░░░░░░░░█████████░░░░░░░░░░░██░░░░░░░░░░ ░░░░░░░░░█████░░░░░░░░░░░░░░░░░██░░░░░░░░░ ░░░░░░░░████████░░░░░░░░░█████░██░░░░░░░░░ ░░░░░░░░░░░███████████████████░░░░░░░░░░░░ ░░░░░░░░░░░████████████████████░░░░░░░░░░░ ░░░░░░░░░░██████████████████████░░░░░░░░░░ ░░░░░░░░░████████████████████░░██░░░░░░░░░ ░░░░░░░░████████████████████░░░░██░░░░░░░░ ░░░░░░░████████████████░░░░░░░░░░██░░░░░░░ ░░░░░░████████████░░░░░░░░░░░░░░░░██░░░░░░ ░░░░░████░░██░░░░░░░░░░░░░░░░░░░░░░██░░░░░ ░░░░███████░░░░░░█████░░░░░░█████████░░░░░ ░░░░██░░████████████████████████░░░░░░░░░░ ░░░░░░░█████████████████████░░░██░░░░░░░░░ ░░░░░░███████████████████░████░░░██░░░░░░░ ░░░░██████████████████████░░░░░░░░░██░░░░░ ░░██████████████████████░░░░░░░░░░░░███░░░ ░███████████████░█░░░░░░░░░░░░░░░░░░░░██░░ █████████░█░░░░░░░░░░░░░░░░░░░░░░░███████░ ░░░░░░░███░░░░░░░███████░░░░░░██████░░░░░░ ░░░░░░░░███████████████████████████░░░░░░░ ░░░░░░███████████████████████████░██░░░░░░ ░░░░██████████████████████████████░███░░░░ ░░░█████████████████████████████░░░░░██░░░ ░░█████████████████████████░░░░░░░░░░░██░░ ░█████████████████████░█░░░░░░░░░░░░░░░██░ █████████████████░█░░░░░░░░░░░░░░░░░░░████ ░░░░░███████████░░░░░░░░███░░░░████████░░░ ░░░░░░░░░░░░░░░░███░█████░█████░░░░░░░░░░░ ░░░░░░░░░░░░░░░░████████░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░██████░█░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░██████░█░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░█████░░█░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░████░░░█░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░████████░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░███████░░████████░░██░░███████░░░░░░ ░░░░░░░░░░░██░░██░░░░██░░██░░██░░░██░░░░░░ ░░░░░░░░░░░██░░██░░░░██░░██░░██░░░██░░░░░░ ░░░░░░███████░░██░░░░██░░██░░███████░░░░░░ ░░░░░░██░░░░░░░██░░░░██░░██░░██░░░██░░░░░░ ░░░░░░██░░░░░░░██░░░░██░░██░░██░░░██░░░░░░ ░░░░░░███████░░████████░░██░░███████░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ONE MORE TIME HAPPY NEW YEAR !!!!!!!!!!!!!!!!
Can i change my handle?
Yes. But you can only change your handle during January 1 to January 10 in each year, as a new year gift!
are U sure?
Yes, see this post of MikeMirzayanov: New Year Tradition: You can change handle up to January 10th
U is just a letter, so it can't be sure or unsure.
So, all the 8 problems are set by Lewin and the others who are mentioned in the post just helped to prepare the round, not setters, right? WOW ! Great !!
He probably copied problems from the internet.
Wish a color-change round!
maybe to blue :) i prefer being blue !
the same here :P
Guess my dream came true! ^_^
(though it's only gonna last 'til 10th Jan :/)
Rush to purple or higher :)
is that possible in codeforces rules? i mean going two levels up using one contest
I think a lot of people jumped from candidate master straight to international master by getting around top 50 in a div1 contest.
Is it advisable for a contestant who gets around 1000 rank in Div2 contests to participate in combined (Div1 + Div2) rounds?
It's advisable for any contestant to participate in any round.
another goodbye contest , great =)
This is such a big contest! Feel a little nervous:)
Try my best to get a good ending of 2018.
Hope everyone will have a good ending in 2017 and get a higher rating in 2018.
Can every contestant get +50 without reason as a new year motivation gift? :D MikeMirzayanov
Mike is not Santa
He could be real Santa! No one knows and you are on his naughty list.
for CF-Predictor users:
Rating prediction for Good Bye 2017 wouldn't be as accurate as always, because previous educational round not judged yet, so div2 users that participate in it have unknown rating. I decided to use predicted ratings from educational contest as initial for Good Bye 2017.
===================================================================
Good luck & high rating and Happy New Year!
===================================================================
Предсказание рейтинга для Good Bye 2017 к сожалению будет не таким точным, как обычно, потомучто до сих не проведена финальная проверка последнего educational раунда. Таким образом у участников educational раунда (из второго дивизиона) не известный рейтинг на момент начала Good Bye 2017. Я решил, в качестве апроксимации начального рейтинга перед сегодняшним контестом взять предсказания по educational раунду. Надеюсь, что расхождение будет не очень значительным:)
If the sys test process is programmed to start automatically right after the educational round end, don't forget to disable it, or we will be getting 2 hours queue.
Can i cancel registration?
there is no option (false statement) , but if you won't participate (do not submit anything) rating wont change.
go to the contest participants list, find your name, click the red X
Thank you!
Is 2.5 hours enough for 8 problems to solve? Thanks!
I lost a girl recently ,so I hope I could do better in codeforces....
from your basement ?
How can you say that :( Gold_Three_Fat I_LOVE_EVERY_GIRL
My bad friend login my account and do some bad thing!!!
I'm anticipating a lot of math problems. Everytime Lewin organizes a round, there are plenty of beautiful math problems that I always fail on :(
But... it's not even december 31st..
Hope for shorter statements :)
Happy new year !!! In this 2018 I hope that we will be better than last year, and of course I wish good luck to the all contests in 2018.
After a long time contest=(Div1 + Div2)! :p
CF new winner jqdai0815 !!!
What I see:
So we go die together :)
Goodbye Div 1 Contest. :|
are we going to see first 10k participation :D
Waiting for around 15 minutes to post this. Have Fun
Goodbye Candidate Master. Hello Expert. :P
in queue :| right before contest :|
Will there be a delay to reach 10K?
UPD: as expected the first 5 mins delay :"D
Congratulations. Your wishes is granted
Good luck, everyone!
It is Delayed to reach 10K :D
Have been while to see delays...
"you may click the link to enter the contest area"
never been so deceived in my life :(
Did anyone else get 0:00 on timer and contest not yet started message??
Contest was delayed
What will the rating change base on? My current rating or my rating after edu. round?
After educational round
HOpE there will be no problem like site not available :/
Codeforces is slow right now. :(
UPD - Seems fine now :)
the server is acting up again
dafuq is this contest :(
It's all math and geometry (aka my nightmare).
seems like it's DIV 1 + DIV 1.52017
I hate this contest so much. First three problems are as easy as it could be, they are just stupid, not for the codeforces, and then just wtf.
I mean, usually people easily make a smooth transition from simple problems to hard problems, what the hell happened to the authors this time? There is even nothing to hack.
Third one is easy if you have any idea about geometry, which I don't.
If you don't know geometry, use a binary search by answer :)
that gave me 3 TLE's
When you do binary search on doubles, you might want to consider stopping after a certain number of steps instead of when left and right are (almost) equal. i.e. do
for(int step=0; step<50; ++step) { ... }
instead ofwhile(right - left > eps) { ... }
. I modified this in your code and "upgraded" it (if you can call it that) from a TL on test 4 to a WA on test 7.quick EDIT: I looked over your code a little bit more and fixed this line:
return (one * one + two * two) < (twoR * twoR + EPS);
to this:return (one * one + two * two) <= (twoR * twoR);
... and got accepted. (In general) Don't use eps for comparisons, only for checking equality. So in principle binary search works, you just need to know how to work with doubles :P
Cool, thank you for your help!
You know what to do, do you?
Have you read F?
The problem provider use Math f**k me.
If I submit 2 solutions and both clear the pretest will I still face a penalty of 50 points During this contest me second solution which I submitted after 4 min of the first sol my score was approximately 50 less
Resubmission gets you penalty every time except compilation error or wrong answer on sample 1.
even if both sol are correct and accepted? Thanks
Yes. Even more: if you got accepted and then WA, your WA will be scored (I'm not sure if that's true if the WA fails pretests, but it definitely is true if both solutions passed the pretests: in that case, your last submission is considered to be your choice).
ohhh.Tysm as I didn't knew about this as I am new to this platform
In the score table, you can see each resubmission is -50. Only the last submission that passes pretests will be judged. Everything else will be ignored.
So, yes, you still get a penalty.
Yes, you will face a penalty of 50 points, similar thing happened with me.
I don't understand why my submission for 2C fails pretest#1 even though it matches the output in the problem statement :S
Check your precision
15 decimal points ..
Check if any debugging statements are being executed.
Thank you! That was it, silly debugging statements clogging the output ..
Yeah happened many times with me.Try not to repeat the mistake.
go to custom invocation and test the test
Am I alone who's hating this fucking "Expected number" ? :/
I usually like this kind of problems, though, I suppose, many of contestants never solved this problems, but this time it's something beyond common sense.
good bye 2017 && rating
What’s up dotorya, I am ko_osaga from South Korea. I’m a huge fan of you. You were 2nd in Facebook Hacker Cup 2017, your team was a Grand Champion at ICPC Daejeon 2017, you and your team continued to amaze Petr for a long time. It is unbelievable. I think your team will be a champion at ICPC WF 2018. I’m doing CP for 4 years and still I’m not like you. I want to improve my skill and be a great competitive programmer like you. How can I be a great competitive programmer like you? What is your training method?? Do you have any secret tips???? Please answer my question. Thanks in advance.
(+ I was writing this 15 minutes before the contest ends, and I'm so sad that Petr got first place — no personal feelings, but it's more fun to troll dotorya when he is in first place)
I have same questions for you :) . How can I be a great competitive programmer like you? What is your training method?? Do you have any secret tips???? Please answer my question. Thanks in advance.
You are not my huge fan, so I won't tell you my secret tips
팬이에요
팬이에요!!
I'm big big big fan of you.
Yep me too(I have been recently following dotorya and he's awessome). But I was sadder before for that Petr would be losing his place for the silliest reason possible. And actually that last minute manoeuvre by Petr made the contest twice as much fun to watch.
I didn't thought that he will lose his first place, but it really happened. Amazing piece of sports :D
However, I don't know why Petr gained +250 from the Hack. AFAIK He should only gain +200. (3 * 100 — 2 * 50) (UPD : It was fixed somehow)
The last hack happened 1 second after the end of the contest.
Yup I thought you should get +3 -2, but somehow it was written like +3 -1 (-1) and the one from 147:02 didn't count. That was what happened when I took screenshot, but it was resolved right after I wrote the reply. Sorry for the confusion :/
for Petr even time slows down. and a black hole is created,
What is the solution for F?
Is F an analysis of various cases ?
what is test case 4 of F?!
test 4 is probably you need to make a cycle. something like. GRBRBRBG
i have a pretty simple greedy.
Claim1: Answer is a spanning tree in most cases.(I Will describe corner case later)
Claim2: Green component is connected by itself
Now its pretty easy to see that after connecting Green with a chain , we need to connect reds and blues between 2 greens in a block with a chain sort of thing(We leave out the biggest gap here) Corner case (instead of connected 2 consecutive greens with a chain and reds and blues with spanning tree , we can instead make a cycle , ie connected green -> red -> red -> ... -> red -> green and green -> blue -> blue -> ... -> blue -> green).
I missed the cycle!! Test 4!! T-T
Yes it is, and it is the worst type of question for a sleepy programmer to pick up in a contest. :/
Hack for C.
5 2
1 10 7 3 6
Output: 2.000000000 2.000000000 4.645751311 5.464101615 8.518734657
What is the correct answer for this case? Fazle
What is expected answer?
What should answer be?
My code gives 2 2 4.64575 5.4641 8.51873
Mine was:
3 100
100 299 100
My code gives 2 2 4.64575131106 4.64575131106 8.51873465727
edit since I've calmed down slightly
If you are going to write problems, PLEASE make sure that if you find the optimal solution, you will get the problem right instead of having to fiddle around forever with random implementation details. There is no purpose in having contestants sit around trying to reimplement standard data types or come up with increasingly "creative" (re: sketchy) ways to get around overflow or try to shave off constant factors, at least in a purportedly algorithms-based contest. Whether you implement this by increasing the time limit or setting the problems limits to something more reasonable (k=1000 is just unnecessary considering the normal Python implementation runs fine with k=500 or so) doesn't really matter, but shifting the focus away from algorithms and onto constant time improvements really defeats the purpose.
I don't believe the problem is intended for you to implement fractions, but work with modular arithmetic by calculating the modular inverses by means of FLT or Euclidean algorithm.
Well, official solution reimplements fraction data type, so I think this was intended. Of course modular inverses are a very easy solved problem that is used only at the end.
I read the solutions, and it has no mention of implementing fraction data type. What I mean by working with modular inverses is you don't ever need to work with fractions at all. Instead of a / b use and you obtain the same result, not just the last calculation. With the number of prime factors you can include as part of your input, overflow is bound to happen.
See for yourself : 33784912
Ok, it is possible that I'm misreading the official solution and there is some graceful way of handling overflow. This isn't really my main point though; I don't care much about whether overflow exists supposing there is a simple way of dealing with it. My main concern/complaint is that doing this problem in Python is evidently practically impossible even with the optimal solution (there are no accepted solutions in Python), and considering that this could have been remedied with a trivial tweak to the limits (that wouldn't allow solutions of suboptimal time complexity), it seems that this was done intentionally which I cannot understand the purpose of.
Well then I don't understand you. The reason your Python solution probably failed is because you allowed the size of your factors to become so large they consume too much time per multiplication, addition, etc. You obviously should have evaluated the time and realised this solution is not practical. I was unaware Python does not support modulo calculations (sarcasm).
I suppose we will have to agree to disagree then -- in my view the implementation is essentially just a means of proving one's solution, and choosing limits so that implementations in some languages are essentially not possible (at least without a lot of constant time twiddling) seems to me to place the focus off of problem solving, which in theory is what these contests aim at. But as I said, I can understand that others will have different interests and will prefer these types of constant-optimization challenges. Of course thanks for your opinion.
So to summarise your point, you believe big-Num multiplication is "constant time twiddling"? Because I doubt your solution fails by only a constant factor.
I see now official solution is to give wrong fraction but one which gives same final answer. Ok, I guess it is possible to figure out this "trick" during contest, but IMO solving the problem should be the important part of the problem and if limits are chosen so that the official solution cannot be implemented (basically word for word) in Python then something is fundamentally wrong with the writing approach. Of course I understand that everyone's taste is different and some people prefer to optimize constant factors, but IMO this isn't really what these kinds of contests are for.
"come up with increasingly "creative" (re: sketchy) ways to get around overflow" : that's basically half of number-theoretic problems.
how to solve D?
dp on number of abs x number of as. some straightforward math needed to avoid infinite sums when num ab + num a gets to be larger than k.
please explain a bit more.
editorial explains my solution word for word basically, so just read that
So I was reading problem E and I wondered if the intended solution used any kind of knowledge on algebraic structures, did anyone solve it like that?
How to solve H ? I have a idea based on minimum clique partition in the graph of AND-components of size
Unable to parse markup [type=CF_TEX]
, with edges corresponding to XOR constraints, but couldn't debug it in time.What is an 'unsuccessful open hacking attempt', showing for Petr in the scoreboard?
edit: now it doesn't show anymore
How to Solve D ?
Notice that every time you place 'b' amount of subsequences "ab" increases by the current number of 'a' in the string. So dp[x][y] — answer if we have x 'a' in our string and y subsequences 'ab'. If x = 0, y = 0 then dp[x][y] = dp[x + 1][y] ('b' in the beginning of the string don't influence on the answer and we will place 'a' in one moment. The thing is that we can place many of 'a'. If x > k, then we will finish our process after first symbol 'b' will appear. So in this case we can add to dp[x][y] x + y(it will be in answer) and then add the expected amount of 'a' untill we will place 'b'. Denote the last one by E, so find it from the equation: .
Thanks
The series for G seemed very 'fractal like'. How do you solve it?
How to solve D,E,F?
goodbye rating 2017
I made 9 successful hacks during the contest. Let me explain what I found...
For problem B, some implementations don't consider the last step. An example of hack is...
2 2
SE
##
0
For problem C, some consider that the intersection will occur between the droping disk and the disk with max index (and, a disk with max y). Examples to both of them...
3 10
10 30 19
5 10
10 10 50 49 30
Could you give the answers for your C test cases? mtkaya
First test: 10.0000000 10.0000000 27.8605711
Second test: 10.0000000 30.0000000 10.0000000 29.9749844 36.2199824
Shit :(
I have way to reach newbie.
What is the answer to the B hack case?
6
Happy New Year!
This Year Gift From CF " No one will lose rating from this contest " (Please) :P
Gift From CF "All ratings will be doubled"!
double system-test!
first of all how the expected value for the 1st example problem of D is 2, as the expected value is 1/4(ab) + 1/8(bab) + 1/16(bbab) +.... which is 1/2. so how it came to be 2 ?
Don't forget sequences 'b..ba..ab', which contain number of 'a' subsequences 'ab'.
you also needs to multiple each of those probabilities with count of ab in them..
for example.. aab has 2 subsequence so, it will be 2 * (1/2*1/2*1/2)
okok
i misread it as there must be exactly k. sorry abt that.
Time to back div2. A_A
maths too hard~~
Codeforces aesthetics
GOOD BYE RATING
How to check this?
use this extension in your chrome https://chrome.google.com/webstore/detail/cf-predictor/ocfloejijfhhkkdmheodbaanephbnfhn?hl=en
Nice upvote :D
Screencast
Did anyone see anything like this when trying to hack a solution?
When will MikeMirzayanov finally understand that Flash's place is in a museum, not on a live website?
same bro
Flashplugin for Firefox on GNU/Linux sucks, that's likely not a CF fault.
I also had troubles with opening others' solutions, even though it was Chrome and Windows in my case. No black screen but it just didn't load the code (or loaded it after some 30 seconds of waiting).
Using Flash is a CF's fault.
Dude, you got to drink something soon.. the lack of it is causing panic.
i cant hack any solutions. i have flash player enabled and i locked the problem.
What's wrong with trigonometry for C? My trig solution failed systests.
Is it because c++ trig functions break on obtuse angle? (this is my guess from playing around with the code, not sure though)
I think the problem is that in your submission you only check for intersection with the highest disk that hits the current disk. However it might be that the intersection point is higher for some other disk whose center is lower.
Thanks
Thank you!
My solution for problem C failed test case 7: "wrong output format Expected double, but "nan" found" . What went wrong here ? My Solution: http://codeforces.net/contest/908/submission/33782812 Thanks.
Your solution could output something like
14.000000000e88
, you should usecout << std::fixed
for this to work properly.sqrt of negative numbers returns nan. I don't see in your submission checks for B^2 < 4AC. (If it's always false, ignore this message)
Thanks C++ for
x + NaN > y
being alwaysfalse
.In task C, I didn't even consider that
sqr(2r)
may be larger thansqr(x[i] - x[j])
. I was just mislead by a picture, that I drew, with two circles touching each other. I identified2r
as hypotenuse length and|x[i] - x[j]|
as cathetus length, and c'mon, how a hypotenuse can be shorter than a cathetus? But when|x[i] - x[j]| > 2r
, these values clearly have nothing to do with a right triangle sides, so (without realizing this) I got a negative "cathetus length" under the square root in my solution. Lucky me,NaN
arithmetics works in C++ as needed to make my code work properly.Exact same thing happened to me, but I also use C++ :D
does the graph have to be connected in F? or does it only need to be connected from the point of view of red / blue?.
ok so it turns out the whole graph need not be connected.
FML
I missed it too. :(
Your handle's color hurts me deeply.
Can someone explain why the C++17 compiler made my code TLE while C++14 was accepted? During the contest I did not notice that my default compiler was changed to C++17 and simply thought my solution was too slow, but after I resubmitted the same code after the contest and it was AC...
It's strange to see "GNU C++17 Diagnostics" shouldn't it be "GNU C++17" ?
EDIT: Found the conceptual error in my code. It would fail systest anyways. Thank you for the help :)
On my accepted solution, the answer on that test case is:
4.0000000000 4.0000000000 11.4161984871
Whereas the answer using your code is:
4.0000000000 4.0000000000 10.2449979984
I haven't read your code thoroughly (it's a bit messy :P) but from what I can see, when checking what disk touches the one you put in, you only consider the disk with the highest y, but there might be a disk with lower (or equal) y that causes the intersection point with your new disk to be higher :)
Got this from AC code:
4.000000 4.000000 11.416198
your code gives 10.x at last position.
Anyway, you have one of the same bug I had: Don't check max_y. Its possible that even lower y stops the ball at higher position.
Thank you, all of you. I got the bug. I am grateful :)
What's wrong with my approach ? Getting WA on case 7. Please help. http://codeforces.net/contest/908/submission/33785962
You are calculating the position of the center with respect to the upper most intersecting disk. But it's can be more lower for any other disk at lower position if the touching point is upper than that of the upper disk.
You should calculate the y coordinate of center for every touching disk and keep the maximum of them.
Happy new year Codeforces :D
Hello:
Why were all successful hacks not added to the system test data?
I think in general, only suspicious hacks get added (i.e. ones that fail a solution that would have otherwise passed systests).
Any idea how this works? Especially when input is an array etc. and there are too many hacks
Hopefully Codeforces simply rejudges all solutions with hack tests and does not make it unrated :/
Happy New Year everyone!
I think it's the last chance to drop my rating...
Even though the contest is over, why has not the new rate been calculated yet ?
Can anyone have a look at my solution for B and point out the mistake?
Link
Thank you in advance.
Hint: What happens if you reach the destination exactly after processing the last instruction?
On a quick glance, it seems like when following the instructions, you first make the checks and then take the step, but you should first take the step and then make the checks (otherwise you miss the checks for the last step).
In problem A, should I have tried to hack this submission? 33778092
The string size limit is 50 and the char array have size 50. It loop until reach a '\0' character... It have failed sometimes in my computer.
In principle, this code produces undefined behavior which might mean that sometimes it will work and otherwise will not.
In practice, the array
a
is allocated on the stack since it is declared locally.a[49]
is the last element ofa
, a[50] references the first address on the stack after the space allocated toa
. That element might sometimes be\0
, sometimes not, but it is very likely that there will be SOME null byte somewhere on the stack after the space allocated toa
.I think you're wrong. The idea here is that on the stack after a[49] comes variable c, which has the first byte always 0 (because of the constrains) and the loop stops as expected.
(On most systems) things on the stack are pushed towards lower addresses. In other words if you have
int a; int b;
declared locally, b will be at a LOWER address (even though a is pushed first).To test this, you can add this line
printf("%08X %08X %08X\n", &a, &c, &a[50]);
after the variable declarations and you'll see something like 00B5FA04 00B5F9F8 00B5FA36. As you can see, the address of c is lower than the address of a (and obviously different than the address of a[50]). You can test this with both VS and GCC.EDIT: P.S. I've tested the code and on my machine, with VS2017, about 1 in 5 times it will give Wrong Answer. As I've said, the program will keep reading bytes from the stack until it will eventually read a null byte, but in the meantime it might also read other bytes and those other bytes might contain vowels or odd digits (therefore wrongly increasing the counter). Here is an example of this happening (the program prints 1 when the answer should be 0).
I've tested this using clang (on OSX) and in my case, Djok216 is right. c came after a[49].
My color started to change, it is 90% just name left
I feel you
Anyway, I'm not so sad with this, making div1 from div2 is easy. (motivation)
You already changed icon to blue... wow
I think rating changes of "Educational Codeforces Round 35" will occur before rating changes of "Good Bye 2017". The former is still under progress.
Ratings for Goodbye 2017 will show on 2018
Why the hell is Educational round System Tsting So
As every hack will be appended into the system tests, in some cases/problems the judging process for a submission can be freaking long.
(As I've seen, there are 140 test cases in total for problem A of this Educational. Not really paying attention of others, but they are surely pretty large as well.)
When will the ratings be updated?
Waiting for
EDIT5: Rating have been updated.
Not the Goodbye ratings. -_-
Finally, blue. :-D
A new year with a new color <3'
Goodbye 2017. So close to the purple dream, but I believe I'll get it next year.
To anyone reading this: wish you have a lot of "Accepted"s in the new year ;)
You got it man. Congrats :)
OMG I became 1599... Not expert T_T
Not today, then next time.
Just try your best, and you'll make it ;)
Saying goodbye to 2017 is as hard as solving problems of "Good Bye 2017".
Nice contest! Anyway, the problem statements have nothing to do with New Year.. :P
MikeMirzayanov it seems the rating changes for this round don't appear in the RATING page ,for example Petr's rating changed from 3173 to 3298 ,yet it still shows 3173 in the rating page ,same with me and everyone I know/follow
It takes some time.
Liked the Problem D. Thanks Lewin
-555 in task D is Good Bye 2017