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

Автор -emli-, история, 7 лет назад, По-английски

Two contests AtCoder Regular Contest 072 and AtCoder Beginner Contest 059 will be held at the same time.

You can participate in whichever contest you want. (However, you can't register to both competitions.) The last two tasks in ABC are the same as the first two tasks in ARC.

Time: April 22nd (Saturday), 21:00 JST

Duration: 100 minutes

Number of Tasks: 4

writer: hogloid

Rating: 0-2799 for ARC, 0-1199 for ABC

The point value are:

ABC: 100 — 200 — 300 — 500

ARC: 300 — 500 — 900 — 900

We are looking forward to your participation!

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

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

How to Solve Problem D?

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

    write stupid solution, and then you can notice that if abs(x — y) <= 1 answer is Brown else Alice

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

      It seems that this way helps a lot.

      Implementing a Brute Force Solution then trying to notice the Sequence.

      Nice Job 300iq Thank You.

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

        Can you post the stupid solution?

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

          I could not even write that stupid solution correctly :(

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

            I think this is enough.

                boolean solve (int x, int y) {
                    if ((x == 1 && y == 1) || (x == 1 && y == 0)) 
                         return false;
                    boolean win = false;
                    for (int i = 2; i <= x; i += 2) {
                        if (!solve(x - i, y + i / 2)) win = true;
                    }
                    for (int i = 2; i <= y; i += 2) {
                        if (!solve(x + i / 2, y - i)) win = true;
                    }
                    return win;
                }
            
            • »
              »
              »
              »
              »
              »
              »
              7 лет назад, # ^ |
                Проголосовать: нравится 0 Проголосовать: не нравится

              Ohhhh,I put in the code powers of 2 ,not multiple of 2 :(

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

              I think even only this is enough :D

              boolean solve (int x, int y) {
                  for (int i = 2; i <= x; i += 2) {
                      if (!solve(x - i, y + i / 2)) return true;
                  }
                  for (int i = 2; i <= y; i += 2) {
                      if (!solve(x + i / 2, y - i)) return true;
                  }
                  return false;
              }
              
»
7 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

can anybody give hint for C? Greedy solution was incorrect.

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

    "For every i (1≤i≤n−1), the sign of the sum of the terms from the 1-st through i-th term, is different from the sign of the sum of the terms from the 1-st through (i+1)-th term."

    From this we know that the sign of the prefix Sums of the Solution will be like that in the end

    +Ve, -Ve, +Ve, -Ve, +Ve, ... or -Ve, +Ve, -Ve, +Ve, -Ve, ...

    So just take the minimum of transforming the Original Sequence to Both Solutions.

    If You are trying to transform the Sequence to one of the Solutions and the prefix sum of the first i elements should be positive but now it is negative you will need to make some operations to make the sum 1 (The least positive number), and If You are trying to transform the Sequence to one of the Solutions and the prefix sum of the first i elements should be negative but now it is positive you will need to make some operations to make the sum -1 (The biggest negative number).

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

      Thank You! I tried for any one sequence. If first one is +ve than +ve unless negative. Nice Approach.

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

How to solve E?