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

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

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

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

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

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

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

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

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

Раунд основан на UKIEPC 2024: Spring Practice. Пожалуйста, воздержитесь от участия в этом раунде, если вы знакомы с задачами этого соревнования.

Большое спасибо:

  1. Авторам оригинального соревнования: Aksenov239, MaxBuzz, RobinFromTheHood, darnley, izban, pkhaustov, lsantire, az453, fedor.tsarev, Shoaib Jameel.

  2. MikeMirzayanov за помощь с дополнением набора и системы Polygon и Codeforces.

  3. -is-this-fft-, peltorator, tute7627 за красное тестирование раунда.

  4. ibraevdmitriy, kaikey, gmusya, nika-skybytska, Giga_Cronos, diskoteka за жёлтое тестирование раунда.

  5. TypeYippie, kzyKT, tepamid, ahshafi за фиолетовое тестирование раунда.

  6. Abo_Samrah, Zandler, sam07a, YESMAKHAN, xygzy, Klaus26 за синее тестирование раунда.

  7. Morvolzz, dasha..zhilina, sutekine, Muhsen, Gojova, Acanikolic73 за бирюзовое тестирование раунда.

  8. Вам за участие.

Всем удачи!

UPD: Разбор опубликован.

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

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

well-balanced div3 round, GL for all participants 🏆

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

I can barely contain my excitement! I hope this will be a good one! GLHF!

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

As a tester, I hope you to enjoy the contest. Tasks are quite interesting and educational. Good luck!

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

As a tester, I hope you to enjoy the contest. Tasks are quite interesting and educational. Good luck!

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

Good round, come and participate.

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

Another Vladosiya round!!!

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

hoping to return back the blue handle

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

As a participant I have to say im excited.

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

wishing to get my Pupil back

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

Well GLHF, let's gain some rating!

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

as a tester , i hope you enjoy the round , a realy very good round <3

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

As a tester, I encourage you to read all the problems.GL and Happy Coding.

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

Hope i can solve till E this time

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

Looking forward to an AK, and GLHF to all participants, rated or not!

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

Hope to reach cyan this contest : >

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

Mewing cat ready for the contest

bye bye

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

Beautiful Contest...

I Loved Solving the problems...

Especially the relation "Money Buys Less Happiness Now" with "Money Buys Happiness" won my heart :)

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

Thanks for nice tasks.

Funny that I solved G by accident couple months ago.

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

E was tough

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

    Teach me your ways big bro you’re so strong

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

      E had a nice dp thing. Take dp[i][x] to mean the minimum number of pounds you need in order to obtain at least x happiness at month i.

      The transitions are:

      for a certain happiness x, we know that dp[i][x] is at most equal to dp[i — 1][x] (that is, the answer for the previous month). dp[i][x] can also be dp[i — 1][x — h[i]] + c[i] if c[i] + dp[i — 1][x — h[i]] <= the amount of money we have garnered so far.

      dp[i — 1][x — h[i]] + c[i] represents the minimum cost to get at least x happiness assuming we buy happiness at month i. Of course, we can only afford this if it is less than our current amount.

      We don't want x — h[i] to go below zero. So dp[i][x] = min(dp[i — 1][max(0, x — h[i])] + c[i], dp[i — 1][x]).

      After this, in order to make the dp[i] represent the minimum number of pounds to get at least x happiness, we just let dp[i][a] = min(dp[i][a], dp[i][a + 1]) for a going from the sum of all happiness to 0. Aka just take suffix minimums.

      The base case happens at month zero (or at month 1 actually since you technically have no money at month 1). The minimum number of pounds we need in order to obtain 0 happiness at month 0 is 0. The minimum number of pounds we need to obtain x >= 1 happiness at month 0 is infinity.

      The answer will be the highest index in dp[m] who's value is not equal to infinity.

      There was a lot happening in this problem.

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

In problem C, I have wasted a lot of time in addition to 3 wrong answers because I thought that 1 <= ai <= 9

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

fail to solve D

hardest Div3 I've ever taken

byebye cyan hello green

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

Div. 3 like Div. 2.5

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

Though, I was not able to solve it, E was amazing.
Though, I was able to solve it, C was disgusting.

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

