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

Автор azberjibiou, история, 4 года назад, По-английски

Hello Codeforces and welcome back to another div2 round.

YeongTree and I are excited to invite everyone to participate in Codeforces Round 851 (Div. 2), which will be held on Feb/09/2023 17:35 (Moscow time).

This round is rated for the participants with ratings strictly lower than 2100. You will be given 6 problems and 2 hours to solve them. All the problems are authored and prepared by YeongTree and me.

We would like to thank

The score distributions will be updated later.

UPD1: Score distribution: $$$500−1000-1500-2250−2500-3000$$$

UPD2: Congratulations to the winners!

Overall:

  1. jiangly
  2. MakaPakka
  3. Puranya
  4. maspy
  5. tute7627

Rated participants

  1. MakaPakka
  2. _10circle_
  3. JJcjn
  4. 1cm
  5. AnotherYearWasted

AC submissions at the last second

UPD3: Editorial is out

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

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

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

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

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

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

as a tester, qwexd ORZZZZ

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

As a tester, the problems were really good.

Participants, please enjoy the contest!

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

As a tester, I enjoyed the round and the statements were brief and clear. I hope to see you on the scoreboard!

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

As a tester, this was the best contest I have ever seen.

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

As an apparent tester (I don't remember testing this round recently), I'm sure the problems are good :P

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

Good luck to everyone!!!

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

Good Luck for every Candidate Master to promote to Master!

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

OMG South Korean setters, good mathematical problems coming on the way :)

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

Omg announcement shorter than tourist round

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

This contest may be a bit late, I guess I fell asleep at that time.

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

good luck everyone!

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

As a tester, I tested this round in the period about when I was orange for the first time.

Problems are nice tho!

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

очередной див 2. желаю всем удач решить его

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

Hope we will learn smth)

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

My first contest was tourist round. I solved 1st 2 problem and earned 389 rating. This will be my 2nd contest .

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

I will skip an academic seminar in my university and participate in this round.

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

As a participant, I confirm that i will participate.

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

Sometimes I really want to skip school.

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

Please down me, thx.

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

As a tester, I enjoyed this round. Good luck!

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

Thanks for your excitation to invite us to participate in round !

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

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

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

Good Luck and Have Fun!

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

I will skip an academic seminar in my university and participate in this round

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

Wishing you all a positive delta!!

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

Best wishes for everyone

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

Worst Contest I have Ever Seen. What are these strict time limits !?!?

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

Me after solving C

Waiting for contest to end
»
4 года назад, скрыть # |
 
Проголосовать: нравится +19 Проголосовать: не нравится

is that a pattern finding round?

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

Mo

Starting with problems A Motivation 100 to 50 B Motivation 50 to -100 C Motivation -100 to +50 Depression enters :)

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

How to solve E? Is this some dp? maybe we can precompute the maximum index, i can jump to from index j while keeping the sum of elements from i to j >= 0 . Am i thinking in the right direction ?

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

    no you need to solve A+B first

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

    I thought of doing a segment dp like:

    dp[L][R][0] — ans for [L; R]

    dp[L][R][1] — ans for (L;R]

    dp[L][R][2] — ans for [L;R)

    dp[L][R][3] — ans for (L; R)

    But had some troubles with calculating dp[L][R][0]. Other states are easy to calculate

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

Might be an unpopular opinion, but I think all problems were very good and interesting. Congrats to the authors for a beautiful contest. I enjoyed doing the contest very much. Thanks!

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

Did someone constantly get wrong answers on problem B?

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

How to solve C?

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

How to solve B?

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

E looks standard. Can it be solved by dp with d&c?

upd: i think i overcomplicated it

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

C is too hard

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

The difference between C and D was massive.

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

did anyone else also got wrong answer on test 5 in E

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

I think that this round had very interesting problems with pretty beautiful possible solutions. Thanks for the contest!

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

My solution to problem E:

First, create the prefix sum array $$$p_0 = 0, p_i = a_i + p_{i-1}$$$ and compress it. Let $$$dp_i$$$ denote the best answer for the prefix upto element $$$i$$$. Suppose the last segment we take containing $$$i$$$ goes upto $$$\ell+1$$$ and misses $$$\ell$$$. Then $$$\ell \lt i$$$ and we must have $$$p_i \geq p_{\ell}$$$, and the best possible answer in this case would be $$$dp_{\ell-1} + (i - \ell)$$$. To efficiently compute these values, create a max segment tree over the compressed $$$p_i$$$ values and each time we compute $$$dp_i$$$ as $$$i$$$ plus the maximum over the segment $$$[0, p_{i}]$$$ in the segment tree and after performing $$$dp_i = \max(dp_i, dp_{i-1})$$$ (in case we don't take $$$i$$$ in the optimum answer) we update the $$$p_{i+1}$$$th location by maximising it with $$$dp_{i} - (i+1)$$$. That's it, done. Overall solution works in $$$\mathcal O(n \log n)$$$.

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

https://www.youtube.com/watch?v=1jbhevleu-Y Copy of Problem B...Do Something

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

ABCforces

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

my total score : 390-8*50.. It looks very difficult, was this contest really hard?

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

Problem D cost much time for me and I didn't have enough time for E.

2D dynamic programming with 6 different arrays to maintain (RL, RL_sum, LL, LL_sum, LL_cnt, LL_cnt_sum) is too easy to make mistake at some details. I've spent much time to find a bug that I allocated too much space on the stack for 2D arrays (using something like ll RL[n][n], where n=3000) instead of declare them as global variables.

How to solve D
My approach for E (Now it has been accepted)

Update: Now my submission 192969220 has been accepted.

AC code of E
  • »
    »
    4 года назад, скрыть # ^ |
    ← Rev. 3  
    Проголосовать: нравится +7 Проголосовать: не нравится

    Observe that the answer is equal to the number of adjacent points which moves toward each other.

    We may check every two points $$$x_l,x_r$$$ and count the number of subsets in which $$$x_l$$$ and $$$x_r$$$ are adjacent and move toward each other, which is equal to $$$2$$$ to the power of $$$(L_{l,r}+R_{l,r})$$$, where:

    $$$L_{l,r}$$$ represents the number of points satisfying $$$x_r-x_l \lt x_l-x_p$$$;

    $$$R_{l,r}$$$ represents the number of points satisfying $$$x_r-x_l\le x_p-x_r$$$.

    for a fixed $$$l$$$, $$$f(i)=L_{l,i}$$$ is monotonic. Similar for $$$R$$$.

    The code for the solution above is very easy to implement.

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

    I didnt use DP. I just iterated over every pair $$$(i,j)$$$ and found the number of subsets of points such that $$$i$$$ and $$$j$$$ meet each other. The idea and code are both simple.

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

    Can you please explain your dp approach for D . I tried doing this by dp but failed and my obervation skills suck , hence wasnt able to do the question the other way too.

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

      We consider what would happen if we add a new dot at right. We call the previous 2 right-most dots i, j (assume there's >=3 dots in the set, because set with only 2 dots is trivial). In the previous set j would move left since it's right-most dot, and i could move left or right. If j still move left after we add a new dot, the number of final points will not increase. But if j move right, there's 2 situations: if i moves left (we call this situation LL), then it would like RR...LL --> RR...LRL, we can see there's one more final point (by the "RL" we've created), and if i moves right (we call this situation RL), then it would like RL --> RRL, where number of final points remained same. Therefore we can get the transition formula. (don't forget to consider situations of RL when there's only 2 dots in the set)

      Also this DP approach need to store prefix sums for optimization. See this comment for a simpler solution.

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

Was D just a DP on pos[previous][current] then looping through [current+1, n) to try placing the next particle?

The observation there I believe is that for all values <= a[i] + (a[i] — a[p]), the direction is left, while the rest are right, so you can do some casework there to add on that subarray after precomputing prefix sums (the number of dots is equal to the number of adjacent RL's that show up in the final subsequence), but I had a stroke implementing ;-; does anybody have a simple enough implementation of that idea?

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

    Wouldn't this be $$$n^3$$$ ? Each of your $$$O(n^2)$$$ values take some $$$O(n)$$$ time unless there is a trick I am missing.

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

      I couldn't even get the n^3 working cuz I'm bad but I think that the recurrence would look like


      for j in range(i+1, n): if (P is closer to I than J): // place an L in this case DP += solve(i, j) //(if previous was R, then add 1, otherwise don't add) else: // place an R in this case DP += solve(i, j) (never add in this case)

      Then since every single transition is just solve(i, j) + (a bool) in either case, then you split it up into the ranges whether the bool is true or false with bsearch. The second range never gets added to, and the first range you would casework and then multiply by the length of that range.

      So in the end the transition is DP += (sum of everything from DP(i, [j+1, n) )) + (len of good range) * (caseworked boolean)

      (though again I didn't get the casework working so I'll still need to work out the conditions)

      Though it seems like other people had easier solutions ;-;

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

    had a similar observation but could not come up with the implementation ;(

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

    I have a simpler approach, iterate over i,j (i<j), for every i,j find out a,b such that a<=i,j<b and if every element between [a,b) is not present in a subsequence (except i,j) then $$$a_i$$$ moves towards $$$a_j$$$ and vice versa. Also, $$$b-a$$$ should be minimum so that we exclude minimum elements. Now add $$$2^{n-(b-a)}$$$ to the answer.

    Code: 192957360

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

    Let's assign directions to the dots in some subset, they will look like:

    (RR...RRLL...LL)|(RR...RRLL...LL)|......|(RR...RRLL...LL)

    So the number of distinct endpoints is the number of "LR" adjacent pairs + 1 (to account for the first block). So we can iterate on every pair $$$(i,j)$$$ and count in how many subsets they can exist as an adjacent LR pair.

    Based on $$$x[j]-x[i]$$$, we can know how many dots before $$$i$$$ can be directly before $$$i$$$ in a subset and how many dots after $$$j$$$ can be directly after $$$j$$$ in a subset. If $$$[l, i-1]$$$ is the left range and $$$[j+1, r]$$$ is the right range, then the left subset counts can be $$$2^{l-1}$$$, $$$2^l$$$, ..., $$$2^{i-2}$$$, and the right subset counts can be $$$2^{n-r}$$$, $$$2^{n-r+1}$$$, ..., $$$2^{n-j-1}$$$.

    So, add $$$(2^{l-1}+2^l+...+2^{i-2})\cdot (2^{n-r}+2^{n-r+1}+...+2^{n-j-1})$$$ to $$$ans$$$. Make sure to initiate $$$ans$$$ with $$$2^n-n-1$$$ to account for the first block in all the subsets.

    Submission

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

B was much more difficult than C In B only case we need to worry about is n%20==19 but even after that it was more of implementation problem than maths which it seemed to be initially

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

Feels like massive cheating on C, I might be wrong but it feels like it.

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

What is test 2 for B?

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

guessforces

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

Any proof for C I solved it by just some observations

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

The worst round

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

Imagine asking how to solve D and getting -13 ^D

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

It was great PatternForces Round <3

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

I wish C was 1500-1600, but unfortunately it's more likely to be 1200

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

Anyone know why my sol for D is wrong?

dp[i] stands for sum where i is chosen, and tot[i] is total of chosen & not chosen

dp[0] = 1;
tot[0] = 1;
for (int i = 1; i < n; i++) {
	dp[i] = 1;
	for (int j = 0; j < i; j++) {
		if (j == 0) {
			dp[i] = (dp[i] + 1) % mod;
		} else if (x[i] - x[j] < x[j] - x[j - 1]) {
			dp[i] = ((dp[i] + tot[j - 1]) % mod + mod_pow(2LL, j + 0LL, mod)) % mod;
		} else {
			dp[i] = ((dp[i] + dp[j]) % mod + mod_pow(2LL, j + 0LL, mod)) % mod;
		}
	}
	tot[i] = (tot[i - 1] + dp[i]) % mod;
}
cout << (tot[n - 1] - n + mod) % mod << '\n';
»
4 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

I wast stuck in problem C for approximately 2 hours, In problem C multiple kind of pairing was possible so it must be mentioned in the question that we can output any valid answer. I am not talking about order of pairs... actually you can pair any number with 2 values and accordingly I found 2 valid answer exists for each odd number.

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

Any Hints For D? I Was Thinking In A DP Direction :(

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

    the main observation is that the distinct points increase when $$$ith$$$ index moves left and $$$i+1th$$$ index moves right. Now try to figure out the contribution of each $$$i$$$ seperately by fixing the position that moves left and the position that moves right.

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

Toooooooooooooo much Cheating

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

Can anyone explain E for noobs?

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

Why is answer no for even n in C?

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

An unbalanced round. I got ABC very quickly, but couldn't come up with a fast enough solution for D in time and didn't attempt further problems. I won't say that the problems were bad because they weren't (C was just guessing a pattern, didn't like it that much; others were good). I just think that there should've been a 1600-1800 rated problem between C and D. But the round was still nice.

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

Actually had more trouble with C than F haha.

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

solved D during the contest, but forgot that modular arithmetic template takes $$$O(\log n)$$$ to calculate $$$2^n$$$... So got TLE couple of minutes before the end after simply rewriting formula I got on paper :(

contest submission: https://codeforces.me/contest/1788/submission/192959799

upsolve submission: https://codeforces.me/contest/1788/submission/192968394

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

Great contest with good problems , thanks!

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

Great contest, and super fast rating changes, wow! Absolutely loved all the problems that I read (A-E)!

Also, while I understand the need to have tight TLs on D, as $$$n^3$$$ solutions were to be rejected, I'm slightly irked by the fact that my Java submission failed despite being $$$n^2log(n)$$$. Anyway, that was to be expected since I was using TreeMaps, and Binary Search is understandably faster. So yeah, happy to have learned one more thing :)

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

Great contest with very clear statements!

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

ok thanks

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

AC submissions at the last second

Ac submissions at the last second is very nice , but i am pretty sure that last second submission of problem D by gsmdfaheem is copied. i have seen exact same code that is leaked at just 10 minutes before the contest end.

he just changed the variable names.

Channel
Leaked-Code
His submission at last second
»
4 года назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

In B if i print 1 as 01 it consider it wrong but both are equivalent integers and no intructions are provided regarding leading zero .

stupid testing got WA 2 times.

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

According to me my E is working but my solution gets WA on test 5 can anyone please help me where i am lagging https://codeforces.me/contest/1788/submission/192944044

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

GOT AC LAST SECOND

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

 D just 3 seconds before!!

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

The time limit of F is too tight. I wrote the correct solution but got TLE on pretest 58. I think it's better to decrease the value of $$$n,q$$$ to 1e5 or increase the tl to maybe 5 secs.

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

Problems are fun! thanks to authors :)

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

Can someone give a small test case on which my solution 192923926 fails?

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

Very very very standard problem E and F. I cannot accept that.

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

Weak testcase in B no. In the statement, given 1<=n<=1e9. Unconciously, I used int(as datatype) and passed the pretest. After the contest I noticed my mistake and expected to get wrong answer. But, after final judgement , my solution passed all the testcase :)

192907426

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

    What do you think range int has in GNU C++17 7.3.0 (your used compiler)?

    You can always check in Custom Invocation smth like this:

    #include <limits>
    #include <iostream>
    
    using namespace std;
    
    int main() {
        using IntLimits = numeric_limits<int>;
        cout << IntLimits::min() << ' ' << IntLimits::max() << endl;
        return 0;
    }
    
»
4 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Great contest! you can find the video editorials for problem C and D here .

hope this helps you! happy coding!

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

Hello! I submitted two implementations of treap in E, and the "faster" version works 5 times longer! Can anyone explain it? "slower": 193052447 "faster": 193052503 I know that "faster" gets TL on a test with a = {0, 0, 0, ..., 0}, but I can't realize the reason of O(n) height of a treap.

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

hopeforces

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

Problem B. Sum of Two Numbers ***** my solution get wrong answer on test case 8, my solution is true and that makes me sure that I take this code copy and submit it again and get accepted, plz check it for my. the solution which gets wrong answer during the contest the same solution gets accepted after the contest !!!

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

Lately I receive a message that my submission 192896600 is same as 192935411.I cheked it and find that his solution to the problem is different from mine.I guess may be comments at the end of the code is the reason why two submissions is thougt as same.

In addition, I can give evidence that I used this template before him. mine:188824606 his:189071540

[user:KAN][user:MikeMirzayanov][user:azberjibiou]