Автор BledDest, 8 лет назад, По-русски

Привет, Codeforces!

27 июня в 17:35 по Москве начнётся Educational Codeforces Round 46.

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

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

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

Задачи вместе со мной готовили Адилбек adedalic Далабаев, Роман Roms Глазов и Михаил awoo Пикляев.

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

UPD: Разбор задач.

У меня также есть сообщение от наших партнеров, Harbour.Space University:

Hi Codeforces!

For our programming boot camp’s next iteration of Hello Barcelona Programming Bootcamp, Harbour.Space University in collaboration with Moscow Workshops ICPC, ITMO University, Moscow Institute of Physics and Technology, Saint Petersburg State University and Codeforces is bringing the best training practices and coaches to Barcelona to prepare 150 students for winning medals in the next ICPC World Finals.

It's extraordinary to see the entire cultural spectrum meet at the boot camp over a common love of programming and learning, and this autumn, we will be doing it again.

Our boot camp will once again feature the all-time greats Mike MikeMirzayanov Mirzayanov, Andrey andrewzta Stankevich, Michael Endagorion Tikhomirov, Gleb GlebsHP Evstropov, Artem VArtem Vasilyev, Ivan ifsmirnov Smirnov and other world renowned Russian coaches to train the participants.

Expect the most challenging problems, surprise guests and speakers, a branded hackathon, and finally the online round held on Codeforces, so everyone can join the onsite participants, at the finale of the event.

During the nine days of the event from Sept 26 to Oct 4, 2018 in Barcelona, teams will be participating in practice contests, problem discussion sessions and lectures.

Learn more about Barcelona ICPC Bootcamp

You can ask any questions by email: hello@harbour.space

UPD. Контест завершён!

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

Место Участник Задач решено Штраф
1 Farhod 7 353
2 MrDindows 7 362
3 tzuyu_chou 6 205
4 Wild_Hamster 6 248
5 spj_29 6 252

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

Место Участник Число взломов
1 halyavin 225:-5
2 MarcosK 22:-3
3 sfialok98 5
4 Rhouma 4
5 FakeGuy 3
Было сделано 307 успешных и 245 неудачных взломов.

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

Задача Участник Штраф
A 300iq 0:01
B HIT_Zero 0:13
C Dalgerok 0:07
D ruhan.habib39 0:08
E Dalgerok 0:14
F MrDindows 0:17
G chemthan 1:13

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

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

Will hacking phase be just 12 hours from now on?

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

Hope we won't wait till the next morning of the contest to know the result and rating changes :D

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

What does Codeforces have against Mexicans? That's two rounds at the same time as Mexico's matches in the World Cup :'(.

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

Hope to see good problems,not just implementations.

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

1000th contest

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

I expected special round for anniversary contest :(

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

can i hack which problem i have not solved?

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

Most of the hacking is done in first 2-3 hours. Mininize hacking phase to only 6 hours

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

12 hours to hack is toooooooooo long.

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

What does one mean by hacking problems? This would be my first contest of this type. Can someone please guide regarding the rules and terms ?

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

The 12 hour hacking seems to be useless as no one will waste that long time once they comes up with some hacks they tries them and leaves the site.

I can't understand why i am getting this many downvotes

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

Seems people are agreeing on minimizing the hacking phase...

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

i thinks educational hacks shoud give some (points) (reduce time)

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

now he is dead

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

Problem A fucked me deep....

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

problem E is not clear at all and explanation for the sample input/output is also missing.

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

code force is retarded. edu round is dumb. your all dumb

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

Problem F:

Should the answer to sample 3 and 0?

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

The test case for the D problem is not clear, 4 1 1 1 1 how can it have 7 good subsegment??

a1,a2,a3,a4 cannot be good subsegment because a1!=k-1 as given in the question?? can any one please explain?

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

    The task is to count subsequences which could consist of one or more consecutive subsequences which obey mentioned rules. [a1, a2, a3, a4] consists of [a1, a2] and [a3, a4] which are valid subsequences, therefore the entire subsequence is valid and should be counted.

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

TASK F demands wavelet trees i think or persistent segtree

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

What happened to 300iq ???

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

Nice contest, thanks, problems B, D and E are really nice. Problem A kinda awful though.

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

TASK F looks for wavelet tree or persistent segtree's.

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

    You can do F with regular segment tree.

    The idea is to sort queries by start-index, and only keep indexes i, such that index i is the first time number V[i] appears in [start-index, n).

    For each such number, store where the next same number is.

    Now, you just want to find the maximum element in an interval. If it's not large enough, answer is 0. Otherwise, its value is the answer.

    When moving to the next query, loop from last-start-index to start-index — 1, deactivate those indexes, and activate indexes of their values's next appearances.

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

A & B & C are mostly implementation problems. Is this really Educational round? Educational rounds used to be different.

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

How to solve G?

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

    What is the story behind your username mango_lassi? You don't seem Indian to me.

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

    Key idea, in my opinion, is to calculate for each i dpi — maximal profit of 2-path starting at i and finishing at i. If i is a root of tree, then dpi is just pretty standard dp for subtrees. To calculate dp for each vertex as if this vertex is root — it's possible with technique of "rerooting" (actually, I don't know it's real name as I don't know where to find materials to this quite standart technique).

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

How to solve C?

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

Wanna ask a question:

What should a person do after finishing problems he can do in an Educational Round?

(As for me, only problem G left, and I have about 20 minute, then I know how to solve G but I know I can't finish in 20 minutes.

Then I have nothing to do in these 20 minutes: sitting there pushing F5 and seeing my rank falling.

So guys, how do you handle these time ? :) (One may hack in a normal round)

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

For E does this work?

1) Find all cycles, and mark each edge in a cycle with 0 (and keep all other edges marked 1)

2) Start at a random node, and find the farthest node from it through a DFS, but by "farthest" i mean weighted distance where the markings denote weight. Denote this farthest node X

3) Similarly find the farthest node from X (with weighted distance, where edges in cycles are distance 0 and edges not in cycles are distance 1), denote this node Y.

Y is the answer

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

Never mind, it is indeed diameter

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

Hacking page is not loading..!!

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

Can Problem C be solved using Mo's algorithm?

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

    C? I don't think so. Doesn't even look like a Mo problem.

    Though F definitely has a Mo solution :D Our model implementation works a bit over TL (like 3.4 seconds) but couple of participants actually squeezed it.

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

      Can you please explain how to keep answer? I used unordered set, but I still getting TL

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

        You can store not the hashset but the whole array of number counts. Then you do sqrt decomposition over this array, you make updates in O(1) and then ask in . I believe, the code is pretty much self-explainatory.

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

          Isn't this Mo's Algorithm?

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

          What is the time complexity of such a solution, wouldn't using a set reduce it (despite large constants)?

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

            It's , I believe. No idea how to make a good use of set in that case.

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

            More precisely, In this task, using Mo's Algorithm, you will need to move left and right borders times, but asking for any element you will make no more than m times, so using sqrt-decomposition gives you slow asking operation (), but fast move operation (O(1)). In result you will get .

            On the other hand, using set will give you same complexity for asking and move operation, so result complexity will be .

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

          I tried to implement this idea but I got TLE, it seems that the comparator you used is the key to get Accepted, the solution passed in under 2 seconds after I tried it, can you explain how it works ?

          Update: I figured it out, this is a very clever trick :D The parity thing makes a block continue working from the index that the previous block finished working. This means that inside some block, the right index of mo's algorithm will keep increasing until it reaches the end, for the next block, it will keep decreasing while answering queries in the opposite direction instead of removing all the elements then increasing the right index from the beginning.

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

in problem C it happened for the first time that PYPY gave TLE and python 2 passed in 2345ms. When I saw the accepted solutions in pypy, there were only three and their time was also quite borderline. How can pypy be slower than python 2

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

I thought implementation for A is too heavy (for usual A in educational) until I see this submission...

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

if only the round would be extended for 1 minute, I would solve Е :(

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

Напомните, пожалуйста, зачем решили сделать образовательные раунды рейтинговыми???

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

Две ключевые задачи раунда были у нас на Московских сборах в явном виде

Е — https://informatics.msk.ru/mod/statements/view3.php?chapterid=113280

F — https://informatics.msk.ru/mod/statements/view3.php?chapterid=113873

Точно ли стоит делать такие раунды рейтинговыми?

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

    А много ли участников раунда бывали на этих Московских сборах или могли встретить эти задачи? (авторы придумали эти задачи независимо) Да, возможно таски не такие оригинальные, но конкретно этот пример мне не кажется показательным.

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

      Да, я согласен, что небольшое количество людей видело эти задачи, и тем не менее это не то, что я лично хотел бы видеть "рейтинговым раундом на Codeforces". Отнюдь не в обиду авторам, just my opinion.

      И я совершенно не против таких раундов с баянами\полу-баянами. Меня смущает только, что они влияют на рейтинг.

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

        Ок, значит наши критерии немного расходятся. Может даже и интересно получилось, что и мы, и составители задач на сборы посчитали данные задачи достаточно учебными для контеста)

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

        Не вижу проблем с рейтингом. Мне кажется, вероятность встретить на едуке задачу, которую уже решал, не настолько больше вероятности встретить такую на див2 раунде, чтобы совсем шаффлить ранклист.

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

      Не знаю насчет E, но F мало того что встречалась везде, так еще и должна была присутствовать в раунде 489 для заранее известного k вместо единички (по счастью, там нашлась задача лучше). Собственно, вот авторское решение той задачи 39709495 с k = 1.

      Так что да, баян, можно было найти что-то пооригинальнее

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

        А, ну да, точно, как мы могли забыть про это. В следующий раз будем осторожнее проверять всевозможные чаты с обсуждениями идей, чтобы ни с кем не пересечься.

        У нас была мысль дать её в онлайне, но как-то решили, что и так достаточно полезно для едука.

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

E is about finding the diameter of the tree of cycles, right?

But how do you find and isolate each cycle? Tarjan's algorithm only works in directed graphs and I couldn't figure out how to apply it on undirected ones..

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

maybe i should be saying sorry for this question , but can someone please explain to me A and why n — (all the sizes that are the same in old and new t-shirts sizes) is an logical answer ?

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

can anyone help me to understand the problem statement of E problem and the output of the given test cases?

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

May someone please tell me why my solution for A 39724005 is wrong?

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

Can anyone explain the approach to B? Thanks!

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

    Basically you should notice that the best is to insert the new number just next to some a[i] or just before it.

    So you can try all possibilites. To do that, could be a good idea to have an accmuluate array that tells how many time is on from number i to the end. Then you can go from left to right and get the answer for every possible insertion and take maximun.

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

Can Anyone please explain D and E.

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

    Let's denote with dp[i] the number of good subsequences of the array a[i...n-1], and define dp[n] = 0.

    The good subsequences of dp[i] either use the element a[i] or they don't. There are dp[i+1] good subsequences that don't contain a[i]. So we only need to count those that do.

    These subsequences might contain multiple good arrays. Let's focus on the first one. Its size is exactly a[i] + 1. If a[i] <= 0 then there are obviously no good array starting with a[i]. So assume that a[i] > 0 iterate over the last element in this good array. It can be any element a[j] with i + a[i] <= j <= n-1, and there are nCr(j - i - 1, a[i] - 1) possibilities to pick the middle elements of this good array. We count this sequence alone, and we can also combine it with each good subsequence in dp[j+1].

    Therefore we get the recursion:

    And the solution to the problem is dp[0].

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

Any one solved F using MO's Algo within TL ? UPD: 39735901

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

Can someone please help out with Problem C?

Thanks! I don't see a way to start. The tag said "SORTING," but I am not sure how to even apply it here.

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

    The keyword is "Sweep line algorithm".

    Basically you convert each segment [l, r] into two events (l, begin), (r, end), sort all those events and compute the answer by iterating over the events. At each event point you can compute the answer for the last interval [last_event + 1, current_event - 1] in constant time, since the number of segments doesn't change in this interval.

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

    This is actually a classic geometry concept, which is called "Line Sweep". It's called that because we can imagine a vertical line moving from left to right, covering all the points lying on the x-axis one-by-one. What we do is, store all the segments(x, y) separated in an array, with each element being (val, isStart), where val is either x or y, and isStart is 1 if it's an x value, and 0 if it's a y value.

    After storing all the segments this way in an array, we sort them according to their value. Then, we perform the sweep while keeping a counter open for the number of segments that are currently open. When we come across a value where isStart is true, that means that a segment is starting at this point, so we increase our counter open. And when we come across a value whose isStart is false, we decrease the counter open.

    This way at any point we know exactly how many segments are covering it, and using this we can find how many points have open number of segments covering them.

    Here is a tutorial blog about the line sweep technique: link

    And, here is my code for this question: link

    If you need any more explanation, do let me know!

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

That moment when your script hacks your own solution

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

Do all hacks run against all submissions at the end of hacking phase?

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

Come on ! Rating changes ?

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

For problem E this is an excellent link by IIIT Hyderabad threads on quora: https://threads-iiith.quora.com/The-Bridge-Tree-of-a-graph

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

Capture

truly a hacker...

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

when can I get the solution and the rating changes?

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

I found two pairs of people, which have one solution — 39722722 and 39716743; 39723479 and 39714675.

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

One of the best educational round I could see on codeforces, in terms of quality problems. Though I couldn't participate in the round.

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

