Добрый день!
В воскресенье, 23-го сентября в 16:05 по московскому времени состоится Отборочный Раунд 1 олимпиады для школьников Технокубок 2019. Раунд будет длиться два часа, участникам будут предложены 7 задач. По его результатам лучшие участники (но не более 45% от общего числа участников раунда) будут приглашены на финальный этап в Москву. Для регистрации на раунд и участия перейдите по ссылке. Не забудьте заранее зарегистрироваться на раунд! Для опоздавших будет открыта дополнительная регистрация (с 16:15 до 18:05).
Зарегистрироваться на Отборочный Раунд 1 →
Соревнование открыто для всех в виде отдельных раундов для первого и второго дивизионов.
Для всех участников всех трех редакций этого соревнования будет пересчитан рейтинг.
Параллельно с Отборочным Раундом будут проведены открытые рейтинговые раунды для обоих дивизионов, в них могут принять участие все желающие.
Напомним, что согласно правилам раундов Codeforces во время соревнования ваши решения будут тестироваться только на претестах (предварительном и неполном наборе тестов), а системное тестирование состоится после окончания раунда. Обратите внимание, что претесты не покрывают все возможные случаи входных данных, поэтому тщательно тестируйте свои программы! После прохождения претестов у вас будет возможность заблокировать решение, тем самым получив привилегию искать ошибки и взламывать чужие решения, но отказавшись от возможности перепослать ваше решение при каких-либо обстоятельствах (например, даже если вы найдете ошибку или вас взломают). Со временем задачи падают в стоимости. После системного тестирования учитываются только полные решения. Подробнее про правила соревнований можно прочитать по ссылкам:
Регистрация на олимпиаду Технокубок еще открыта. Победителей и призеров олимпиады ждут значительные квоты при поступлении в престижные технические вузы России и ценные призы! Если вы — школьник 8-11 классов и пока не зарегистрировались на Технокубок, то самое время сделать это:
Зарегистрироваться на олимпиаду →
После регистрации на олимпиаду не забудьте зарегистрироваться на Отборочный Раунд!
В финал соревнования будут приглашены лучшие участники каждого из отборочных раундов (но не более 45% от общего числа участников раунда).
Авторы отборочного раунда — Roms, BledDest и adedalic. Дополнить раунд до полноценного div. 1 помог Anadi как автор задачи, спасибо ему и arsijo за помощь в координировании. Кроме того, хочу выразить благодарность тестерам, без помощи которых этот раунд не состоялся бы: winger, Um_nik, AlexFetisov, Denisson!
Для тех, кто впервые на Codeforces: в таблице ниже вы можете найти примеры решений на всех поддерживаемых языках:
Группа языков | Языки программирования / компиляторы | Примеры |
---|---|---|
C | GNU C, GNU C11 | 10903473, 17029870 |
C++ | GNU C++, GNU C++11, GNU C++14, GNU C++17, MS C++, etc. | 23794425, 5456501 |
C# | Mono C#, MS C# | 3195513, 3794163 |
D | D | 5482410, 2060057 |
Go | Go | 7114082, 21366098 |
Haskell | Haskell | 455333, 1668418 |
Java | Java 8 | 25491359, 23678167 |
JavaScript | V8 | 35963909, 35681818 |
Kotlin | Kotlin | 25779271, 25204556 |
OCaml | OCaml | 6157159, 1281252 |
Pascal | Delphi, FPC, Pascal.NET | 1275798, 1259434 |
Perl | Perl | 2519448, 1277556 |
PHP | PHP | 413942, 35875300 |
Python | Python 2, Python 3, PyPy2, PyPy3 | 35883730 (Py2), 36179112 (Py3) |
Ruby | Ruby | 1837970, 1289551 |
Rust | Rust | 25180002, 35652442 |
Scala | Scala | 35847980, 2456025 |
Удачи!
Обратите внимание, в Отборочном Раунде Технокубка и в div. 2 будет по 7 задач, предварительные стоимости:
250 — 500 — 750 — 1500 — 2000 — 2500 — 3000.
В div. 1 будет 5 задач, предварительные стоимости: 500 — 1000 — 1500 — 2000 — 2500.
Раунд завершен, поздравляем победителей!
Технокубок 2019 - Отборочный Раунд 1
Codeforces Round 512 (Div. 1, основан на Отборочном раунде 1 Технокубка 2019)
Codeforces Round 512 (Div. 2, основан на Отборочном раунде 1 Технокубка 2019)
Опубликован разбор.
Clashes with open cup. Please delay the contest.
I have more downvotes than upvotes of this blog
Unfortunately we can't postpone the round, because it is an Elimination Round for Technocup and was scheduled long before.
y u do dis :'( please come up with a solution... both contests are so interesting...
You can delay only div1 + div2 rounds. Students can't participate in main round.
I don't want delay.
It's clashing with AtCoder Beginner Contest 110 too. :(
Just do both lmao.
Just before September CookOff On CodeChef — Two Consecutive Contests + Sunday
You didn't mention anything about the number of problems. Can you edit that please? Edited, thanks
Round 2^9 :D
First power of two round since 2014!
Next in 2026!
Cf community is a very strange.
There are gonna be statements in English for the Div.1 and Div.2 editions, right?
yes
A bad time for Chinese students.
Better than contests that started at 11:35p.m.
But most high school students can't use computers between 10 and 10:30. So I think it is better to race earlier or later.
But I don't think so. Codeforces is not only for high students.
May I ask why high school students there can't use computers between 10 and 10:30? Just curious.
Because most Chinese high school students will leave school at 10 pm, they need to go home to continue the competition.
But I can register the competition because we have a holiday for Mid-Autumn Festival.
Umm so you have to go to school on weekends...?
Yes.Sometimes.
This world needs one more cp platform for Сhinese, Japanese, Vietnamese and Australians.
btw MikeMirzayanov can earn a lot of money by trading his cf system and installing it with Full Construction for anyone who could pay him some amount of money, so that person could hold contests there and get donations.
Another good time for Chinese Oier to enjoy the contest!
But ...... many of HE->OIers doesn't have a holiday in Middle Autumn Festival...
Still not so bad..(at least much better than 11:35 for oiers..) (why don't you use self-studying in the evening?:D
May I ask how many problems are shared between divisions?
It's three in the previous contest.
i think three
I think (div.1 A=div.2 C) ,(div.1 B=div.2 D) ... (div.1 E=div.2 G)
That's rather unlikely.
If div1 is a subset of div2, then div2 would have to solve 2 extra problems than div1 while having the same time amount.
My guess is div1 starts with div2D. Div1 version of this round wasn't there before, so I think a problem was added at some point.
Aren't 250 points for the first problem too less ?
Wait for question to pop up.
The question will have 2500+ submissions within 6-7 minutes, then :P
Personally speaking, I will prefer to solve this question at last.
I'm pretty sure that the optimal strategy is to always solve problems in increasing order of the time it takes to solve that problem. For example, if it takes you 1 minute to solve A and 3 minutes to solve B, if you solve A first you'll get 249+492=741 points, but if you solve B first you'll get 246+494=740 points.
I would love to follow this stratergy but after getting soln. It takes me 5 min to code and test (due to my slow typing speed.) So I prefer reading all questions before starting.
I agree with reading all problems before starting because there are many times where I get stuck on a problem believing "the ones after are harder" while I could've solve problem D way faster than problem C (or some other combinations). I failed a contest for not reading all the problems at the start before :(
Not exactly. I think it's more of decreasing order of . For example, if it takes you 2 minutes to solve A and 3 minutes to solve B. Solving A then B gives you 750 - 2 - 10 = 750 - 12 = 738 points while solving B then A gives you 750 - 5 - 6 = 750 - 11 = 739 points.
Yeah, i calculated something wrong. I'll check with a bunch of random inputs if your theory is correct.
EDIT: It works on 500 million random contests with 4 problems each and 43 million random contests with 6 problems each. I think you're right.(I made each problem worth 250*(random number between 0 and 3) more points than the one before it and made the time required to solve a problem a random number between 1 and (problem number)*10.)
Good job showing that you're a good scientist. thumbs up
I think you should also try to prove it with a contest of 2 problems. You'll have a better understanding of why that's the case.
This is going to be my first contest ever. Wish me luck, guys. :)
You are such a liar!!
Thanks to Mike Mirzayanov for the platform...
Don't be angry with downvotes, you don't want Mike to see that. Codeforces community tryin to help you by hiding this comment
По его результатам лучшие участники (но не более 45% от общего числа участников раунда) будут приглашены на финальный этап в Москву.
Но на сайте олимпиады написано следующее:
Финальный этап Олимпиады пройдет 3 марта в МГТУ им. Н.Э.Баумана, МФТИ, а также на других региональных площадках по всей России, о которых будет сообщено позднее.
Как я понимаю пока только ведутся переговоры с возможными другими площадками. Москва будет точно, другие города — посмотрим.
Wish you all get failed system... Ok, that's a joke. Wish you all get high rating!
А сам официальный раунд будет рейтинговым? Или рейтинговыми будут только div.1 и div.2 раунды?
Все три раунда будут рейтинговыми.
What will be the duration of the contest, <= 3 hours right? Otherwise it clashes with September Mega-Cookoff on CodeChef.
If you go to the contests sections, you can see the duration of every contest (it's 2 hours btw!)
"Mega-Cookoff"
round 1000000000
Логотип технокубка в статье ведет на codeforces.com/technocup2018 вместо 2019. Причем в анонсе ТК18 он тоже ведет на codeforces.com/technocup2018.
Спасибо, исправил.
dont try to hack my solution .. warna kanpatti sek dunga.
I prefer a hack rather than system failure. Since it gives me a chance to correct myself. I always pray that if my solution lacks something, then its better that it gets hacked.
nice thoughts /.. but still dont try to hack mine .. else u will get fucked.
no u
upvote if u want to get upvotes.
who will give me the first upvote?
Um... Nobody?
Geometry forces
today was a bad day , my mind completely shut off on B :( can anyone explain once the contest is over ?
same here
Mine did too when I first read it so I was like "you know what? Convex hull!" lol
I got the convex hull out of the 4 points they gave us on the input and then, for each point, I tried to add it to the convex hull. If this point is in the new convex hull, that means this point isn't originally inside the polygon given (or it wouldn't be in the convex hull).
I mean, I know there's probably a much easier solution, but that's what I came up with in a few minutes xD
I was also inspired by the convex hull algorithm. I walked from anti-clockwise around the corners of the rectangle. Then for a given point I checked if the cross product of the vector from one corner to the next and the vector from one corner to the point was non-negative. If this is true for all corners the point is inside the rectangle.
Div2 B Write equation of each line then divide rwctangle based on x coordinates and check if y lies below or above the line segments. Also do the case when n-d<d.
Each line on the rectangle can be written as y = x + c or y = -x + c. Finding c for all 4 lines is trivial, as well as <= or >=. For every coordinate see if the inequality is true for all 4 equations.
Look at the picture:
These red lines are covering all of the points of the rectangle.
Now focus on the topmost red line. What is common for all the points that lie on that line?
All of the points on the top line can be descibed by this equality: y - x = 2.
By the way, in general I know only about 4 equations which are useful in these types of problems:
Horizontal line
Vertical line:
Diagonal line from top left to bottom right
Diagonal line from bottom left to top right
Diagonal lines are more difficult of course =)
I need to constantly remind myself that I can add and subtract coordinates and get something meaningful out of it :)
Since the coordinates are small , iterate through all the coordinates which lies on or inside the rectangle and mark them as 1. Now if the point lies outside the rectangle then the value of that point would be 0.
if i'am submit two time accepted to same problems, why i'am take point to the last submit?????
So why you submit it twice if you get ac
I'm don't know that, I'm doubt about case, It's stupid one for me
is pretest passing ac ?
yes, passing the pretest
What is test 5 of B div 1 :(. Failed on it 3 times and can't find the mistake.
I used the int version of popcount... wasted over 1 hour and 5 submissions
DAMNNN ITTTTTTT THAT WAS MY MISTAKE TOO
Could've been something like
Nope, it's that I USED THE INT VERSION OF POPCOUNT
I was trying to solve E wth I smoked today
What is pretest 4 of Div. 1 D? T_T
something like
6
17 17 73 73 163 163
answer should be 262158769.
Thanks this hacks my code.
Can anyone explain Div1-B? I thought that for (l,r) to be good sum(l,r) has to be even and >= max element of (l,r). I couldn't do anything with this fact though. How can I approach this kind of counting problems?
My approach -
Considering the count of 1 bits as elements in the array.
Sufficient condition -
good sum(l,r) has to be even and sum(l,r)/2 >= max element of (l,r). And log2(1e18)<63.
Then iterate until sum(l,r)<=126.
Rest of r with even sum is good. At max 126 iterations.
Time Complexity — O(126*n).
Upd — 128 is loose upperbound. 64 is enough.
I don't understand why you have taken 63, isn't 60 good enough? I used 60 and got the wrong answer on pretest 8 for whole contest
Only statement on this case.
"Take a loose upper bound. But it should not be large enough so to give TLE."
I will try to explain my approach, though I failed on test 5 for unknown reasons: - For a certain r, you will store all "records" from right to left, which are new maximum numbers. You can see there are at most 60 values of this. Then you can simply binary search in this range for the rightmost index x that sum(x, i) >= 2 * bits. Then prefix sum in this range is easy.
i failed on test 5 too and it turned out i was taking input as integers instead of long long (i was thinking the number of bits will fit into int)
I failed on test 5 BECAUSE I USED __BUILTIN_POPCOUNT() INSTEAD OF LL. Gah screw me
oof
At least you got accepted man, I'm gonna go down to expert and then work my way back up now.
As you said, you have to have:
This is easy to prove, since your basic operation is decrementing one from two numbers in the interval (meaning that some of their bits cancel each other out).
But we notice that max(l, r) <= 64, and the value of every element is at least one, so you can:
code: 43313078
You will have to brute force until 128.
Well not really since max(l,r) is also counted in sum(l,r) so even if the other elements in the range are 1s your sum will exceed 2*max(l,r) after 65 elements or so.
Got it.
I took loose upper bound.
I will pray that I don't get TLE and pretest cases are strong enough.
You don't, since , so it's enough that the interval is longer than 64, since then .
Thank you all very much!
can you help understand this plz .. we are calculating for each number how many 1 in the binary representation right ? but why does it matter that the sum of 1 is even
if we have 15 and 6 the sum of 1 is 6 which is even but xor isn't 0
Cases where there are only two elements have one extra condition: Number of ones in al == Number of ones in ar
doesnt that mean max element should equal or be less than half of sum of (1)
I don't understand what you mean by that.
if we have a number that has 8 ones in its binary representation and other 7 numbers that has only one one (lol one one) isnt that the same issue of the two numbers
If I understand correctly what you are asking, this array will not be good, as the number with 8 ones can't have 0 ones even after xoring with all the other numbers. The condition that the numbers should be equal only applies where the subarray you're checking has 2 elements only.
what is the solution for Div2 D ?
Geometry forces. WTF?
A — too much troll problem. If a person couldnt solve problem A, what's he doing here? Why add such tasks in the competition?
He didn't solve A, but he solved B, C, D :)) rarai
LOL
B solution https://www.geeksforgeeks.org/check-whether-given-point-lies-inside-rectangle-not/
That's overkill.
Just pointing out the solution being copyable
I think this is my worst performance ever, fell ashamed about this stupid bugs I had :(
At least you failed while being in div1, something i can't say about me.
Happened to me too :(
What is wrong with the following solution for div1D?
For each prime I can choose element of order p or order p - 1. Sort all primes and consider them from biggest to smallest if:
p is more than once than choose elements of order p and order p - 1
p is only once and our current answer is not divisible than p, than take element of order p
p is only once and our current answer is divisble by p than take element of order p - 1.
I think you can set xi = 1, ai = 0, bi = 0, which essentially provides you with a unique first generator state. I think the result for (pi) = (5, 3, 3, 3) is 31.
Got it. Thanks.
I passed this test but still got WA on pretest 4 though. Do you have any other tricky tests?
Perhaps (pi) = (2, 2), giving 3 in result?
I got that case correct too :\
UPD : Someone posted a testcase above that hacked my code
http://codeforces.net/blog/entry/61992?#comment-460279
Is Div1D just making copies of p into p and p - 1 and taking LCM of everything, or is that wrong?
Codeforces? More like Mathforces.
Thanks codeforces for wasted an hour of mine for not specifying that "the segments should span the whole sequence" in Problem C
"Note that each digit of sequence should belong to exactly one segment."
( T T ) . maybe the worst round I have ever had
hi how does one do problem D from Div 2? i was thinking along the lines of the shoelace method but didnt really manage to get far with that idea.
AFAIK let it's height be h, and base length be b, now 1/2*b*h = n*m/k , so if 2*n*m%k != 0, then print "NO"
else note than you can always get one value of b less than n and one value of h less than m just by dividing gcd's and simple manipulatins
Why b * h is an integer ?
since area of the triangle in coordinate form is
1/2*sum(x1*(y2-y3)) = 1/2*b*h
and the left side (after removing 2's) is indeed an integer
If you have a triangle with points A, B, C; its area can be computed using cross product as 0.5*abs(AB X AC), where AB and AC are vectors going from A to B and C respectively. Since the points have integer coordinates, then b*h in 0.5*(b*h) must be integer.
You can construct the triangle using the points (0,0), (a,0) and (0,b) for some values of a and b. The first thing to check is when you simplify the fraction by diving by gcds if the denominator is greater than 2 there is no solution. You can see this because of the shoelace method you mentioned. The key to finding a and b is when you divide by gcds first divide n and k by gcd(n,k) then take this new value of k and divide m and k by gcd(m,k). Then if in the end if your k is 2 your new values of n and m will work for a and b. If the new k is 1 you have to multiply one of these results by 2.
How to solve div2E (div1B) ?
What is wrong with this solution for Div2 D 43333417
we aren't not allowed to see other's submissions until system pending is done.
But maybe you're missing the case when n*m isn't divisble by k, but 2*n*m is .
Oops, didn't know about that.
I checked for that case. My code got WA on pretest 10. Thanks for your response
Does anyone have any idea what pretest 8 for Div 2E is?
is cf predictor broken? I know I'm not that good in div1 but I feel like being in the 2/3 place should not be a rating drop for barely above 1900 (I noticed people around me also had rating drops despite being like 1910)
I feel like recently it's broken. 1 contest it predicted me having +112 when in reality, it's a mere +55. The second time not as broken, still, +102 turns into a +124.
how to change the username which is shown to others?
you must wait until the new year
really?
Yes. This is kind of a Codeforces tradition — you have 10 first days every new year to have one chance to change your username.
(i.e. this option will be available in 10 first days only, and you can use it only once per year)
Ok,thanks
WTF??!! 2 GEOM TASKS?? OMG F****G GEOMFORCES
I can't approach div1C by anything. Can somebody help me ?
If you move boxes i ... i + k to positions x + i ... x + i + k, it costs:
We want to choose the x that minimizes this. Note that the function is convex. We also have:
Where comp(x, y) = 1 if x ≤ y, and - 1 otherwise.
Since the function is convex, therefore the difference is increasing, and cost(x + 1, i, k) - cost(x, i, k) only changes when x = (aj - j) for some j, we can just binary search the index j where when x = (aj - j), the change first turns positive. This is the minimum of cost(x, i, k). Then, we just need to calculate cost(aj - j, i, k).
To do both, we store in a segment tree two values. For an interval [x, y] in the tree, we store:
On the left side of j, the absolute value does nothing, and on its right side, it multiplies by - 1. Therefore, we can easily calculate the cost.
My solution is O(n log(n)^2), but a O(n log(n)) solution can be easily achieved by doing the binary search inside the segment tree.
Code: 43339602
А где можно будет увидеть, кто прошел в финал?
Обычно проходят 100-150 (в прошлом году было так), ты вряд ли пройдёшь с этого раунда
Thank you for the round, I really like the problems! Although I have no idea about Div.2 DEF, but thank you for the round!
Hi, This is regarding solution 43335491 for the problem 1058D - Vasya and Triangle , I have solved this question on my own ......I also matched my solution with 43330317 yes we have same variables declared due to which this misunderstanding took place and I m wrongly penalised....but as you can see there is a lot difference in my templates and him....which I always use. This is just a coincindence and I am Innocent. Kindly consider my submission. Thank you.
Even with the different templates the main code is the same and that's definitive proof it's plagiarism
Submission 43333246
What those weird loops are for? Cheat detection evasion? The user did that regularly on their submissions.
I think it is
I do hope actions will be taken against them, if they are indeed cheating
My code is giving correct answer on local compiler but giving false answer on codeforces compiler. My whole contest went bad due to this error. Atleast my rating should be reverted back. 43309972
I checked test case 10 on codeblocks compiler as well as codechef IDE. Both of them are giving output as "Yes". My code is completely correct but still got WA.
"Atleast my rating should be reverted back" "My code is completely correct"
Stop with the trash attitude, you made a mistake, just own it.
Here, i modified your code and it got accepted: https://codeforces.net/contest/1058/submission/43347029
You had undefined behavior when accessing prefix_sum[pos] when pos = -1, so the output is never guaranteed to be the same.
I didn't know there was undefined beahviour because as I said online compilers as well as codeblocks was giving me the correct answer, that's why I though my code was correct.
If my code was wrong which you very correctly pointed out that it is, I wouldn't have written this comment. Thanks for your help.
I've solved div1 A
And I have a question, can anyone help me?
My solution of div1A used a valuable called "y1" , but I forgot to "define y1 _____y1".
And I passed the samples, pretests and main tests.
Why?
Here is a link of my solution :
![](http://codeforces.net/contest/1053/submission/43301181)
UPD: My question has already been solved.
I solved Div1C at 01:59:36, but Codeforces was down at that time... This is my first time to solve Div1C during a contest... QAQ
When there will be a list of those who have passed to the final?
Div.1 and Div.2 top 1 are both Chinese! They are sooo good at math (and coding)!
На финал идут топ 100?
Узнать финалист ли ты можно в личном кабинете сайта ТК. Я 98й и попал в финал => те кто выше тоже.
Просто в прошлом году писали прямым текстом, что в финал проходят участники с 1 по 100 место. Странно, что в этом году они не пишут.
Прошли 204 человека.
Пишут. Зайдите в группу в ВК