humiliating

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

The hardest div 3 I've ever seen.

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

(corner_case)Forces

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

Can someone pls tell me how did you solve que C? I tried solving it using brute force and got TLE multiple times 261901233

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

good tasks

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

In this round, there were three problems based on my ideas: 1974B - Symmetric Encoding, 1974C - Beautiful Triple Pairs, 1974F - Cutting Game.

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

Is there any solution for E using maps? If yes, can someone fix my code 261908381?

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

Hardest Div 3 ... Only div 3 B solved ... can some one tell me the logic of C

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

is D that easy ? there are a lot of submissions...how to solve it

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

I took more than one hour to solve D

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

Почему в последнее время див3 такие сложные

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

how did so many people understood this: each character in the string s is replaced by its symmetric character from the string r (the first character of the string r will be replaced by the last, the second by the second from the end, and so on).

I feel like I lack the ability to guess the problem statement

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

The time limit and constraints of C could be managed better. Other than that, the problems were nice.

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

any hint for E? I tried dp[m][x] using map but obviously I get TLE;

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

nice problem set! i have seen same ideas like in these problems before, but they are usually in div2 and too hard to solve. thank you for introducing them for me!

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

Really nice contest. Problems were not too difficult, and liked the problem E especially. Problem D was implementation heavy and if not for some mistakes in it and time wasted in debugging it, this would have been my first contest to solve all problems as I solved G just few minutes after contest ended :(

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

failed to solved d, was able to get intution. couldn't code it

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

I have a bonus problem (Harder version of problem $$$C$$$) : A pair of triplet is good if elements in any two positions are not equal and equal in one position , count the number of good pairs

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

Tough C, I come up with the the solution pretty quickly but spent many times to implement it 261860863

And D also a terrible implementation(at least for my code) I neerly smashed my laptop when I realize what I am coding 261856874

And can someone help with my E? At first I thought it was a signed int overflow (because it did't WA until test case 10) but it seems to be more than that... 261884565

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

    I tried submitting your code 261934590 and got it accepted. The idea was that a particular state can be visited many times, you assumed that it can be only once.

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

      Oh my god, I actually have realized it but my brain didn't go right and made huge amount of small mistakes when I tried to modify it :(

      And It should have been Accepted if simply to add a more ! in my last minute submitted code rather than failed in test case 1 (:_;)

      Anyway, thank U very much orz

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

Are all submissions tested against the test cases from successful hacks at the end of the hacking phase?

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

Hardest div3 I've ever taken, C is harder than an average C in div2.

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

*Deleted

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

it-sover

got AC on D after contest simply by removing pre-check, but simulate answer then checking correctness.

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

I had the right idea on C with the three maps but I couldn't think of the way to sum them up correctly :(. Problem D was really nice, the concept and everything. E was also cool but I didn't really have time to solve it. First time I solve D and don't solve C on a contest which I didn't expect to be fair but I'll take it.

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

In F, what if k is fixed in input and instead of moves being given, both players play optimally to maximize their score?

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

I am surprised that ChatGPT was able to solve problem G in this round. To be more specific, I was stuck on G, so I put the problem statement into ChatGPT, which is a hot topic right now, to try to get some clues. Initially, it presented me with an incorrect greedy code (a simple greedy method of looking from the front and buying if possible). Then, I provided an example that would fail with this solution (Test Case 3: 6 4, 4 10 3 8 6 10). To my surprise, it then gave me the correct greedy algorithm using priority_queue! (This might have been a lucky punch, though)

I am unrated so I am not particularly affected, but for contests like div-3/4 with many typical problems, ChatGPT might be able to solve quite a lot of them...... (I haven't tried it yet, but I think it can also solve problems like F, which have straightforward and typical approaches but may be a hassle to implement.)

(My prompt: https://chatgpt.com/share/05ad0c4b-33a1-4480-8f46-c7a87a60f019 we need to fix some details (input and the timing of adding X), so we can't just copy and submit, but the main idea is totally correct. I think if the prompts were further elaborated, the code will follow those instructions too.)

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

Thanks for such a great contest. I loved it

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

How to solve C?

Can anybody please tell me why I'm getting WA on test 4? Submission

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

    With 1 <= a[i] <= 1e6 then these may not work:

    int abc = (v[i]*100)+(v[i+1]*10)+v[i+2];

    int _ab = (v[i]*10)+v[i+1];

    int _bc = (v[i+1]*10)+v[i+2];

    int _ac = (v[i]*10)+v[i+2];

    I think you can use pair instead of combining into a single int value.

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

G was pretty similar to this problem: 1526C2 - Potions (Hard Version)

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

Great contest, but I think that problem A could have been written in a better way: there are too many people who did it after 10 mins, meaning that the statemenet was not clear at all. Something like "an app can only be placed on a single screen" would have been enough. I was (wrongly) thinking of application on multiple screens, so that, e.g. 4 screens could contain 15 y app. Hope next time I'll be sharper in statement comprehension

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

Please explain why D is failing on test 4 261864972.

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

Can someone explain why my solution 261888809 with $$$N=10^5$$$ failed, but the same solution 261919448 with $$$N=$$$$$$\sum\limits_{i = 1}^mh_{i}$$$ passed in 1974E - Money Buys Happiness where $$$N$$$ is the maximum number of elements in $$$dp$$$ array. I guess my time complexity is $$$O(N*M)$$$ which should pass. And what does this statement It is guaranteed that the sum of $$$\sum_{i}h_{i}$$$ over all test cases does not exceed $$$10^5$$$ means?

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

    I got the same TL as you because I initially did dp with $$$5 \cdot 10^4$$$.

    The problem is $$$t \lt = 1000$$$, so taking in your case dp till $$$10^5$$$ will make the worst case of $$$10^5 \cdot 10^3 \cdot 50 = 5 \cdot 10^9$$$, which is too much. (in my case it was twice less, but still too much).

    But taking $$$N = \sum_{i = 1}^m h_i$$$ resolves this, cuz then the worst case will be $$$m \cdot \sum_{i = 1}^t N_i$$$, but we know that sum of all $$$N_i$$$ over $$$t$$$ cases is not greater than $$$10^5$$$, then the worst case will be $$$50 \cdot 10^5 = 5 \cdot 10^6$$$ which is good enough.

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

      Oh yeah, now I realised when you mentioned it, basically overall time complexity is $$$O(T*M*$$$$$$\sum_{i}h_{i})$$$ and they have mentioned that $$$(T*$$$$$$\sum_{i}h_{i})$$$$$$\leq10^5$$$ so worst case will be $$$5*10^6$$$ which is fast enough whereas in my case, it will be $$$5*10^9$$$ which is TLE. Thnx mate.

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

C was unusually hard for Div3. E was nice.

Hopefully back to blue after this one.

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

I got the correct intuition for C but then I thought HashMap<Integer,HashMap<Integer,HashMap<Integer,Integer>>> must not be the intended solution, should have continued

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

Is E solvable using recursive dp?

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

Problem B is getting too many successful hacks. Can someone tell me what seems to be the problem with the solution approach of those who are getting hacked.

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

can we solve E with recursive dp ?

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

I would appreciate your kindness if any of you could just debug my code for E, Thanks. https://mirror.codeforces.com/contest/1974/submission/261937456

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

good round, especially like F and G this round.

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

20 lines of code for problem D

link

who less?

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

Only if I wouldn't have spent so much time on C :(

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

for Problem E, is it the right approach to find the minimum number of money required to obtain x amount of happiness given i months using dp?. And then check what is the maximum possible happiness for which he can pay the money.

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

My ugly solution for D, but it works.

C and D are much tougher than regular Div3. Btw, a tip for the likes of D is jotting down all possible negative cases first, then either deal with the correct one or a much more trivial yes-or-no decision making.

Btw, anyone having a hint for G? I have a few ideas but I'm afraid I was overthinking at contest... (Nvm, I read a comment above and realized I was way too stupidly overthinking... T.T)

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

Thanks for the contest! The problems were of pretty good quality as compared to recent div3 rounds. Hoping to reach Expert by the end of main tests!

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

implementation forces with too easy G. E and F were better imo.

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

A good Round. But i think F>G

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

What are some approaches that can be used to solve F? I was thinking either some sort of dp or something with geometry. That is to say, we somehow determine the number of points in a bounding box, and each cut makes this bounding box smaller. Then, by keeping a record, we can determine the numbers of points obtained for each cut. Or are these ideas a bit to "direct"?

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

    It's direct, but it's kinda the motive of it. When moving the bounding box, you'll figure the points that would be left out of the box.

    Maintaining those points would require a sorted data structure with add/find/delete operation — as this data structure should add the points initially, find the points that are before/after a certain threshold, and delete those points. Still the number of points in the original box is quite large, so these operations should be fast enough instead of a naive linear one in array. For my most convenience, AVL/RBtree-based data structures (i.e. set at C++ and TreeSet at Java) should work well enough.

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

      Can you explain your idea of how you deleted elements from the opposite dimension. I mean, if the move is U or D, how did you deleted those coordinates from the data structure where the coordinates are stored optimally for L/R operations (if you even are using a 2nd DS for that matter) ?

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

        First, my solution, just in case my words were unclear.

        We'll store two different sets for two dimensions, each will store a tuple $$$(x_i, y_i, i)$$$, and sorts them accordingly by the dimension defined. Thus, each point has two copies: one at the L/R set, the other at the U/D set.

        If cutting from a dimension, for example L/R, we can list the tuples that would be excluded from the L/R set, thus getting their indices in the process. With the indices, we can reconstruct the corresponding tuples from the other U/D set, and delete them as well. With this, each tuple will only be accessed/constructed/deleted twice at most, keeping everything $$$\mathcal{O}(n \log n)$$$ just fine.

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

Oy blin I had fun this round. E was pretty, unfortunately I couldn't solve it.

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

The naming of problem 'E' is really interesting!!!

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

I read so many comments about C being too hard. Can anyone tell me what was so hard about it? Wasn't it a simple map count problem? If it were Div.2 I would've used better hashing just to be more sure.

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

For problem G, can someone please spot the error in this code . I am trying to use a multiset to store the costs at which happiness has been bought and then using the upper_bound function.

#include<iostream>
#include<vector>
#include<set>
#include<algorithm>
typedef long long ll;
using namespace std;
int func(auto &cost,int m,int x){
    multiset<int> s;
    int cur_money=0;
    for(int i=0;i<m;i++){
        if(cur_money>=cost[i]){
            cur_money-=cost[i];
            s.insert(cost[i]);
        }
        else if(!s.empty()){
            auto up=upper_bound(s.begin(),s.end(),cost[i]);
            if(up!=s.end()){
                cur_money+=*up-cost[i];
                s.erase(up);
                s.insert(cost[i]);
            }
        }
        cur_money+=x;
    }
    return s.size();
}
int main(){
    int t;
    cin>>t;
    while(t--){
        int m,x;
        cin>>m>>x;
        vector<int> cost(m);
        for(int i=0;i<m;i++){
            cin>>cost[i];
        }
        cout<<func(cost,m,x)<<endl;
    }
    return 0;
}

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

Just had a look at the problems and Kudos to the authors for constructing such a great problem-set. I absolutely loved the similarities/differences (and their implication) between problems E and G.

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

hey MikeMirzayanov what is this partial behaviour towards flagging solutions.

This user -> looneyd_noob is out of competition for the solution: https://mirror.codeforces.com/contest/1974/submission/261894175 but i also noticed the solution of this user -> Shaxx19 who is not out of the solution even having a very similar solution just variable name changed and some comments added and even submitted 10 minutes later; this is his solution https://mirror.codeforces.com/contest/1974/submission/261900757 the entire nested for loop is same with same indentation. Man he needs to get out of contest, you are doing very wrong and people's trust will reduce from this platform. Please get him out of competition.

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

hey MikeMirzayanov what is this partial behaviour towards flagging solutions.

This user -> sjy is out of competition for the solution: https://mirror.codeforces.com/contest/1974/submission/261826313 but i also noticed the solution of this user -> frank11_sjy who is not out of the solution even having a very similar solution just variable name changed and some comments added and even submitted later; this is his solution https://mirror.codeforces.com/contest/1974/submission/261825867 the entire nested for loop is same with same indentation. Man he needs to get out of contest, you are doing very wrong and people's trust will reduce from this platform. Please get him out of competition.