Блог пользователя Shayan.To

Автор Shayan.To, история, 8 лет назад, По-английски
  • Проголосовать: нравится
  • +42
  • Проголосовать: не нравится

Автор Shayan.To, история, 9 лет назад, По-английски

Can any one help? this my submission -> 11834197

this are the segments: 1-4 10-18 23-29 33-43 46-57 59-77

and my code says to use these bridges:

11 17 19 20 24

Полный текст и комментарии »

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

Автор Shayan.To, история, 9 лет назад, По-английски

Hi. Can anyone tell me why i get time limit in this problem? I use Dijkstra like some other accepted codes. my submission -> 11774583

Полный текст и комментарии »

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

Автор Shayan.To, история, 9 лет назад, По-английски

Hi.

I have prepared 7 problems and their story and send Zlobober a message but no answer from him.

Can any one help me?

Полный текст и комментарии »

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

Автор Shayan.To, 9 лет назад, По-английски

I can not understand why my code make wrong answer for the last test. my algorithm is same as editorial and my code is like some others that I have seen. The question is 508C - Аня и привидения. the C problem of last contest. and my code: 9606896

int m, t, r;

int wr[305];

bool can[611];

int num[611];

int res = 0;

int main() {

cin >> m >> t >> r;

For(i, 0, m)
{
    cin >> wr[i];
    wr[i] += 304;
}

int now, need, j;
if (t >= r)
{
    For(i, 0, m)
    {
       now = wr[i];
       need = r - num[now];
       for (int l = 1; l <= t; l++)
       {
          if (need <= 0)
              break;
          j = now &mdash; l;
          if (can[j] != true)
          {
              can[j] = true;
              res++;
              need--;
              For(k, 0, t)
              {
                 num[j + 1 + k]++;
              }

          }

       }

       if (need > 0)
       {
          cout << -1 << '\n';
          return 0;
       }
    }
    cout << res << '\n';
    return 0;
}

cout << -1 << '\n';
return 0;

}

Полный текст и комментарии »

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