cry's blog

By cry, 2 years ago, In English

Welcome to Natlan, Codeforces!

sum, Proof_by_QED and I are like a dog with two tails to welcome you to participate in Codeforces Round 988 (Div. 3) at 17.11.2024 17:35 (Московское время). We have cooked up $$$7$$$ problems to be solved in $$$2$$$ hours and $$$15$$$ minutes.

The round will be hosted by rules of educational rounds (extended ICPC). Thus, solutions will be judged on preliminary tests during the round, and after the round, it will be a 12-hour phase of open hacks. After open hacks all accepted solutions will be rejudged on successful hacks.

Note that the penalty for each wrong submission in this round is 10 minutes. Also, note the rule restricting AI use!!! If you are caught using AI in an unorthodox manner, bad things will happen to you. We will be watching you all...

IMPORTANT!!! There is at least one interactive problem in the problemset. Please familiarize yourself with the guide for interactive problems beforehand.

Remember that only the trusted participants of the third division will be included in the official standings table. As it is written by link, this is a compulsory measure for combating unsporting behavior. To qualify as a trusted participant of the third division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them)
  • do not have a rating of 1900 or higher at any moment in time.

Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you (unless you register unrated).

We would like to orz the following individuals for making the contest possible:

UPD: Editorial!!!

  • Vote: I like it
  • +150
  • Vote: I do not like it

| Write comment?
»
2 years ago, hide # |
← Rev. 2  
Vote: I like it 0 Vote: I do not like it

Let's just pretend that Natlan didn't come out two months ago.

»
2 years ago, hide # |
 
Vote: I like it +32 Vote: I do not like it

As a writer, I welcome you to Natlan with open arms

»
2 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

As a tester.... Visit a local Scientology center, attend a free seminar, or take a personality test and find out how Scientology can support you on your journey. Awaken your true self and step into a world of possibility — Your path to a better life starts here!!!

»
2 years ago, hide # |
 
Vote: I like it +40 Vote: I do not like it

As a tester, I have been wondering who Natlan was.

»
2 years ago, hide # |
 
Vote: I like it +43 Vote: I do not like it

As a tester, I just learnt that this round is Genshin themed (I don't play Genshin)

»
2 years ago, hide # |
 
Vote: I like it +26 Vote: I do not like it

As a tester, I recommend the round — it is excellent.

»
2 years ago, hide # |
 
Vote: I like it +21 Vote: I do not like it

As a tester, I think this will be the best Div3 ever. Enjoy it!

»
2 years ago, hide # |
 
Vote: I like it +25 Vote: I do not like it

tester As ! , love std::shuffle I a

fun also problems The were ! very

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

do not have a point of 1900 or higher in the rating.

Is it a typo?

»
2 years ago, hide # |
 
Vote: I like it +29 Vote: I do not like it

As a tester, I need to google Natlan.

»
2 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

As a tester, the problem are great. Have fun and good luck

»
2 years ago, hide # |
 
Vote: I like it +26 Vote: I do not like it

As a VIP tester, I can guarantee you that the tasks are tasks.

»
2 years ago, hide # |
 
Vote: I like it +37 Vote: I do not like it

As a tester: Genshin, Activate!

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I think this is the coolest contest announcement I've seen recently.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

as a genshin hater, I'm looking forward to hopefully gaining quite a lot of rate change in this contest

»
2 years ago, hide # |
← Rev. 3  
Vote: I like it 0 Vote: I do not like it

[deleted]

»
2 years ago, hide # |
 
Vote: I like it +14 Vote: I do not like it

Oh, its time crashs with my Ragional Contest of ICPC, Shanghai Station! I'm now in mihoyo's HQ, wishing every participants good luck and high rating! And wish me to win a medal :) By the way, Genshin? Launch!

»
2 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

i hope this div3 doesn't have as trash testcases as the last one.

»
2 years ago, hide # |
← Rev. 2  
Vote: I like it +3 Vote: I do not like it

As a genshin player, I hope this will be a good round.

»
2 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

The arrogation of mankind ends now.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

genshin mentioned

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I love you for the Gwnshin reference❤️

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

ZaDiv3

»
2 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

well exactly we have a natlan contest before gta VI

»
2 years ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

The picture in the post brings back memories of the song "Close to the Sun" by TheFatRat. It takes me right back to high school days, when the line between passing time and wasting it was just a little blurrier.

Feel free to give it a listen if you're in the mood: https://www.youtube.com/watch?v=oJuGlqO85YI

Thanks for the nostalgia boost!

»
2 years ago, hide # |
 
Vote: I like it +33 Vote: I do not like it

I will eat shit if I can't become Expert after this contest.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

YuanShen

»
2 years ago, hide # |
← Rev. 2  
Vote: I like it -44 Vote: I do not like it

It should be "at most one" interactive problem for any div3 or div4 contests. There is absolutely no value in learning these kind of problems for lower rated participants. It brings "joy" only for higher rated contestants who got bored at some point and invented a "new kind of fun". Do you think it's fun for newbies to solve these kind of problems? They have enough problems just to come up with any solutions at all :D

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    They don't want to spoil the number of interactive problems, but rather the fact that it will be used so people who don't know how to solve them can look at the interactive guide. Hence the "at least one" statement was used.

    Even in Div 2/1 it's not super common to see 2 interactive problems in a problemset.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Quick question, why are people with rating higher than 1900 not “trusted participants of the third division”?

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +6 Vote: I do not like it

    Those people are likely to be too good to be in Div. 3, and could have intentionally pulled themselves down to the rated range to win the contest, if they were to be included in the official standings table.

    • »
      »
      »
      2 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Hmm, so if you're too good for a division you're not allowed to be on the leaderboard. Interesting decision...

      • »
        »
        »
        »
        2 years ago, hide # ^ |
         
        Vote: I like it +6 Vote: I do not like it

        Well, that's why we have rating bounds for each division in the first place...

    • »
      »
      »
      2 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      high rated people can make new id's and can win anyways.

      • »
        »
        »
        »
        2 years ago, hide # ^ |
         
        Vote: I like it +6 Vote: I do not like it

        Making alts is strictly forbidden by the rules. Also, number of rated contests >= 5 condition is there so that they won't feel like spamming alts just to win low divisions.

»
2 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Announcement: Welcome to Natlan! Actual contest: Welcome to Khaenri'ah! Hope it won't be the cataclysm for my rating.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Good luck in the contest!!!

But, what is a VIP tester?

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Cannot turn it down as a player of Genshin Impact

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

It is Guaranteed that there will be no more than $$$N$$$ interactive problems.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Genshin is bad, i recommend that you need to touch grass after 3 years

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

It's been almost a year since I started doing CP seriously. Now my rating is 1361, hope to become specialist in this one.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I think participating in genshin impact round feels like being "GAY"

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

If I didn't perform well , I'll touch the grass.

»
2 years ago, hide # |
 
Vote: I like it -16 Vote: I do not like it

i hate newbies

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

score distribution?

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

eagerly waited for Such cool Div3 (as a newbie). thank you !!!

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

As a participant, I bet atleast one problem is about Mualani!

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

I have an exam tomorrow, should I study or hit expert ?

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

As Genshin Impact player, I am pleasantly surprised. It's too good to be true.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

IF I DON'T RETURN THAT DAMNED SPECIALIST, I SHALL RETURN THE NEWBIE

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

hoping for pupil this round

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Well wishes to all

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

go to expert and candidate master

»
2 years ago, hide # |
 
Vote: I like it +82 Vote: I do not like it

»
2 years ago, hide # |
 
Vote: I like it -7 Vote: I do not like it

why problem D is in russian i only know french arabic and english should i learn russian to gain rating points and solve the problem ??? i am trying my best each contest to get any point and you guys came with russian language

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Click the United Kingdom flag at the top to switch it to English (and if you want French or Arabic, I believe GPT translation is allowed, though I need to double check on that)

    • »
      »
      »
      2 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      no but first it appear that "problem statement is not available in english" i can send you the photo if you need

      • »
        »
        »
        »
        2 years ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        That's odd, are you sure you are on the right problem (Sharky Surfing, or Акулий серфинг in russian)? A picture would be useful, thanks.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

As a Chinese, I wonder who Superultra is. Is it a user name?

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Great E

»
2 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

this exactly what a div3 should be, great problems!

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I thought that problem C was harder than D

