Блог пользователя awoo

Автор awoo, история, 9 лет назад, перевод, По-русски

Привет, Codeforces!

21 августа в 18:05 по Москве начнётся Educational Codeforces Round 27.

Продолжается серия образовательных раундов в рамках инициативы Harbour.Space University! Подробности о сотрудничестве Harbour.Space University и Codeforces можно прочитать в посте.

Раунд будет нерейтинговый. Соревнование будет проводиться по немного расширенным правилам ACM ICPC. После окончания раунда будет период времени длительностью в один день, в течение которого вы можете попробовать взломать абсолютно любое решение (в том числе свое). Причем исходный код будет предоставлен не только для чтения, но и для копирования.

Вам будет предложено 7 задач на 2 часа. Мы надеемся, что вам они покажутся интересными.

Задачи вместе со мной придумывали и готовили Иван BledDest Андросов, Владимир vovuh Петров и Михаил MikeMirzayanov Мирзаянов.

Удачи в раунде! Успешных решений!

У Harbour.Space есть для вас небольшая речь:

We are delighted to welcome the 2017 ACM-ICPC World Champions, ITMO, to our 2nd Hello Barcelona Programming Bootcamp in collaboration with Moscow Workshops ACM ICPC starting September 27.

All the top Russian teams are coming, including St. Petersburg State University, MIPT, Ural Federal University, Tomsk, Novosibirsk, Saratov and Perm, as well as the world’s top universities such as Waterloo, Central Florida, Hangzhou Dianzi, Singapore, KTH and dozens of others — so far teams from 30 countries have signed up.

The event’s gold sponsor is Sberbank, the biggest commercial and investment bank of Eastern Europe and Russia. Thanks to their support we expect that the top participants will be awarded valuable prizes, alongside high-profile internship and job opportunities.

We can’t wait to see all of you coming to learn, practice and compete on the international stage, smoothing your road towards April World Finals in Beijing.

Ps. Registrations close on September 1.

UPD: Разбор доступен по ссылке

Поздравляем победителей:

Rank Competitor Problems Solved Penalty
1 uwi 7 288
2 quailty 7 314
3 Andrei1998 7 318
4 rajat1603 7 374
5 fatego 7 374

Поздравляем лучших взломщиков:

Rank Competitor Hack Count
1 uwi 455:-11
2 halyavin 305:-4
3 STommydx 103:-2
4 Lhtie 48:-2
5 step_by_step 44:-28

Было сделано 1326 успешных и 300 неудачных взломов.

И, наконец, поздравляем людей, отправивших первое полное решение по задаче:

Problem Competitor Penalty
A ksun48 0:01
B ygmngm817 0:03
C markysha 0:03
D EKGMA 0:10
E halyavin 0:37
F eddy1021 0:34
G const_int_magic 0:08

  • Проголосовать: нравится
  • +124
  • Проголосовать: не нравится

»
9 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -13 Проголосовать: не нравится

why is the Announcement too late?

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

I want nothing but a clear problem set.

»
9 лет назад, скрыть # |
 
Проголосовать: нравится -18 Проголосовать: не нравится

Is it rated?

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

What is high-profile internship?

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +108 Проголосовать: не нравится

"After the exam Polycarp can justify his rule violations by telling the driving instructor that he just didn't notice some of the signs."

Unfunny meme amirite

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +38 Проголосовать: не нравится

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +43 Проголосовать: не нравится

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to solve E and F?

Is this a valid approach for E:

2D ternary search to find the placement of the (k + 1)th center of ignition and then binary search to find minimal time. The complexity will be which is about 300 mln operations and should fit in TL. The only thing I'm curious is if the ternary search will be correct.

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

could anyone explain to me the first test in D ?

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I got WA at Test Case #8 in problem D. Couldn't figure out why?

  • »
    »
    9 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +1 Проголосовать: не нравится

    When you get new speed of car, you cant only check last speed limit. You need to have stack with speed limits. Example you have signs with speed limits of 100,120,150 respectively. Then , you drive 160 and you only check last speed limit which is 150. But you also must care about signs 100 120. So , maintain a stack of speeds, go back while speed.top() < curr_speed and increase counter. You can see my solution at my profile.

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +24 Проголосовать: не нравится

problem G is this with Q = 1

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

4

1 100

3 50

3 50

1 50 why is the ans 2

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

how to solve G ?

  • »
    »
    9 лет назад, скрыть # ^ |
    Rev. 3  
    Проголосовать: нравится +9 Проголосовать: не нравится

    If there is a cycle in the graph with cost C, for every path of cost x, there is one with cost x^C.
    So you can check out all the costs of simple cycles (get a spanning tree and check for each edge) and the shortest paths will be x^C1^C2... where x is the cost of any route you can find.
    To find the minimum of this value we can translate the problem to linear algebra, the XOR is the same as the addition in Z/2 space, so if we treat these costs as a vector, then we can find a linearly independent set which generate these vectors in the ZMXBITS/2 linear space using gaussian elimination.
    Now we can simply get any distance from 1 to n, and XOR with the elements of the basis greedily from the most significant bit to the least.

»
9 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +29 Проголосовать: не нравится

Alert!!! Alert!!! UWI started hacking!!!

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Anyone could kindly explain why Wrong Answer on Test Case 8? Thanks

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can anyone tell me how there are this many solutions for G? I saw solution uses linear algebra. Isnt it really advanced topic for competitive programming? Anyone has any materials with codes for linear algebra?

Problem E is much easier in my opinion, but has less AC. Also, this is maybe the case because problem G appeared on codechef before (in even harder version).

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

4 1 100 3 50 3 50 1 50 who agrees with me that the answer should have been 1??

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Why there's no sample explanation in problem A,B,C.

Thinking a harder version of the easy problems took up most of my time just because I misunderstood the problems!

:(

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Помогите, пожалуйста!

Вот моя программа для задачи D: http://codeforces.me/contest/845/submission/29666261. Я пытался решить её, создав вектор скоростных ограничений. Но получил неправильный ответ, когда количество событий было велико.

Подскажите, пожалуйста, что я делаю не так.

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Help me, please!

Here is my program for problem D: http://codeforces.me/contest/845/submission/29666261. I tried to solve it using the vector of speed limits. But I get "Wrong_Answer" when the number of events was great.

Can you, please, tell me what I'm doing wrong.

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Almost everone solved problem G in same fashion ( finding basis and all ), is this some standard method for dealing with this type of problems? can anyone give any link to some theory and more problems on it.

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +66 Проголосовать: не нравится

Me Right Now..

»
9 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

7 1 20 2 6 4 6 6 2 In the third example Polycarp should say he didn't notice both "no overtake allowed" that came after "overtake is allowed" sign. Any explain for me? I think it doesn't makes sense.

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Now its halyavin.. :3

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can someone provide a test for which this doesn't work? http://codeforces.me/contest/845/submission/29651836

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Full test cases are visible even when 24 hour hacking phase is running, but they should not be visible.

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Could someone point out where my code for problem-D is giving error? Link is https://www.ideone.com/VjSB5c Thank you.

  • »
    »
    9 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    It's not enough sometimes to delete the previous sign. For e. g. if there is a speed limit sign of 50, then a speed limit sign of 30, and after that he goes with 100 speed, then in your code he only has to say he didn't see the 30 sign, but then he should think the speed limit is 50, so he is still speeding.

    Also you don't reset the speed limit after deleting a sign, so if there is a 30 sign, he goes with 50, then he goes with 70, then you add 2 to ans instead of 1.

    Solution: