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

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

Привет, Codeforces!

25 сентября 2017 года в 13:35 MSK состоится очередной раунд Codeforces #436 для участников из второго дивизиона. Традиционно, участники из первого дивизиона приглашаются поучаствовать в соревновании вне конкурса. Обратите внимание на необычное время начала раунда!

Этот раунд проводится по задачам школьного этапа Всероссийской олимпиады школьников по информатике 2017/2018 года г. Саратова. Задачи для вас готовили Perforator, MikeMirzayanov и fcspartakm. Огромное спасибо тестерам: sdya и BledDest, а так же координаторам KAN и vintage_Vlad_Makeev.

Участникам будет предложено шесть задач и два часа на их решение.

UPD Если вы школьник из Саратова и писали сегодня школьный этап Всероссийской олимпиады по информатике, убедительная просьба не принимать участие в сегодняшнем соревновании!

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

Div. 2:

  1. zjt_ioi_2019_ak
  2. AngusRitossa
  3. Jha_The_ME_Coder
  4. cxh007
  5. Alexxx

Div. 1:

  1. Shik
  2. dreamoon_love_AA
  3. black_horse2014
  4. orbitingflea
  5. KassiJulgus

Разбор тут.

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

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

why it starts on that time ?? can't it just be as usual ??

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

Similar contest of last year : http://codeforces.com/contest/723

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

unusual bad start time,just why???

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

**It will be a little unusual round** — you will be given six problems and two hours to solve them what does it mean?

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

Wooow 3 contest in 3 days

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

Tough choice. Wake up at 3:30am or go to bed at 5:35am?

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

Hope I can become candidate master after this round.

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

scoring ..??

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

Russia's time is one o'clock in the afternoon, but for China is six o'clock in the afternoon. This is a good time for us, but it may be for some other people who need to stay up late at night or get up early in the morning.

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

    What does that mean?

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

      Well, in Most area in China, it's UTC+8. So it means if we want to join a contest which is held at six o' clock in evening in Moscow, it will be eleven'o clock in Beijing. In this case, most contests were hold in the midnight. To join it, we have to spend our sleeping time.

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

.

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

i hope clear and short statement.

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

Why so early. I'll be in school at this time(4

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

Было бы неплохо перенести его на часика 4 :)

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

I am a newbie and I wonder how to compare my rank profile to others in a picture? I need someone tell me plz. No down vote plz.

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

This round is very kind for China :)

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

I'm having a BED time participating this round...

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

is it rated?

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

Scoring?

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

hope to be green :(

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

3chenruiyangcsh, are you really a human???

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

FAQ: Why at this time?

Answer: The same problems were used at the school stage All-Russian Olympiad of Informatics, so it's important that it's participants shouldn't participate in this round, because they had the same problems 4.5 hours earlier.

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

nice pretests :)

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

Hack page is not loading properly.

»
7 лет назад, # |
Rev. 5   Проголосовать: нравится +15 Проголосовать: не нравится

RIP E. :(

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

I have a question on Problem A, why answer of this is not yes?

4 2 1 1 3 First one will choose 2 & second one will choose 1, then first one will choose 3. So both of them will have same numbers of card.

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

Kept getting Wrong Answer on pretest 3, Problem E. Any hints?

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

    I think it's just some small random test. I got wa on test 3 because I didn't maintain parent array correctly.

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

    well pretests are weak i guess i sorted the values by d before dp and another one in my room sorted by t both pretest passed

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

    This test help me:

    5
    1 2000 1
    1 2000 4
    1 2 19
    1 4 18
    1 3 17
    
    Ans:
    59
    5
    3 5 4 1 2
    
    • »
      »
      »
      7 лет назад, # ^ |
      Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

      The question's language is so bad :( I explicitly sorted :( WA

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

        I took dp[i][j] to be the min time required to get value of j from first i items. If I dont sort according to deadline I get wrong ans, but if I do I get right answer. I dont know how sorting is helping. Can u pls tell?

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

          Firstly, I mentioned sorting for the final part, when we have to print the answer.

          Coming to your question, sorting with deadline is necessary because if you don't, you might miss out some optimal combinations.

          Try running your code on mentioned test and realise:

          2

          2 5 3

          2 3 5

          ans:

          8

          2

          2 1

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

Missed a stupid edge case in problem C,ACed in the last 7 minutes ;/ Also guys,how to solve problem D ? I thought about it for a full hour,came up with 3 non working greedy solutions,

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

    D seemed ad hoc, I got AC in pretests. The number of changes is just n-number of unique integers in the input. And change the first duplicate to 1 and then the second duplicate to the next smallest possible element that's not in the array till now and fill like this. I hope it doesn't fail O.O

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

      wont your approach fail at test case number one, because the first duplicate is "3" at i = 1,so you will replace that 3 with "1" as "1" is not in the initial array, Next at i = 2, we get a[i] = 2 which is also a duplicate,so we will replace that with 4, yours should give answer 1 4 2 3 in this case.. I think I dont clearly understand your approach,please elaborate,thanks!!

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

        I passed the system tests yay! So yeah, I told a bit wrong. What I did was....

        Let the element to be replaced(in pace of a[i]) be cnt; if current element(2 in this case) is less than cnt, then I check if I have left any 2 before, if I have then I will change current 2 to cnt or else I will leave it and go to the next index and mark 2 as done. Code here: http://codeforces.com/contest/864/submission/30711359

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

Pretest 6 problem C?

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

Guys, I am new here at Codeforces, can anyone plz tell where i'll find the editorials to the contest problems ?

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

    Editorials will be avialable soon , link will be given in thi post after update. Also you can view editorial directly from problem page once they are released. Usually editorials are avialable with few hours .

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

Problem C

01:40:22 Pretests passed [pretests] → 30719776

01:53:58 Problem locked

01:55:26 Hacked by lyllyl

:( :( :(

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

CF — Predictor are it`s working with any one ??

i want to know my expected rate :( :(

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

Why do I like this contest so much?)

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

Hack for C: 10 8 6 2 Answer : 2

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

How to solve the problem E?

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

    Sort items by deadline:

    dp[j][t] — maximum value you can get, when you select from first j items, when you are at time t.

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

      How would you go about recovering the indices of the chosen items?

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

        Remember what are you doing in the state (if it is invalid — i.e. t >= d[i], move to dp(i,d[i]-1)). Then you can either take item i or do not take it and move to dp(i-1,t). When you recover the soultion, just follow the same decisions.

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

I noticed that this guy: ILIAz is accessing uninitialized variable in case the ans = 0: http://codeforces.com/contest/864/submission/30720468

Unfortunately my hack with 1 item did not work...

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

How do we do F?can anyone tell me please?

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

@admin I submitted E about a minute before the end of the contest. I straightaway got WA on pretest 1 which works fine on my system. Moreover, my submission can not be seen on the standings page. Please fix this. KAN

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

    Submissions not passing the first test are not shown on the standings and are not counted in penalty.

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

When you were about to solve E first time in your life but then you get WA because you wrote x instead of a[x][3]

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

...

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

For problem D,I'd like to know how my method is wrong...Thank you in advance.

Firstly count the unnecessary number in the sequence,(for example 2 2 then one of the 2 is not necessary ,it must be replaced by other number) and then set i =1 loop in range[1,n],when find a number which has appeared 2 or more times in the sequence then try to replace it,but if even the smallest number which haven't come up in the sequence is larger than this unnecessary number then we don't replace it;otherwise,replace the unnecessary number with the smallest number which haven't came up yet.

And for those number still not appear in the sequence(let them be a set),set i=n down to 1 loop,then perform the replace operation from the bigger to lower in the set then output the sequence

And I got WA on test 8,until the ending of the contest I didn't pass pretests and just lose the scores of the unsuccessful submissions and got a terrible standing ...As I'm not perform well in several current contests I don't want this bad condition continue I'm so sad...

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

    I tried the same approach as you and I cannot come with a test that makes my solution fail. Let's wait until tests are visible... :(

    upd: wrong answer 3183rd numbers differ — expected: '3390', found: '125991'

    I think it is better to continue thinking about it XD

    upd2: try this one

    5
    1 2 2 4 4
    

    Note that the missing numbers are 3 and 5. On the forward iteration we will replace the first 4 with our 3, and on the backwards one we will replace the second 2 with our 5. This will leave the array 1 2 5 3 4. However, note that we can get the array 1 2 3 4 5 by changing two numbers, too.

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

      Ouch...I got it now...Thank you(you are so clever...I didn't find such test cases before reading your comment by myself...

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

Me After seeing superfast system tests Image

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

Solved 3. Good for me or else i would have gone to depression.

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

How to solve F?

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

    Consider the arrays of short ints reach[3001][3001] and nex[3001][3001][13]. Define

    • reach[i][j] = 1 implies there exists a path from i to j. Easily generated with DFS.
    • nex[i][j][k] is the 2k + 1-th node on the optimal path from i to j,  or infinity if it does not exist. First generate nex[i][j][0] from reach,  and then generate nex[i][j][k + 1] from the values of nex[i][j][k].

    For a query (s, t, k) first check nex[s][t][12] and nex[s][t][0] to see if there is an infinite cycle, or a path does not exist. If none of these are equal to infinity, we can just compute the k-th node on the path in a similar manner to LCA.

    Of course, it is easier to just compute the answers in an offline fashion.

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

      I just read your code. I was amazed to see you use "short" while I received MLE using "int" in the contest.:( However,it seems that the time limit is so loose that I passed the problem by only storing nex[3001][3001][6] and brutishly use nex[x][y][5] when k is too large. Maybe it looks like a sqrt deviding.:)30738221

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

    A solution which probably uses a bit less memory than Benq's.

    After reading the input, sort adjacency lists by the endpoint node: this way doing a DFS traversal will result in ideal paths.

    Group all queries by the starting node. We'll answer each group separately with a separate DFS that starts from the starting node.

    Doing the traversal maintain some additional data structures:

    • A stack of the nodes on the current path (append the current node to it at the beginning of the recursive function and remove at the end).
    • An array to tell if a node is currently on the stack (in current path). We can reuse the same array that we use to mark whether the node has been visited.
    • Unordered set of nodes that form a loop: whenever we find an edge to a node that is currently on the stack, we add it to this set; before we end analyzing the node we remove it from this set (at the same time as we remove it from the stack).

    Whenever we reach a node which is an end point in any of the queries with our starting node and we did not compute the answers for them yet:

    • if the set is not empty, set the answer to -1 (we know that there is a loop that we can use to continue making the path to this node lexicographically smaller indefinitely);
    • otherwise, set the kth element of the stack as an answer for each of the corresponding queries.
»
7 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

То чувство, когда в Е при ценности 0, выводишь только один 0 и делаешь return (

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

Is this round rated?

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

Sorry, I've just made a mistake.

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

Could someone explain me the test case for F?

7 7 5
1 2
2 3
1 3
3 4
4 5
5 3
4 6
1 4 2 // 2
2 6 1 // -1
1 7 3 // -1
1 3 2 // 2
1 3 5 // -1

Here query(1, 4, 2) == 2. However, there is no ideal path from 1 to 4 (1-2-3-4 > 1-2-3-1-2-3-4 > ...).

Where am I wrong?

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

XD

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

Cant load the pages . Is sys test over?

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

How to solve problem C?

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

    Greedy + Simulation. Suppose you are at 0, if you can go to 0--->a---->f without refueling go, otherwise go to f first refuel and carry on. Vice versa for a to 0. Carefully implement it.

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

      It is giving wrong output on testcase 7. Can you help what corner case I am missing?

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

        You can see the test case on which your code is giving wrong answer. BTW, your condition for -1 is wrong. It should be if b < max(f,a-f) return -1.

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

    One way to solve problem C is using Dynamic Programming approach.

    Think on this function F( i, j ) = maximum amount of gas that I can have if I have had i journeys using j times gas station before.

    See my code for more details: 30708352

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

Why is the cf predictor not showing today's round ?

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

Rating update is taking so long. It seems it is compensating for fast system testing.

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

No mention of winners :( . Don't know I will ever come under 5 or not again :(

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

Lately, I'm constant af...

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

Thank you god for helping me not make systest failing bugs today. :)

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

It seems that there is only one people (me) confused by the definition of "lexicographical order" in Problem C.

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

I got hacked at a problem today. Can someone explain how hacking a problem works and how can I hack someone? Also, when will the editorial be posted?

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

Finally, I became candidate master!!!

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

I'm blocked on something silly and am unable to figure out whats wrong. Would be great if any of you could help! For problem E, In this submission, I have clearly sorted my vector before printing it. Yet, it somehow prints a non-sorted sequence. (Check verdict for test case 3)

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

    Test case 3) Participant's output 1 2 4 5 6 7 8 9 looks sorted to me

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

    deathsurgeon

    "In the third line print m distinct integers — numbers of the saved items in the order Polycarp saves them."

    The answer isn't necessarily sorted x)

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

    Firstly, I misinterpreted the question. Secondly, I also got confused between "output" and "answer" in submission. Ahh, I'm getting old at this :/ Anyways, thanks NMouad21!

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

Anyone got the idea of problem F test 13 query 24?

I saw many people failing on it... (including me...)

I was wondering if the algorithm was incorrect...

»
7 лет назад, # |
Rev. 4   Проголосовать: нравится +1 Проголосовать: не нравится

in problem 864E — Fire

I can't understand why it's right to sort the input by d and then calculate the answer with dp ,, t is also affecting the answer as t can be large and d small so i should take this value after other values with large d ?

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

    Consider any two items. If in the optimal answer, I am only going to take one of them, then their relative ordering doesn't matter.

    But if both of them are in my optimal answer, then which one would you take first? It makes sense to take the one which is ending first (i.e. has a smaller d value) than the one which is ending later (i.e. has a higher d value).

    Since if you first took the one which is ending later, and then took the one which is ending earlier, then you can also do the inverse, i.e. take the one which is ending earlier and then take the one which is ending later.

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

    Its about the order of choosing of course its better to choose the items with less d first so they wont be expired

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

    Imagine that d[i] + 1 is a moment when explosion hits i-th item. And DP approach here is just a process of caching recursive brute-force which would traverse items in increasing order of d[i] because it optimizes order preserving O(n!) bruteforce and overcomes 0-1 preserving O(2^n) bruteforce (there is no other simple bruteforces I've thinked about here).

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

Is there going to be a tutorial?

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

It seems Tutorial link under contest is wrong

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

Please hack my submission on problem D(Although someone helped me with my earlier idea about this problem right after contest but I came up eith a new method and passed the case he provided but got WA on test8...)I really don't know why this method got wrong answer...submission30755521 Thank you in advance.

The main idea I came up is to count the times every numbers appear int the sequence,and maintain a set containing all the missing numbers didn't come up in the sequence yet,and set a loop from 1 to n just to do such operation: if the number appear in this position is counted more than once,then replace it with the smallest number which didn't came up yet and decrease the counter of the original number in this position by 1(You will say this must be wrong but please go on reading...)After doing this we set a loop from 1 to n again and if find a position that the new number I just filled in it is larger than the original number in there before,then replace this number to the original number,push the replaced number(the bigger one) into a vector which contains all the numbers that must be replaced to more left position,at the same time maintain a vector to push back the last position of the original number in this sequence(it means that the bigger number will be put in sequence with the index as big as possible),then sort the position and the replaced numbers,and fill these pool numbers in these positions one by one.(Sorry for my bad English and description...

Thank you again for hacking this solution....

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

    try this case

    7
    6 1 1 6 1 1 6
    

    Your output

    5
    2 1 3 5 4 7 6
    

    Answer

    5
    2 1 3 4 5 7 6
    

    What's more...I failed to analyze the code so no solution or reason to be provided. :(

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

      Thank you very much...

      And now I think the reason why this code got wrong answer is just because in this method the sequence maybe have some missing numbers already in some positions which they are not going to be. (What a bad solution I created...:-(