anyway, ill finally get to pupil :D

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Personally, C was harder to notice the observation, but was really simple to write compared to D, which was an easy observation but more difficult to write

    Spoiler
    • »
      »
      »
      2 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      I find that so interesting about codeforces contests. They are much more focused on the observation difficulty rather then "data structures/techniques" difficulty. Like sometimes I can't even solve Div 2B's (if it is a observation problem), when it seems that everyone here can, and on the other hand the same ppl dont know basics about heaps, graphs, segtrees, etc.

      • »
        »
        »
        »
        2 years ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        That's what I like about codeforces, the questions (for the most part) aren't "do you know this random theorem or this random data structure", but require more thinking. Sure, there will be some insanely standard questions (such as Ruler — easy version or A good string) that require little thinking outside of knowing an algorithm, but for the most part, the questions are unique and fun to solve.

        Only annoying part about that is difficulty feels a bit inconsistent, I'll be able to look at a 1400 and solve it immediately then struggle on a 1200 / 1300, but that's just how it is.

        • »
          »
          »
          »
          »
          2 years ago, hide # ^ |
          ← Rev. 3  
          Vote: I like it +3 Vote: I do not like it

          Yeah codeforces its really good to train logical thinking But well, we can't deny the random theorems and data structures bc thats what ICPC contests ask for unfortunately :/

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

D solution Please

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    store the power ups as you traverse, when a power boost is required use the biggest of the them.

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    For each time we pick up an item, we definitely greedily select the one that provides the greatest improvement to our abilities among the items we can take but haven't yet collected.

    Therefore, we can use a heap to manage the items. We enumerate each obstacle, add all the items available before that obstacle to the heap, and then take items from the heap until we can jump over the obstacle.

    The code:

    #define l first
    #define r second
    
    #define ft first
    #define sd second
    
    void solve()
    {
        int n, m, L;
        cin >> n >> m >> L;
        vector<pair<int, int>> a(n + 1);
        for (int i = 1; i <= n; i++)
        {
            cin >> a[i].l >> a[i].r;
        }
        vector<pair<int, int>> b(m + 1);
        int ans = -1;
        for (int i = 1; i <= m; i++)
        {
            cin >> b[i].ft >> b[i].sd;
        }
        ll val = 1;
        int cnt = 0;
        int j = 1;
        priority_queue<int> q;
        for (int i = 1; i <= n; i++)
        {
            while (j <= m && b[j].ft < a[i].l)
            {
                q.push(b[j].sd);
                j++;
            }
            while (q.size() && val < a[i].r - a[i].l + 2)
            {
                val += q.top();
                cnt++;
                q.pop();
            }
            if (val < a[i].r - a[i].l + 2)
            {
                cout << "-1\n";
                return;
            }
        }
        cout << cnt << "\n";
    }
    
»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How to do D?

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    For each time we pick up an item, we definitely greedily select the one that provides the greatest improvement to our abilities among the items we can take but haven't yet collected.

    Therefore, we can use a heap to manage the items. We enumerate each obstacle, add all the items available before that obstacle to the heap, and then take items from the heap until we can jump over the obstacle.

    The code:

    #define l first
    #define r second
    
    #define ft first
    #define sd second
    
    void solve()
    {
        int n, m, L;
        cin >> n >> m >> L;
        vector<pair<int, int>> a(n + 1);
        for (int i = 1; i <= n; i++)
        {
            cin >> a[i].l >> a[i].r;
        }
        vector<pair<int, int>> b(m + 1);
        int ans = -1;
        for (int i = 1; i <= m; i++)
        {
            cin >> b[i].ft >> b[i].sd;
        }
        ll val = 1;
        int cnt = 0;
        int j = 1;
        priority_queue<int> q;
        for (int i = 1; i <= n; i++)
        {
            while (j <= m && b[j].ft < a[i].l)
            {
                q.push(b[j].sd);
                j++;
            }
            while (q.size() && val < a[i].r - a[i].l + 2)
            {
                val += q.top();
                cnt++;
                q.pop();
            }
            if (val < a[i].r - a[i].l + 2)
            {
                cout << "-1\n";
                return;
            }
        }
        cout << cnt << "\n";
    }
    
»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

tourist wtf?? How does one complete problem E in 1 min??

»
2 years ago, hide # |
← Rev. 2  
Vote: I like it 0 Vote: I do not like it

