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

Автор Vladosiya, история, 3 года назад, По-русски

Привет! В 25.07.2023 17:35 (Московское время) начнётся Codeforces Round 888 (Div. 3) — очередной Codeforces раунд для третьего дивизиона. В этом раунде будет 6-8 задач, которые подобраны по сложности так, чтобы составить интересное соревнование для участников с рейтингами до 1600. Однако все желающие, чей рейтинг 1600 и выше могут зарегистрироваться на раунд вне конкурса.

Раунд пройдет по правилам образовательных раундов. Таким образом, во время раунда задачи будут тестироваться на предварительных тестах, а после раунда будет 12-ти часовая фаза открытых взломов. Мы постарались сделать приличные тесты — так же как и вы, мы будем расстроены, если у многих будут падать решения после окончания контеста.

Вам будет предложено 7 задач и 2 часа 15 минут на их решение.

Штраф за неверную попытку в этом раунде будет равняться 10 минутам.

Напоминаем, что в таблицу официальных результатов попадут только достоверные участники третьего дивизиона. Как написано по ссылке — это вынужденная мера для борьбы с неспортивным поведением. Для квалификации в качестве достоверного участника третьего дивизиона надо:

  • принять участие не менее чем в пяти рейтинговых раундах (и решить в каждом из них хотя бы одну задачу)
  • не иметь в рейтинге точку 1900 или выше.

Независимо от того являетесь вы достоверными участниками третьего дивизиона или нет, если ваш рейтинг менее 1600, то раунд для вас будет рейтинговым.

Задачи были придуманы и написаны нашей командой: myav, Aris, Gornak40, ibraevdmitriy и Vladosiya.

Также большое спасибо:

  1. MikeMirzayanov за системы Polygon и Codeforces.

  2. tute7627 за красное тестирование раунда

  3. oversolver, sevlll777, pavlekn, zwezdinv, Sokol080808, 74TrAkToR, vladmart, EJIC_B_KEDAX, Vladithur, KseniaShk, Be_dos за жёлтое тестирование раунда
  4. moonpieXXIV, FBI, meowcneil, NintsiChkhaidze, Phantom_Performer, JuicyGrape, spike1236, MagnusCarlsen321_alt за фиолетовое тестирование раунда
  5. TheGoodest, Pa_sha, Sasha0738 за синее тестирование раунда
  6. Syuzi777, Tahseen за бирюзовое тестирование раунда

Всем удачи!

UPD: Разбор

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

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

May 19, 2023 what

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

//I don't know why, but my comment got sent 2 times, don't pay attention

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

hoping to solve atleast 3 problems

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

it's ironic that all the testers are not actually eligible for div 3...

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

Hoping to become Expert in this round

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

why is there no cyan, green or gray testers?

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

i hope to be blue this time

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

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

I have a really good feeling about that this would be my last rated Div. 3 contest and I would have become a blue expert after this 888ᵗʰ round of Codeforces!! May the Force be with us

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

I have exam (TT — TT)

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

Hopefully, we will see a problem connected with number $$$8$$$, lol.

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

I think most of Div.3's are made by Vladosiya

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

div3

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

best part of the comment section is I see anime pfpS and discover new interesting animes

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

I think this will be a good one

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

I hope this round will be the great round of Div.3!

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

Good luck

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

how many problems i have to solve to become pupil??

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

Out of competition, but I'll try my best to do it ^_^

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

It is so good to have a contest every few days, hopefully i can cross 1500 today

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

I don't know if this is the right place to say this, but I've noticed for a while now that div3 round announcements say that you can only qualify as a trusted div3 participant if you "do not have a point of 1900 or higher in the rating." Shouldn't that number be 1600 instead?

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

    I think this is a translation error. My understanding (from the original announcement of the trusted participant system) is that you must never have had a rating above 1900. In other words, if your rating is above 1900 at one point but then falls below 1600, Div. 3 rounds will be rated for you, but you will not appear in the official standings.

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

Experts to lower rankings in Div.3 be like:

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

After playing div2,I feel that div3 and div4 are still suitable for me

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

Tends to Pupil:)

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

hoping to solve at least 4 problems

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

In first line of blog "You will be offered 6-8 problems" .Later "You will be given 7 problems and 2 hours and 15 minutes to solve them ".So, 7 problems will be there ?.

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

It's fun that the round will be rated for me.

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

hope to be specialist in this contest

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

I am at the lowest confidence in my life.

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

Good Luck everyone

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

I will solve atleast 5 problems.

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

so she knows what awaits her. emmmmmmhahahahaha~

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

Thank you Vladosiya very much. This is the best Div.3 contest I've ever written.

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

Why I an rated ??????

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

Readforces

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

any hints to G?

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

Yes/NoForces

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

D: Let difference d[0]=a[0], d[i]=a[i]-a[i-1] when i>0. If the missing prefix sum is n*(n+1)/2, then {d[i]} will be a permutation of [1, n] missing one element. Therefore, for this case we need to check in {d[i]} are pairwise distinct and inside range [1, n]. Otherwise, we will have a[n-1]=n*(n+1)/2, and n-2 elements of {d[i]} will be inside [1, n] and distinct, the last element will be the sum of 2 missing elements. So for this case we need to check if {d[i]} contains n-2 different numbers inside [1, n].

E: First for potions with infinite supply we can just set their cost to 0. Then, if potion i can be obtained mixing {j[1], j[2], ...}, we add a directed edge (j[t] --> i) for each j[t]. Since no potion can be obtained by mixing itself, these edges will from a DAG (directed acyclic graph), and we can run dp on the topological order of the DAG: Let dp[i]=sum(cost[j]) where edge (j --> i) exists, and cost[i]=min(cost[i], dp[i]).

F: If a[i], a[j] and x have only 1 bit, then if a[i]==0, a[j]==0, we can set x=1 then (a[i]^x)&(a[j]^x)=1, if a[i]==1, a[j]==1, we can set x=0 then (a[i]^x)&(a[j]^x)=1, if a[i]!=a[j], no matter how we set x, (a[i]^x)&(a[j]^x)=0. So we need to find (i, j) such that a[i]==a[j]. For general cases, we need to minimize (a[i]^a[j]) so that sum(t: 0<=t<k, the t-th bits of a[i] and a[j] are same)(1<<t) = (1<<k)-1-(a[i]^a[j]) is maximized. This can be processed using a trie, or sort a[i] and find the minimal a[i]^a[i+1].

G: For a single query (a, b, e), the maximum height of nodes on the path cannot exceed h[a]+e, which means, we can pass an edge (u, v) if max(h[u], h[v])<=h[a]+e. Therefore, we can sort queries by h[a]+e and sort edges by max(h[u], h[v]), then solving queries using dsu.

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

    F can be solved by property of xors:

    min(x^y, y^z) < x^z , for all non-negative integers x, y, z (x < y < z)

    so we can sort a, and find min xor of all a[i] ^ a[i + 1]

    sort(all(a));
    for(int i = 0;i < n - 1;i++){
        if((a[i + 1].fi ^ a[i].fi) < mn){
          mn = (a[i + 1].fi ^ a[i].fi);
          ans = mn | ((a[i+1].fi ^ ((1 << k) - 1)) & (a[i].fi ^ ((1 << k) - 1)));
          I = a[i+1].se;
          J = a[i].se;
        }
    }
    
    • »
      »
      »
      3 года назад, скрыть # ^ |
       
      Проголосовать: нравится +11 Проголосовать: не нравится

      Is there any intuitive proof of this property of xor?

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

      Why ans can be calculate by ans = mn | ((a[i+1].fi ^ ((1 << k) — 1)) & (a[i].fi ^ ((1 << k) — 1))); ?

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

        actually it is just: ans = (a[i+1].fi ^ ((1 << k) — 1)) & (a[i].fi ^ ((1 << k) — 1));

        at first we want to maximize some (a[i] ^ x) & (a[j] ^ x), now suppose we want to use some Kth bit up to k, then you can see that Kth bit have to be in both of a[i] and a[j], or doesn't appear in both of them,

        proof

        from above it is easy to see that it is efficient to minimize xor

        so we don't care about cases where a[i] has some bit and a[j] hasn't or reversed.

        there left two cases:

        |1. both a[i] and a[j] have some Kth bit

        to get this bit we shouldn't use it in our x, (1 ^ 0) & (1 ^ 0) == 1

        |2. both a[i] and a[j] have not some Kth bit

        to get this bit we have to use it in our x, (0 ^ 1) & (0 ^ 1) == 1

        since we can use all bits up to k, our x should contain all bits up to k, where a[i] and a[j] haven't them.

        |1. (a[i+1].fi ^ ((1 << k) — 1) taking all zeros from a[i] up to kth bit

        |2. (a[i].fi ^ ((1 << k) — 1) taking all zeros from a[j] up to kth bit

        |3. (a[i+1].fi ^ ((1 << k) — 1)) & (a[i].fi ^ ((1 << k) — 1)) combining zeros, where a[i]'s Kth bit = 0 and a[j]'s Kth bit == 0

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

    How do you thing is it possible to solve G if queries are online?

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

    minimizing xor of two elements can be done easier: sort the array, answer will always be the xor of two consecutive elements.

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

    F can be solved by max prefix for the binary presentation, there's maximum two unique numbers with the same max prefix. once we identify the max prefix, we can use a map to collect the ones that have the same max prefix, or we can just sort and compare adjacent elements.

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

Bad statement for most problems :(

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

Yes-NoForces!!

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

i feel language was bit difficult.

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

Learning tries was after all worth it saving me today. Problem F felt really good to AC :)

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

It was hard for me to concentrate on reading those problems, I liked it tho

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

D was awful, imho

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

I think my F is hackable

Submitted just after the contest got over.

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

Overall looks like a decent div3 contest, I have enjoyed solving A-E.

  • A — might be a little bit too much text for a div3A problem, but nothing too extreme
  • B and C — both are fine problems imo
  • D — some case work, nothing too dramatic, but I still have no idea how to prove my solution (also randomly got 50 additional penalty because I trolled myself again)
  • E — a problem about my favorite topic, I can see how this statement can confuse some people, but I myself probably couldn't phrase the condition of a graph being a DAG better
»
3 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

How to solve E ?

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

I thought that G was about finding a path, so that $$$max - min \le e$$$. Btw, would there be a solution if this was asked?

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

Lets Go Pupil here I come..........

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

rank 834 can add 39 to become expert?

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

Nice problems but bad statments for most of them , thanks anyway!

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

What the hell

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

Can someone share their solution to B, C and D.

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

    B — sort odd values and even values while not swapping odd and even with eachother, then check if array is sorted. C — you need to find shortest prefix that there are at least $$$k$$$ occurences of $$$c_1$$$, and the shortest suffix that there are at least $$$k$$$ occurences of last color. If first and last are equal, you just need to check that there are $$$k$$$ tiles with color $$$c_1$$$, else you need to check that sum of lengths of the found prefix and suffix is less or equal to $$$n$$$ D — didn't attempt

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

problem E is an easy version of one of the provincial team selection test for NOI of Ahhui, China 2014(AHOI2014) problem. See in here:https://www.luogu.com.cn/problem/P4042

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

a

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

D was frustrating.

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

can some one explain this sample case for problem E

    4 2
    1 1 5 4
    2 4
    3 2 4 3
    0
    2 2 4
    1 2

how is the answer 0 0 0 0 , here

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

In problem A, is there any specific reason why Vlad cannot talk to the person on the same steps of the escalator??

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

Hello, could someone please help me figure out why my code is giving a runtime error on E? I don't usually use python https://mirror.codeforces.com/contest/1851/submission/215620727

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

Lol I didn't even understand the statement of problem E. Eventually, i just did wat-task-told-me-to-do + my guess and intuition and AC-ed :D

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

if problem E, the statement "Moreover, no potion can be obtained from itself through one or more mixing processes." is removed, I guess we need a scc to solve it?

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

    No, because if there is a cycle, then you:

    a) have one of the potions in the cycle which is trivial or

    b) don't have any of the potions. In that case, you will eventually revisit a node. Since a revisit is only possible due to a cycle, you will realize that the node came via a cycle and then can just buy the cheapest potion in that cycle.

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

Time to switch to hackforces

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

Problem statement is very hard

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

Thank you for having blank lines after the answer after every test case in Problem G. It made understanding the sample answer easier.

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

    Could you share your approach for G?

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

      Let $$$H$$$ be your current height and $$$E$$$ your current energy. If we go $$$x$$$ units up, your height changes to $$$H + x$$$ and energy changes to $$$E - x$$$. On the other hand if we go $$$x$$$ units down, your height changes to $$$H - x$$$ and energy changes to $$$E + x$$$. In both cases, the sum of your height and energy stays constant (equal to $$$H + E$$$, the sum of your original height and energy).

      Consider some query where you start from mountain $$$a$$$ with $$$e$$$ energy. This means that anywhere you go, the sum of your height and energy will be $$$h_a + e$$$. In order for your energy to stay non-negative, your height must not go above $$$h_a + e$$$. This means that you can go to any mountain $$$u$$$ with height $$$h_u \le h_a + e$$$ and you cannot go to any other mountains.

      Now, we can solve the problem in the following way:

      Consider the mountains and roads as an undirected graph. We will keep a DSU to tell which nodes (mountains) are reachable from each other.

      Sort all nodes $$$u$$$ in increasing order of $$$h_u$$$ and sort all queries in increasing order of $$$h_a + e$$$.

      When handling a query, we need to add all nodes $$$u$$$ with $$$h_u \le h_a + e$$$ and edges between them into the DSU. We can iterate over all nodes satisfying the above which have not yet been considered and add all edges going from those nodes to nodes with lower height to the DSU. After that, the answer to the query is YES iff nodes $$$a$$$ and $$$b$$$ are in the same component.

      Doing the above for all queries using a two-pointer approach is $$$O(n\cdot\alpha(n))$$$.

      Total time complexity: $$$O(n\log n)$$$ due to sorting.

      (slow) implementation: 215567991

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

Hope to become newbie after this contest

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

I couldn't debug G in time.Loved all the problems.

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

My thiscode gives correct output on my compiler and also on online compilers but somehow this is giving wrong answer on the Codeforces judge , what's the reason , please look into it.

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

I have doubt in problem statement of problem E.It is not mentioned whether cycle will exists or not.

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

In F there is no need to know Trie , my solution is just greedy + binary search

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

Can anyone please explain the statement of problem e i still can't get it

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

    There are $$$n$$$ potions, each has its own cost. Each of the potions can either be bought or obtained by mixing some of the other potions. You have an unlimited number of $$$k$$$ potions which means you can use them for free. For each potion determine the minimal cost you should spend in order to obtain it.

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

The contest was really nice! Though a lot of solutions were leaked during the contest on youtube, would request to run tougher plagiarism checks for this contest and ban those IDs who posted the solutions on youtube or copied them.

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

i took this contest while in an airport lol

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

can someone help me understand why am I getting runtime error for this code (problem C round 888 div3):

#include<bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n,k,w,flag1=0,flag2=0;
        cin>>n>>k;
        int l=k;
        vector<int> v;
        for(int i=0;i<n;i++)
        {
            int m;
            cin>>m;
            v.push_back(m);
        }
        int cnt=0;
        if(k==n && n==1)
        {
            cout<<"Yes"<<endl;
        }
        else if(v[0]==v[n-1])
        {
            for(int i=0;i<n;i++)
            {
                if(v[i]==v[0])
                {
                    cnt++;
                }
            }
            if(cnt>=k)
            {
                cout<<"Yes"<<endl;
            }
            else
            {
                cout<<"No"<<endl;
            }
        }
        else
        {
            for(int i=n-1;i>=0;i--)
            {
                if(v[i]==v[n-1])
                {
                    k--;
                }
                if(k==0)
                {
                    w=i;
                    flag1=1;
                    break;
                }
            }
            for(int i=0;i<w;i++)
            {
                if(v[0]==v[i])
                {
                    l--;
                }
                if(l==0)
                {
                    flag2=1;
                    break;
                }
            }
            if(flag1==1 && flag2==1)
            {
                cout<<"Yes"<<endl;
            }
            else
            {
                cout<<"No"<<endl;
            }
        }
        
    }
}
»
3 года назад, скрыть # |
 
Проголосовать: нравится -6 Проголосовать: не нравится

Can E be solved using Dijkstra?

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

Why am I not in the standings?

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

F is similar to 1721D.

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

waiting for editorial...

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

in D testcase 10:
prefix sum is: [13 21 36 42]
could not we assume initial array like this? [13, 8, 15, 6, 2]

[13, 8, 15, 6, 2] -prefix sum-> [13, 21, 36, 42, 44] and assume he lost [44]

what i am doing wrong?

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

    initial array is not a permutation. Your task is to find out if the given array can matches permutation. A permutation of n elements is an array of n numbers from 1 to n such that each number occurs exactly one times in it.

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

I was able to solve one problem, but still am unrated. Any reason for that?? (This was my first ever contest. Sorry if I'm being dumb)

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

Boy was that a hard round. I could solve A and B in the first 40 minutes, and could only think of a DP solution for C :cry:

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

Why the contest is begin shown unrated despite of being written "rated for less than 1600"?

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

seems that I have my first aked Div.3 contest :)

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

Who knows, has system testing already ended or not?

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

My solve E O(n) has Time Limit 14 bruh?!?!?!

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

Testing has finished.When will rating update ?

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

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

My solution for D fell on system tests because I used int instead of long long in one line where I forgot a_i <= 1e18 when I was writing it. This is really annoying, and I think that a test case like that should've been on main tests. But oh well, lesson learned, from now on I'm always using #define int long long

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

Reached Pupil after this contest that I'm happy

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

Hoorah! My rating became >1000 this round :D

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

This contest is quite good

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

Finally made it to Pupil after a year of hard-work 😊

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

https://mirror.codeforces.com/contest/1851/submission/216352004

wrong answer Jury has better answer (13) than participant (12) (test case 1)

Jury output: 1 3 14 My output: 1 3 12

(3⊕14)&(1⊕14)=(0011⊕1110)&(0001⊕1110)=1101&1111=1101=13

(3⊕12)&(1⊕12)=(0011⊕1100)&(0001⊕1100)=1111&1101=1101=13

What is wrong with 12 as 'x'?

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

Hello MikeMirzayanov,

Today I got a message from the system regarding the coincidence of my submission with my friend P-recursive-function submission.It is because of using common resource. In these codes we used the same templates for graph, topological sort, and for debugging. This is the proof for same. Graph template Topological sort template Debug template. However, the main logic is different.

We(Me and P-recursive-function) hail from same college and follow the same resources for practicing. We also have a combined repository. You can see the same here. I agree that it's my mistake that I didn't give the credit to the author for using his/her template. You can also check our previous graph or tree based question solutions where we have been using the same templates.

Thank you for providing this excellent platform.

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

my solution got skipped just because logic looks like others but i worked it after one wrong submission and just optimized it several times so not my fault it looks like others solutions

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

Attention!

Your solution 215580877 for the problem 1851E significantly coincides with solutions Milind_Sharma/215580877, fredreicc_/215618955. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://mirror.codeforces.com/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked.

This is ridiculous, having same logic does not mean copied code, all of my submissions are now skipped. I have never copied a single code in any of my past contest. This is clearly a false positive.

I fail to see how my code is similar to the other user, also I submitted around 1 hour earlier.

