Привет, Codeforces!
Меня зовут Адилет Жаксыбай, и вместе с Бекжаном Касеновым (BekzhanKassenov) мы являемся авторами раунда Codeforces #294, который состоится 28 февраля в 16:00 MSK. Это наш первый раунд Codeforces, и мы рады пригласить всех поучаствовать в нем. Раунд будет рейтинговым для участников второго дивизиона, участники первого дивизиона могут, как обычно, поучаствовать в нем вне конкурса.
Насколько мы знаем, это будет первый раунд на Codeforces, полностью подготовленный участниками из Казахстана. Мы очень рады, что нам выпала такая честь, и надеемся, что все пройдет хорошо. Мы призываем всех других участников из нашей страны тоже стать авторами раундов — уверен, вы сможете подготовить множество отличных задач. Сделать раунд Codeforces — реальность ;)
Хочется выразить благодарность всем тем, кто помог нам с подготовкой раунда: Максиму Ахмедову (Zlobober), который помог нам с подготовкой задач, Нурлану Канапину (kt-9) и Мансуру Кутыбаеву (mexmans), протестировавшим контест, и Марии Беловой (Delinur), которая перевела условия на английский язык.
Отдельное огромное спасибо Михаилу Мирзаянову (MikeMirzayanov) за создание платформ Codeforces и Polygon. Мы бы хотели поздравить Codeforces с недавно прошедшим пятилетием. Нам, авторам раунда, невероятно повезло начать заниматься олимпиадами по программированию, когда сайт Codeforces уже существовал, и он внес невероятный вклад в наше развитие!
Нам очень нравится, когда авторы задач пишут в анонсе немного о себе (призываем всех авторов поступать также) — это дает лучше почувствовать, что за задачами стоят реальные люди. Поэтому напишем немного о нас. Мы являемся студентами Назарбаев Университета (nu.edu.kz) — нового университета с английским языком обучения в столице Казахстана, Астане. В ACM-ICPC наш университет участвует лишь с 2012 года, но тем не менее команда с NU уже два раза проходила в финал в 2014 и 2015 году. Мы надеемся и в будущем держать планку спортивного программирования на высоком уровне.
Всем удачи!
UPD Разбалловка будет стандартной (500 — 1000 — 1500 — 2000 — 2500)
UPD2 Разбор можно найти тут
Поздравляем победителей:
Раунд закончен, спасибо всем, кто принял участие!
Hope for finally become blue :)
Do not hope
You never gone blue
you become purple
My hope has been granted :)
Congrats! Mine too. :)
If you want, you can!
Congrats for being first in country to prepare a codeforces round. Hoping your efforts will inspire many people in your country.
For the sake of fairness: azizkhan was one of the authors of Codeforces Round #202. We are just first, who prepared complete round.
Wahhey, first complete round from my country!
Always dreamed to write this comment (
afarin be country shoma
This contest overlaps with Challenge24 :(
you boro challenge24 bede we haminja contest midim
Can you shut up please?!
no I can't (:
I am really sorry bekzhan29)
Why isn't this page on the frontpage? Isn't this an official contest?
It's an official contest. Just appeared on the front page.
хаххахахах такс такс такс што тут у нас контест контест контестиик хахах наканецта в зеленые сольюсь
hope we enjoy the problems
we too (:
Attention guys, it's an individual contest.
In this world, winning is everything; winners are validated and losers are denied. Until now, I've never lost at anything, and I won't in the future. Since I always win, I'm always right. If you oppose me... I'll kill you, no matter who you are.
miay teeworlds?
Ya, we know that by looking at the time you created your account at.
teach me how to spout nonsense without getting embarrassed please because the things you just said made laughing a medicine for me =))
I'm pretty sure everyone is so much concerned with their lives and won't dare to oppose you. But I was just wondering what if the Online Judge oppose you and give you a verdict other than Accepted!
That cant happen because i am always right, i make no mistakes
I think he is just acting like the character Akashi Seijuro... Those words were all originally from the anime....
i am not acting, i am Akashi. winning is everything and i never lose as you can see in standings
Next round you will be introduced with div 1 coders.
just look tourist and shut up :|
look for help bro :)
@Akashi: Sorry but you will loose both in the anime and in div1 soon :)
I am ze ghamat very very sorry pictureato bede for yadegari
pls dis like me for kossher haye bala
chi kos migi ?
taghriban
kos shero put karde too koonesh dg
please speak English ! and don't be rude :|
Stop fighting :|
I wanted to take a walk today. Maybe I will do it tomorrow. Priority has codeforces :P
30 Минут до начала раунда. Все еще нету информации о разбалловке...
Появилась :)
Usually I ignore large post, blog and announcement. But this one is so much encouraging that I can't ignore. May be one day I will be an author like you :). Best wishes to you guys.
I thought contest would be delayed for 10 min, but registrants 4965!
I missed the contest :-(. I thought it was at 16:00 local time.
I think problems were easier than standard for a Div. 2 contest IMHO.
Yes... of course that was first contest of ADJA we hope next contest be better :-"
I'm wondering... What's the test case for problem A that got all these hacks?
People thought knight was K lololol
made that mistake ;)
I use something like this: ....K... ........ ........ ........ ........ ........ ........ ........ (the code will fail this test case if they add 1 for 'K' or 'k')
Also some people / not in my room :( / use 9 instead of 8 for Q.
Wait... Aren't you supposed to use 9 for Q?
Yes... Changing 8 by 9 I mean...
how to solve E??
I missed the contest but I guess it's related to LCA.
Preprocessing: LCA preprocessing and making an array of heights of nodes (h[]), quantities of nodes in the subtrees (sub[]), ancestors of levels 1,2,4,8,16... If we have ancestors of these levels, we can find ancestor of any level with O(log(N)) time.
Solution: if a==b, the answer is n. Else find LCA(a,b)=c. If heights of a and b are the same, the middle is c. We can find ancestors of a and b that are childs of c (call them e and f), because we know that they are a and b ancestors of the (h[a]-h[c]-1)th level (complexity O(log(N))). Then the answer is n-sub[e]-sub[f]. If heights of a and b are not the same, then either h[a]-h[b] is odd — then answer is 0, or is even — then we know where the middle node e is situated. If its child closer to a or b is f, the answer is sub[e]-sub[f].
thanks got it ....
WA on test 20 ¿?
I solved it that way but I keep getting TLE on 7th test case. My solution--> http://codeforces.net/contest/519/submission/10136461
Sorry my fault, my code was right but I thought roads in input were correct (i.e. a is closer to the root than b) so it was going on infinite loop. lol
Also prima[][] is unnecessary here. http://codeforces.net/contest/519/submission/10138678
C looks easier, than A for me.
I finally find my blade.
.
.
.
If you know what I mean :-troll.
How do I do E? I know its a tree.
How to do C problem.I solved it recursively but dont know how to optimize it for large test case .Thanx
my solution is to print the minimum of (n+m)/3 and n and m
Greedily, whichever out of n or m is larger subtract 2 from it and subtract 1 from the other until one of them is smaller than 2 and the other smaller than 1.
Easiest solution i found was:
Ans=(a+b)/3
Ans=min(Ans,min(a,b))
I doubt this tho
ans=min(n,m,(n+m)/3) :)
i did something like this 1+max(solve(n-1,m-2),solve(n-2,m-1));where solve is my function.
Did it work? Looks like exponential time to me. Or n^2 if memorized.
По крайней мере 2 участника моей комнаты предпочли коней обозначить по русской номенклатуре.
Can anyone tell me how to solve D? I can't wait till Editorial
Who can say 5 pretest of C?
How is D solved?
i did this:
keep this : array[ each partial sum amount ][ each character ] = number of occurences of that character with the amount of partial sum.
(by partial sum i mean sum of all values from the first to the i'th character) since the amount of partial sum can be large and also negative you need map ( or unordered_map )
when you want to add a new partial sum you must see how many of the previous partial sum and the current character had occured and add this amount to the ans.
what's the meaning of "Validator 'validator.exe' returns exit code 3 [FAIL Expected EOLN (stdin)]" when hack others' code?
my submitted code is http://codeforces.net/contest/519/hacks/140490/test
After looking, it might be because of the extra space you print at the end of each line... I'm not sure but I know that the validator is very strict.
It's kind of you to answer my question~
you need to print "\n" at the end of your input.
shold i use printf("\n") replace "puts("")" ?
No, I said that before I saw your code... I think puts("") is fine.
You have a trailing space at the end of the lines
Use
%d%c ... i == n - 1 ? '\n' : ' '
I think for prob C it will be more challenging if the input range is bigger, something like 0 <= n, m <= 5.10^9. with 10^5, even brute force implementation can pass. But, overall, nice contest!
min(n,m,(n+m)/3) is not challenging with 10^18 input range. If whis solution is correct))
I think for prob C it will be more challenging if the input range is bigger, something like 0 <= n, m <= 5.10^9. with 10^5, even brute force implementation can pass. But, overall, nice contest!
min(n,m,(n+m)/3) is not very challenging even 10^18. if this solution is correct...
I know, but at least brute force implementation will not pass (and maybe can gives more hacks.)
let's wait system testing, and look at solutions 1500 score problem.)))
This is so unfair. They skipped my solution to problem C. It was a super simple 10 line solution. How can it be skipped ? It may be due to coincidence that my solution is similar to someone else since it involved only 3 variables and simple commands!
Erm... About problem A...
Thanks for very fast system testing!
Let's hope for fast rating updates too :D
UPD. It was very fast :) Thank you!
I don't understand why my submission is not any giving output. For the same case my solution is giving output in my codeblocks.
I don't understand it either. I submitted your code without any modifications and got AC 10086878
Try to write admins about that.
Editorial is published here
Разбор опубликован.
на каком вы курсе? ADJA
На третьем
There are a lot of people who unrated joined this contest. I think they are from DIV1... Not fair play
I don't have this efficiency in Div. 1 contests :( :-"
Please explain me Problem D i am not getting how to count 0s?
Please explain problem D?
Ok)) I am need too))
Speed contest
Rating was awful. It's my first time I AC 3 problem , but my rating from 1601 becom 1534. What the ... ? What the ... ? . . . What bad rating?
It's another swarm of unrated competitors...
Hello programmers! How I an quicly find general parent of two vertex on tree? For O(1) or O(logn) ?
LCA tutorial on topcoder.
thank you))
Thank you all who participated in the contest! We enjoyed it. Hope you too :)
I have written small blog post about what is like to be problemsetter: link. I will be happy, if this helps you to have a feeling of what is going on behind the scenes.
See you in the next contests ;)
Top 8 participants are unranked... Are you shi'in me?
Seems like AkashiSeijuro used his Emperor's eye this time...
Nice!!! I became purple :P But I'm banging my head: stupid mistake on problem D, not using long long catch me again :(
say goodbye to int try typedef long long ll; and use ll everytime !
How this submission passed system tests?
Sum of all numbers in first array must be maximum 1e5 * 1e9 = 1e14
1e14 > 2^31-1
It's the same as performing all operations modulo 2^32
How about this case:
that code gives wrong answer. The variables needed to be long long.
It gives Correct Answer!
The great contest!
http://codeforces.net/contest/519/submission/10066478
Hi Java fans. Don't forget that it's not right to compare Integers by ==. Use equals instead:)
http://codeforces.net/contest/519/submission/10085682
When I submitted my code, the verdict was AC. But when I open my submission page, the verdict has been WA.
my source code is here -> http://codeforces.net/contest/519/submission/10067289
Everything has changed after a few hours. What's the matter with test 6 ?
When you submit a solution during the contest, it's checked only on a small number of cases (pretests). Only after the contest ended, it's run on a larger number of cases (system tests). Your solution is incorrect because it considers only 4 rows of the chessboard. It passed pretests but failed system tests.
thanks for your help =))
Is there a tutorial for this contest? I can't find it. Somebody provides me with the link, please.
http://codeforces.net/blog/entry/16687
all unrated guys have won,, u konw what i mean
Did you have a seizure when you were writing the second half?
English Editorial please.
Need editorial to 5th ques.
just replace the ru in the url with com http://codeforces.net/blog/entry/16687
Thanks for this round. Finally become purple after 15 contests. :)
Really thank this round, I finally became blue!
Really thank this round, I finally became blue!
But I lost 91 points!
Could not solve problem C just for missing the line "Furthermore, they agree that the total number of teams should be as much as possible." :( :(
I mean that is a pretty crucial line, it states the goal of the problem. If after reading a statement you do not know the goal of the problem you should reread statement. Overall I thought it was a very clear description of the problem.