I think it was a nice set of problems. I struggled in trying to figure out where I was going wrong with E ... genuinely losing my mind. I don't think there's a problem with my idea/proof, but just maybe something small in the implementation... :(

UPD: Well, since the editorial is posted, I suppose I might as well explain my thinking for E:

  • IMPOSSIBLE if and only if there exists no "01" substring, which is equal to querying the entire string and getting an answer of 0.

  • Otherwise, there is some "01", and we start querying all the prefixes [1, 2], [1, 3] ... [1, n]. Suppose the first one to give a non-zero answer is [1, i]. Let that answer be R. Then, since all prefixes before [1, i] gave 0 as an answer, the string over [0, i-1] is i-1-R 1's followed by R 0's. Also s[i] must be 1. To determine the suffix s[i+1, n], we query over the prefixes still [1, i+1], [1, i+2] ... [1, n], and, at each query, if the answer increases from the previous one, we have a 1 there, otherwise it is 0 there. In total, we take exactly 1 query for each char in s[2, n], meaning we require n-1 queries.

Does anyone know if there is something wrong here?

  • »
    »
    2 years ago, hide # ^ |
    ← Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    i think it's correct

    UPD: i think your implementation should have used long long. you took input as an integer, which can overflow and made the condition (r1 > prev) false.

    • »
      »
      »
      2 years ago, hide # ^ |
      ← Rev. 2  
      Vote: I like it 0 Vote: I do not like it

      No, I redefined int to be long long. The issue was actually that "interQuery" function returned a god damn char instead of int by accident. :(((

      (Also the biggest number to be dealt with in this problem is on the order of (10^4)^2 = 10^8, so there is actually no need for long long anyways).

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

anyone who solved last problem, please teach me new things

»
2 years ago, hide # |
← Rev. 4  
Vote: I like it 0 Vote: I do not like it

In problem D, after the problem statement changed, still wrong. Or am I high?

In the second test case, she cannot jump over the first hurdle.

Actually it's the third hurdle that she cannot jump... I debugged my code for this.

UPD: Now I noticed she also cannot jump over the first hurdle, I'm actually high.

»
2 years ago, hide # |
← Rev. 2  
Vote: I like it 0 Vote: I do not like it

how to optimize G my solution is $$$O(n * k ^ 2)$$$
where $$$k$$$ is max no. of factors

»
2 years ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

it's silly G was ChatGPT solvable, I'd review all submission of G among rated participant if I were coordinator.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Somebody hack my solution for B. If k - 2 is a perfect square and its root is x, we should check if we have 2 x's in the multiset right? I did not do that.

Like example [2, 1, 1, 1, 1, 1] my solution outputs 2 2.

Submission

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    That is not a valid input. It is guaranteed a solution (n,m) exists

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    The example you gave is invalid because there is no answer possible.

    Why it works? x*x = k^2

    The sequence has only 1 x. This means there are two integers y and z such that y*z = k and y<z.

    Sinze x*x = k, therefore y<x and will be iterated over earlier than x and you'd already found the answer then.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hello!

Can anyone help me with the idleness limit exceeded on this submission for question E

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can anyone please explain G in simple terms. thank you :)

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Is tourist for real? y'all sure he is not an AI?

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +2 Vote: I do not like it

    AI isn't that accurate yet :P

    Also, you sure are HUMAN? Because no real human would need to scream that in their username.

»
2 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

I enjoyed this contest :)

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

In problem D, shouldn't first test case be false instead of true? Need to jump from li-1 to ri+1 that is ri — li + 2. But the total power up that can be collected is 8 for the first hurdle and it is less than 9 that needed to be jumped from 6 15.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Inconsistent output for 2037 B. Intercepted Inputs https://codeforces.me/contest/2037/submission/292083626 Test case 1: 2 1 4 5 3 3 my output is shown as 2 2 but when I run it else anywhere (online and my machine) its giving 1 4. Can anyone help me understand what is going wrong here?

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Note that the for-loop order of an ump is an implementation-based behavior. You shouldn't seperate calculating answer from building the ump.

»
2 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

292066305 siliconrhino chatgpt obviously,this guy solve e,f,g in 10 minutes. get him get him :P

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

The G problem has an original problem, which is Problem J from the 2022 ICPC Guangxi Provincial Contest. You just need to modify the modulus and the range, and you can submit it directly to pass.
Link: https://pintia.cn/market/item/1541299013331705856

»
2 years ago, hide # |
← Rev. 2  
Vote: I like it +11 Vote: I do not like it

as a mualani main, D was cool but i couldn't surf through natlan and nice contest

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Has rating changes been rolled out?

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

wc,yuan

»
2 years ago, hide # |
← Rev. 2  
Vote: I like it +15 Vote: I do not like it

Where is Editorial ?

can't find
»
2 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

Why is the Editorial!!! not allowed to view.

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can someone explain why i get idleness limit exceeded, this is not new, almost for every interactive problems. I tried deleting fast io, endl, \n, also in this code i make assertion. How it could be possible: my code

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Because you are asking queries 2 * (n - 2) + 2 times and you can at most ask n queries. I wonder how you reached the expert rating 3 times even if you can't figure out this simple thing.

    • »
      »
      »
      2 years ago, hide # ^ |
      ← Rev. 2  
      Vote: I like it 0 Vote: I do not like it

      But im not wondering why you are still a newbie with that much problems, 2 * (n — 2) + 2??? Are you kidding?

      • »
        »
        »
        »
        2 years ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        My bad. You are asking queries n + 1 times. i.e., 1st queries in the beginning, then n - 2 queries in the for loop, and lastly, 2 queries when i == n - 2.

        And I am sorry for doubting you!

        • »
          »
          »
          »
          »
          2 years ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          I am also, but i make 1 query before start, then i make n — 3 queries from i = 1 to i = n — 3, then i is n — 2 and i make 2 queries, total is n. Also, i know my solution is probably wrong but im not on it.

          • »
            »
            »
            »
            »
            »
            2 years ago, hide # ^ |
            ← Rev. 2  
            Vote: I like it 0 Vote: I do not like it

            I figured out your problem! Yes, you are asking at most n queries. But you are not printing the answer for n = 2. Consider the below test case,

            Input:
            1
            2
            01
            Answer:
            1
            Your Output:
            !
            

            Your code is not going into the for loop, for (i = 1; i < N - 1; i++). Because N - 1 = 1 for N = 2. Hence not printing the answer instead of printing 1. That's why it says the Idleness limit is exceeded.

»
2 years ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

Why when I try to view the Editorial, it says 'You are not allowed to view the requested page'?

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can someone please explain the binary search approach for D ?

»
2 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

Looks like the editorial has been taken down. Please fix cry

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hi, can someone pls help me?

my rank in standing page says 1594 as rank, but on my profile, the rank of the contest says, 1905. Can someone help me understand why two different ranks?

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    This part in the announcement explains it:

    "Remember that only the trusted participants of the third division will be included in the official standings table."

    "Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you (unless you register unrated)."

»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

For D i don't get where this logic is wrong? For every hurdle i just checked whats the minimum number of jump boosters i need to take .. for that i took a set where i stored the power ups taken after the last hurdle to the initial hurdle i am on ... And a priority queue where i stored the power ups i didn't take from the beginning to the current hurdle i need to pass. My tar for every hurdle is the amount of jump power i need — sum(the jump power i have).. when my tar becomes less than 0 i check how many power ups i could initially not take that is in the set that's why cnt--.. after taking all the power ups before a certain hurdle if my tar is greater than 0 then i just take the power ups in the priority queue untill my tar becomes less than 0 and do cnt++.. if it cant then i do flag =1 and print -1 later on. Heres my code https://codeforces.me/contest/2037/submission/292074400

»
2 years ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

why is editorial not available?

»
2 years ago, hide # |
 
Vote: I like it +44 Vote: I do not like it

»
2 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it
»
2 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

code giving correct answer in code editor but codeforces judge giving this error :wrong answer Integer parameter [name=r] equals to 5, violates the range [6, 5] (test case 1) can you some tell why this happening ~~~~~ void solve() { int n; cin >> n;

auto ask = [&](int l, int r)
{
    int x;
    cout << "? " << l << " " << r << endl;
    cin >> x;
    return x;
};
string ans = "";
int value = ask(1, n);

if (!value)
{
    cout << "! " << "IMPOSSIBLE" << endl;
    return;
}
else
{
    int l = 2;

    while (l <= n)
    {
        int x = ask(l, n);

        if (x == value)
            ans += '1';
        else
            ans += '0';

        value = x;
        if (!x)
            break;
        l++;
    }

    for (int j = l; j <= n; j++)
    {
        ans += '1';
    }

    cout << "! " << ans << endl;
    return;
}

}

int main() { int t; cin >> t; while (t--) { solve(); } return 0; } ~~~~~