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

Автор yunetive29, история, 14 месяцев назад, По-русски

Спасибо за участие в раунде! Надеемся, что задачи вам понравились!

Автор и разработчик yunetive29

2059A - Миля и два массива

Решение
Реализация

2059B - Стоимость массива

Автор и разработчик yunetive29

Решение
Реализация

2059C - Обслуживание клиентов

Автор и разработчик yunetive29

Решение
Реализация

2059D - Граф и граф

Автор и разработчик yunetive29

Решение
Реализация

2059E1 - Хватит гамать (простая версия)

Автор shfs и разработчик yunetive29

Хинт 1
Хинт 2
Хинт 3
Решение
Реализация

2059E2 - Хватит гамать (сложная версия)

Автор shfs и разработчик yunetive29

Решение
Реализация
Разбор задач Codeforces Round 1002 (Div. 2)
  • Проголосовать: нравится
  • +77
  • Проголосовать: не нравится

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

Автокомментарий: текст был обновлен пользователем yunetive29 (предыдущая версия, новая версия, сравнить).

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

Auto comment: topic has been updated by yunetive29 (previous revision, new revision, compare).

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

Wait your released the editorial with code 30 minutes before round ended? That's absurd!?

EDIT: My apologies. I had a gap in my knowledge.

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

Skill Issue. I only solved AD lmao

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

Автокомментарий: текст был обновлен пользователем yunetive29 (предыдущая версия, новая версия, сравнить).

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

I personally felt problem B and C were nice! (even though problem B ruined my contest lol) Simple ideas, yet tricky!

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

304115975,304141983,304098763 Can someone hack them

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

I am quite shocked how my B passed the system tests. I was checking for min max in a range but forgot to sort the vector d. I realised this mid contest and was pretty sure it would fail the system tests because I myself can think of countless test cases to hack it. Or is it because of some mathematical property I am missing? Could someone explain?

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

Is it just me or B is unexpectedly hard today?

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

good contest , bad contest

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

my E1 Solution is much simpler than Tutorial : 304156702

just track the numbers you must push in next array by using queue

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

For B, I spent 1hour to find a case of which the ans is 3 to hack my wa submisson then I reallized it's impossible :( (I have no enough time to finish C)

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

Just found out my mistake in E1.

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

Just found out my mistake in E1 :(

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

I wanna become an expert. I have come close quite a few times but missed the mark by inches. Please suggest some resources so that I'll be able to do Codeforces Div 2 Problem D in upcoming contests.

Thanks in advance!!

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

When I saw D and thought about Dijkstra with $$$V = E = 1000000$$$, I thought about doing some kind of "BFS0/1" instead. Then I guessed the distance couldn't be greater than $$$n\times n$$$ (guessed any reachable vertex can be reached in less than n steps, now I think it's actually 2n steps.) and did a BFS with $$$(n+1)\times (n+1) + 1$$$ queues. Hack here if it's wrong -> 304106582

Anyway, $$$O(n\ log\ n)$$$ for $$$n = 1000000$$$ and TL = 2s is the new standard?

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

A much simpler implementation of E1 304178286

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

can anyone explain the last sample testcase of E1.

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

can someone explain how the answer can be 3 for this test (for c problem):
4
4 2 2 17
1 9 3 1
5 5 5 11
1 2 1 1

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

i was thinking of trying e1 before D because of the score distribution,, glad i looked at the number of submissions ,,

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

In D. Graph and Graph
tutorial: "the number of edges in the new state graph will not exceed m1.m2"
I must be stupid, but please correct me.

The number of edges (E) in the new state graph will be of order 10^3(m1)*10^3(m2) i.e 10^6
The number of vertices (V) will be order n^2((10^3)^2) i.e 10^6.... though we may not visit all vertices here.

But the time complexity of Dijkstra with binary heap is
O(V*(Extract_Min) + E*Decrease_Key) = O(V logV + E log(V))
which here results to (10^6 * log2(10^6) + 10^6 * log2(10^6)) = 2*(10^6 * 20) = 4*10^7

Questions ?
- What am I missing here ?
- How many operations are allowed in 1sec ? if am not wrong is 10^6 simple operations(not %, /)
- How do we calculate time complexity here?
- How many operations are performed here ?

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

for the first problem, a = [2,2,3] => set of a has {2,3}, size=2; b= [2,2,3] => set of b has {2,3}, size=2; so total size >=4. But the answer is 'NO' only 2+2,2+3 or 2+2, 3+3 are possible. Am I wrong or the solution is wrong

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

Is there a name for the technique in D? I've never seen it before but it's very cool.

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

    It's Dijkstra Algorithm

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

      I know that, I meant the way that the states are tracked in the 2d array

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

        I also wanted to know, the dijsktra on 2d states track also caught me off guard. (I will never thought of that on a whim)

        If I was trying to crack D in live contest, I'd bet it on BFS 0/1 state with max steps = 2n.

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

        In graph theory, when you define a graph, a "vertex" is just not a simple thing with 1 number. A "vertex" in graph can also be a state, such as if you playing chess, each vertex is a chess board and if you play a move, so the old chess board can connect to a new chess board, etc.

        So in this problem, you should consider that a "vertex" is a pair of numbers <u1, u2>. If u1 is adjacent to v1, u2 is adjacent to v2, so "vertex" <u1, u2> is connect to <v1, v2> with cost |v1 — v2|

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

Can anyone help to give the countercase or find the testcase on which my submission for E1 is failing.

My-submission

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

can anybody explain why i am getting a Tle for this submission of mine 304236998 for the problem D.

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

shfs hey I think my submission for E1 seems to work when B doesn't have distinct elements either.

304147683

I tried the following case

1
3 3
1 2 3
4 5 6
7 8 9
1 10 2
1 2 11
12 3 4

and it returns 5 as expected.

I would stress test to make sure I'm right but I'm not sure how would a brute force look like. can you share the brute force you used to test your solution in E1?

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

B is Constructive. It was not able to solve it but it was intresting idea when I saw the editoral

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

For problem B, in the fourth example, the answer is 1

5 4 1 1 1000000000 2 2

I think this is wrong: 4 subarrays [1],[1],[1000000000], [2,2] b = [1, 2, 2, 0]

Why is the answer not 3?

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

Can anyone uphack my solution for B. https://mirror.codeforces.com/contest/2059/submission/304209911

TC :

1

7

6

1 2 2 2 2 3 3

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

kinda suprised D has a lot of solves. Is the idea obvious or pretty standard

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

For D, I did something like :310452937

Each state in the PQ is (sum, s1, s2, zero_cnt), tracking the total cost, token positions in both graphs, and how many times we got consecutive zero-cost move. If zero_cnt == 2, we're done and print sum. Otherwise, keep expanding (u1, u2) pairs and push new states.

Also used visited maps, if it runs too long, i stop it and return -1.

Anyway, still not sure why no tle. Cool question though

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

I think B is the most worst Problem