Please take a look at the codes yourself and decide 215580877 and 215618955.

MikeMirzayanov Vladosiya

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

    MikeMirzayanov Vladosiya I have too been plagarised in this contest unnecessarily. I have even solved F problem that too within first 30 min. please check my code its not at all similar with others. I dont understand why I got plag. I had simple dfs call so that i can calculate the answer minimum just by topo sort. PLease see my code and give my ratings back. Its clearly wrong to plag someone who works hard. Kindly look into it and help me out.

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

'MikeMirzayanov Vladosiya Your solution 215615024 for the problem 1851E significantly coincides with solutions steve58/215601188 ...This is something not expected from codeforces the solutions by this guy and me is completely different I have used a simple graph topo sort which is having very common template of dfs call let me show you my code:

Here after taking the cost and making changes in its value depending upon free resources I had topological sorting in my code.I have used a simple dfs function which goes and checks its neighbours ahead then finally in ans array i stored the final minimum value of the cost and after topo sort value. My code is way different from one I am plagarized with . Please look in it and give my ratings back.


#include<bits/stdc++.h> using namespace std; #define all(x) x.begin(),x.end() #define ll long long #define ld long double #define fuk return #define getunique(v) {sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());} #define pb push_back #define tr(it,a) for(auto it=a.begin();it!=a.end();it++) #define fo(i,n) for(int i=0;i<n;i++) #define fop(i,x,n) for(int i=x;i<=n;i++) #define forv(i,l,n) for(int i=l;i>=n;i--) #define nl <<endl; typedef pair<ll,ll> pl; typedef vector<ll> vl; typedef vector<bool> vb; typedef vector<ld> vd; typedef vector<string> vs; #define inp(v, n) for(int i=0; i<n; ++i) cin >> v[i]; #define opt(v) for(auto x: v) cout << x << ' '; cout nl const ll mod = 1000000007; const ll N = 2e5+10; #define IOS ios::sync_with_stdio(0); cin.tie(0);cout.tie(0); ll bin_exp(ll a, ll b=mod-2, ll mod=mod){ ll ans = 1; while (b){ if(b % 2) ans = (ans * a) % mod; a = (a * a) % mod; b /= 2; } return ans%mod; } vl ans; ll n,k; vl c; vector <vector <ll> > v; void dfs(ll node){ if(ans[node]!=1e18) return; ll q=c[node]; ll tot=1e17; for(auto p:v[node]){ dfs(p); if(tot==1e17)tot=ans[p]; else tot+=ans[p]; } ans[node]=min(tot,q); return; } void solve(){ // fo(i,N) ans[i]=1e17; v.clear(); // fo(i,N) c[i]=1e17; cin>>n>>k; v.resize(n+1); c.resize(n+1); ans.resize(n+1); fo(i,n) ans[i]=1e18; ll p[k]; ll cost[N]; fo(i,n){ cin>>c[i]; cost[i]=c[i]; } fo(i,k){ cin>>p[i]; c[p[i]-1]=0; // ans[p[i]-1]=0; } fo(i,n){ ll f; cin>>f; ll k=0; fo(j,f){ ll p; cin>>p; p--; v[i].push_back(p); } } // fo(i,n){ // ll k=0; // ll f=0; // for(auto q:v[i]){ // f=1; // k+=cost[q]; // } // if(f) // cost[i]=min(cost[i],k); // } fo(i,n){ dfs(i); } fo(i,n){ cout<<ans[i]<<" "; } cout nl } signed main(){ IOS ll t; cin >> t; while(t--) solve(); return 0; }
»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hello, MikeMirzayanov Today, I've received a message from noreply@codeforces.com that my code for the problems A and B are similar to the codes of the user kishorenanda. I really don't know this person and even where is he (or she) from. The codes are really short, so they could be similar to the codes of any other person who had just the same idea. But now all the solutions that I've sent to the system are erased from my official sendings. Rewatch my solutions, please. My solution for A: 215511238 My solution for B: 215514366