The systest is really fast, but the rating changing is too slow... Maybe make it faster?

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

When will you publish the Editorial ?

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

Eagerly waiting for the editorials..when will they come?

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

Can F be solved with a mergesort tree? ( By keeping all the elements which occur once in the nodes. Also, merging is easy. )

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

Why is this code for problem C giving run time error on testcase 4?

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

When will you publish the editorial? I'm eager to read it :-)

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

Why for this graph answer is 1?

Please, someone, explain for problem E.

5 6 1 5 2 3 3 5 2 1 2 5 2 4

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

I tried to do problem E by compressing the cycles to a single node.My solution is running on my computer compiled with command g++ -std=c++14 but on submitting it is giving an error.

Diagnostics detected issues [cpp.clang++-diagnose]: =================================================================
==3384==ERROR: AddressSanitizer: heap-use-after-free on address 0x00f015dd at pc 0x010bb4ad bp 0x1179f0d4 sp 0x1179f0d0
READ of size 1 at 0x00f015dd thread T0
==3384==AddressSanitizer CHECK failed: C:\src\llvm_package_600-final\llvm\projects\compiler-rt\lib\sanitizer_common\sanitizer_symbolizer_win.cc:64 "((dbghelp && "failed to load dbghelp.dll")) != (0)" (0x0, 0x0)
==3384==AddressSanitizer CHECK failed: C:\src\llvm_package_600-final\llvm\projects\compiler-rt\lib\sanitizer_common\sanitizer_win.cc:795 "((owner_)) == ((LOCK_READY))" (0x4ac, 0xffffffff)
==3384==AddressSanitizer CHECK failed: C:\src\llvm_package_600-final\llvm\projects\compiler-rt\lib\sanitizer_common\sanitizer_win.cc:795 "((owner_)) == ((LOCK_READY))" (0x4ac, 0xffffffff)
==3384==AddressSanitizer CHECK failed: C:\src\llvm_package_600-final\llvm\projects\compiler-rt\lib\sanitizer_common\sanitizer_win.cc:795 "((owner_)) == ((LOCK_READY))" (0x4ac, 0xffffffff)
==3384==AddressSanitizer CHECK failed: C:\src\llvm_package_600-final\llvm\projects\compiler-rt\lib\sanitizer_common\sanitizer_win.cc:795 "((owner_)) == ((LOCK_READY))" (0x4ac, 0xffffffff)
==3384==AddressSanitizer CHECK failed: C:\src\llvm_package_600-final\llvm\projects\compiler-rt\lib\sanitizer_common\sanitizer_win.cc:795 "((owner_)) == ((LOCK_READY))" (0x4ac, 0xffffffff)
==3384==AddressSanitizer CHECK failed: C:\src\llvm_package_600-final\llvm\projects\compiler-rt\lib\sanitizer_common\sanitizer_win.cc:795 "((owner_)) == ((LOCK_READY))" (0x4ac, 0xffffffff)
==3384==AddressSanitizer CHECK failed: C:\src\llvm_package_600-final\llvm\projects\compiler-rt\lib\sanitizer_common\sanitizer_win.cc:795 "((owner_)) == ((LOCK_READY))" (0x4ac, 0xffffffff)
==3384==AddressSanitizer CHECK failed: C:\src\llvm_package_600-final\llvm\projects\compiler-rt\lib\sanitizer_common\sanitizer_win.cc:795 "((owner_)) == ((LOCK_READY))" (0x4ac, 0xffffffff)
==3384==AddressSanitizer CHECK failed: C:\src\llvm_package_600-final\llvm\projects\compiler-rt\lib\sanitizer_common\sanitizer_win.cc:795 "((owner_)) == ((LOCK_READY))" (0x4ac, 0xffffffff)
==3384==AddressSanitizer CHECK failed: C:\src\llvm_package_600-final\llvm\projects\compiler-rt\lib\sanitizer_common\sanitizer_win.cc:795 "((owner_)) == ((LOCK_READY))" (0x4ac, 0xffffffff)

Here is my solution. Any help ?

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

I have a strange behavior for my solution for Problem 1000G - Two-Paths. If I read integers with cin my solution (39859090) is Accepted. If I use scanf (39859098) or getchar (39859106) I receive "Wrong answer on test 9". How is that possible? In getchar-version I even checked whether input is fine, which seems to be the case (otherwise I would have received a Runtime Error). Can somebody figure out the reason?

Update: Found a small bug (using index outside of range of vector) and now it works (39861715). But the question remains: How can it make a difference whether I read with cin or scanf??