Predictor | A | B | C1 | C2 | D | E | F | G | H |
---|---|---|---|---|---|---|---|---|---|
Proof_by_QED | 800 | 800 | 900 | 1300 | 1200 | 1500 | 1700 | 1800 | 2100 |
DivinePunishment | 800 | 1000 | 900 | 1400 | 1400 | 1400 | 1600 | 1700 | |
poi | 800 | 800 | 800 | 1000 | 1200 | 1200 | 1700.223 | 1600 | Didn't solve so $$$\infty$$$ |
mathtsai | 800 | 900 | 1000 | 1200 | 1400 | 1500 | 1700 | 1600 | |
macaquedev | 800 | 800 | 800 | 900 | 1200 | 1300 | 1400 | 1400 | |
Intellegent | 800 | 800 | 900 | 1100 | 1300 | 1500 | 1700 | 1800 | 2100 |
cry | 800 | 800 | 900 | 1100 | 1300 | 1500 | 1700 | 1800 | 2100 |
larush | 800 | 800 | 900 | 1200 | 1400 | 1500 | 1800 | 1700 | 2100 |
temporary1 | 800 | 800 | 900 | 1200 | 1300 | 1300 | 1400 | 1700 | 2000 |
Lilypad | 800 | 800 | 900 | 1200 | 1300 | 1300 | 1500 | 1600 | |
LMeyling | 800 | 800 | 1200 | 1500 | 1100 | 1400 | 1600 | 1500 | 1900 |
-firefly- | 800 | 800 | 900 | 1200 | 1400 | 1500 | 1600 | 1700 | 2000 |
reirugan | 800 | 900 | 1100 | 1200 | 1300 | 1300 | 1600 | 1700 | 2100 |
monadtransformer | 800 | 900 | 1000 | 1400 | 1300 | 1300 | 1600 | 1500 | 2100 |
efishel | 800 | 800 | 1000 | 1300 | 1100 | 1200 | 1400 | 1800 | 2200 |
2065A - Skibidus and Amog'u
Problem Credits: chromate00
Analysis: macaquedev
Let $$$n$$$ be the length of the string. Output the first $$$n-2$$$ characters of the string (to remove the suffix "us"), then the lowercase letter "i".
Will be added after open hacking phase
2065B - Skibidus and Ohio
Problem Credits: cry
Analysis: macaquedev
Note that if you can ever do an operation, the answer is $$$1$$$. This is because once you've done an operation on a string of length $$$k$$$, you are free to choose any character to replace $$$s_i$$$ with. Therefore, if you replace $$$s_i$$$ either with the character directly before it, or the character directly after it, you will end up with a string with length $$$k-1$$$ upon which you can do an operation again. Therefore, by induction, it's clear that you can keep operating on the string until only one character remains.
However, if you cannot perform any operations, the answer is $$$|s|$$$, because you have not modified the original string.
Therefore, the answer is $$$1$$$ if $$$s_i = s_{i+1}$$$ for some $$$i$$$, or $$$n$$$ otherwise.
Will be added after open hacking phase
2065C1 - Skibidus and Fanum Tax (easy version) and 2065C2 - Skibidus and Fanum Tax (hard version)
Problem Credits: larush
Analysis: macaquedev
The overall idea for both subtasks is that you need to iterate from left to right, and upon each element, pick the operation such that you obtain the smallest value of $$$a_i$$$ that is greater than $$$a_{i-1}$$$.
For C1, you only have two values to consider for each index — $$$b_1-a_i$$$ and $$$a_i$$$. First, set $$$a_1 = min(a_1, b_1-a_1)$$$, then for each subsequent element $$$i$$$, consider the two values $$$b_1-a_i$$$ and $$$a_i$$$. If the smaller of these values is greater than or equal to $$$a_{i-1}$$$, then set $$$a_i$$$ to this value. Otherwise, check the larger value. If this value is less than $$$a_{i-1}$$$, you can straight away output $$$NO$$$ and move onto the next testcase. Otherwise, set $$$a_i$$$ as the larger of the two aforementioned values. Time complexity: $$$\mathcal{O}(n)$$$ per testcase.
For C2, you now have $$$m$$$ values in the array $$$b$$$. Clearly, we now need to consider $$$m+1$$$ different possible values per index of $$$a$$$. Solving this problem in $$$\mathcal{O}(nm)$$$ is clearly too slow. Therefore, we need to employ a different technique.
Note that instead of trying every value, you can sort all the values in $$$m$$$, and then binary search for the minimal value of $$$b_j$$$ such that $$$b_j-a_i >= a_{i-1}$$$. Then, you're left with the original problem, where you either leave $$$a_i$$$ untouched or you set it to $$$b_j - a_i$$$ for this optimal index $$$j$$$ that you found using binary search. Now, by proceeding as before, the problem is solved in $$$\mathcal{O}(n \log m)$$$ time.
Will be added after open hacking phase
2065D - Skibidus and Sigma
Problem Credits: cry
Analysis: macaquedev
It is clear that the score of an array $$$b$$$ of length $$$n$$$ can be expressed as $$$n * b_1 + (n-1) * b_2 + (n-2) * c_2 \dots + 1 * b_n$$$.
Let's solve this problem with $$$n=1$$$ for just one array with $$$m$$$ elements in it. Due to the above fact, it's clear that the optimal way to arrange this array is to sort the elements from largest to smallest.
Now, we come to the issue of combining arrays. Suppose you have two arrays $$$a$$$ and $$$b$$$, both of length m. Is there a nice way of expressing the score of $$$a+b$$$ and the score of $$$b+a$$$ (where $$$+$$$ represents concatenation) in terms of $$$score(a)$$$ and $$$score(b)$$$?
Turns out there is. The score of $$$a+b$$$ is equal to $$$n * sum(a) + score(a) + score(b)$$$. This is because of the following:
$$$score(a+b) = (2n * a_1) + ((2n-1) * a_2) \dots + ((n+1) * a_n) + (n * b_1) \dots + (1 * b_n)$$$
Now, we can clearly replace all the $$$b$$$ terms with $$$score(b)$$$ as follows: $$$score(a+b) = (2n * a_1) + ((2n-1) * a_2) \dots + ((n+1) * a_n) + score(b)$$$
Now, we can take out a factor of $$$n$$$ as follows: $$$score(a+b) = ((n+n) * a_1) + ((n + (n-1)) * a_2) \dots + ((n+1) * a_n) + score(b)$$$ $$$score(a+b) = (n * (a_1 + a_2 + a_3)) + (n * a_1) + ((n-1) * a_2) \dots + (1 * a_n) + score(b)$$$ $$$score(a+b) = (n * sum(a)) + score(a) + score(b)$$$
Therefore, whichever of $$$a$$$ and $$$b$$$ has the larger sum should go first, because then you get a larger overall score. This argument also extends beyond two arrays, so the solution is as follows:
Sort each array in decreasing order. Sort the arrays themselves in terms of their sum, from largest sum to smallest Put together the final array Take the score This score is guaranteed to be maximal.
Will be added after open hacking phase
2065E - Skibidus and Rizz
Problem Credits: Proof_by_QED
Analysis: macaquedev
Claim 1: It is impossible when $$$k < |n-m|$$$
Proof 1: The entire string will have a balance value greater than $$$k$$$.
Claim 2: It is impossible when $$$k > max(n, m)$$$
Proof 2: The maximal possible balance value of any string with $$$n$$$ ones and $$$m$$$ zeroes is $$$max(m, n)$$$, as it is impossible due to the balance value definition.
To complete the construction, WLOG $$$n>m$$$ (because you can invert the string to get the solution for $$$n<=m$$$. Output $$$k$$$ zeroes, then output alternating ones and zeroes, then output the remaining ones at the end. Note that with this construction, a substring with balance value $$$k$$$ exists (as you can take the first $$$k$$$ numbers), but a substring with balance value $$$>k$$$ does not exist (as taking more of the string cannot increase the balance value).
Will be added after open hacking phase
2065F - Skibidus and Slay
Problem Credits: chromate00
Analysis: chromate00
Assume that a sequence a of length $$$n$$$ contains two types of elements, $$$1$$$ denoting majority and $$$0$$$ denoting "not majority".
Then, if a contains a majority and $$$n \ge 2$$$, the following condition holds. a must contain either $$$[1,1]$$$ or $$$[1,0,1]$$$.
This can be shown by contradiction. It is given that there are $$$k$$$ instances of $$$1$$$ and $$$n-k$$$ instances of $$$0$$$. Then it is known that $$$k>n-k$$$, so $$$2k>n$$$. If a does not contain $$$[1,1]$$$, then it needs a $$$0$$$ between every $$$1$$$. The only way this can happen is when $$$n-k \ge k-1$$$. This means $$$n+1 \ge 2k$$$, but because $$$n<2k \le n+1$$$ the only value $$$k$$$ can take is $$$\frac{n+1}{2}$$$. When this happens, the only valid orientation of $$$a$$$ is $$$[1,0,1,0,\ldots,0,1,0,1]$$$, but still this contains $$$[1,0,1]$$$. Therefore, it definitely contains either $$$[1,1]$$$ or $$$[1,0,1]$$$.
But we can notice, the subarrays $$$[1,1]$$$ and $$$[1,0,1]$$$ already contain the majority $$$1$$$. So due to this, we conclude that the tree containing the pattern $$$[k,k]$$$ or $$$[k,x,k]$$$ for some value $$$k$$$, is an equivalent condition to the tree containing a non-trivial path with majority $$$k$$$.
Checking the existence of $$$[k,k]$$$ and $$$[k,x,k]$$$ in the tree for all k can be done in $$$\mathcal{O}(n)$$$ time, due to $$$\sum{\text{deg}} = 2m = 2(n-1)$$$. The problem has been solved in $$$\mathcal{O}(n)$$$ time.
You can solve this problem using the Auxiliary Tree technique. Formally, the auxiliary tree of $$$k$$$ specified vertices is the tree consisting of the specified vertices and their pairwise lowest common ancestors. It can be shown that such a tree will always have $$$\mathcal{O}(k)$$$ vertices and can be found in $$$\mathcal{O}(k \log n)$$$ time using widely known algorithms.
Observe the fact that, when you transform the value $$$x$$$ into $$$1$$$ and all other values into $$$-1$$$, $$$x$$$ is the majority of the sequence if and only if the transformed sequence has a positive sum. This hints us towards finding the maximum sum of any non-trivial path under the transformed tree. If the maximum sum is found to be positive, then we can determine that there exists a path with $$$x$$$ as its majority.
This subproblem can be solved by running a modified version of Kadane's algorithm, adapted for use on a tree. This adaptation is widely known for the case when the given tree is a binary tree, and it is trivial to modify it for use on any tree while keeping the time complexity to be $$$\mathcal{O}(n)$$$.
The only problem is that solving this for all values is $$$\mathcal{O}(n^2)$$$, so we compress the tree for each value using the Auxiliary Tree technique. By getting the auxiliary tree for the specified vertices, you get the specified vertices and their LCAs. If some vertex is specified, the value on it is transformed into $$$1$$$. Otherwise, the value on it is transformed into $$$-1$$$. Meanwhile, now there are lengths on edges, and an edge with length greater than $$$1$$$ means that there are unspecified vertices compressed in the edge. Therefore, if an edge has length $$$l$$$ which is greater than $$$1$$$, make sure to make a new vertex with value $$$-l+1$$$ in the middle of the edge as it means that $$$l-1$$$ vertices are compressed into the edge.
As there are $$$n$$$ specified vertices in total, finding each auxiliary tree takes $$$\mathcal{O}(n \log n)$$$ time. Solving the rest of the problem for each $$$i$$$ only takes $$$\mathcal{O}(n)$$$ time trivially. Thus, the problem has been solved in $$$\mathcal{O}(n \log n)$$$ time.
Will be added after open hacking phase
2065G - Skibidus and Capping
Problem Credits: larush
Analysis: Proof_by_QED
Let $$$a_i=x$$$ and $$$a_j=y$$$ for any pair $$$(i,j)$$$ that we count.
First, let's note that since $$$x|lcm(x,y)$$$, we don't need to consider any cases where $$$x$$$ or $$$y$$$ has more than two prime factors. There are three cases we must consider:
$$$x$$$ and $$$y$$$ are primes, and $$$x\neq y$$$. Then, $$$lcm(x,y)=x\cdot y$$$ and has two prime factors.
$$$x$$$ is a semiprime, and $$$y$$$ is a prime factor of $$$x$$$. Then, $$$lcm(x,y)=x$$$.
$$$y$$$ is a semiprime, and $$$y=x$$$.
To count this, let's first factorize each number in the array (either by trial division in $$$O(n\sqrt{a_i})$$$ or $$$O(n\log(n))$$$ sieve precomputation). Let's maintain two maps, one mapping each semiprime present in the array to its number of occurrences, and one mapping each prime present in the array to its number of occurrences. Let $$$cnt[x]$$$ be the number of occurrences of $$$x$$$. Then, we can count each case as follows:
Let the total number of primes be $$$P$$$. For each prime $$$p$$$, its contribution will be $$$cnt[p]\cdot(P-cnt[p])$$$. Note that we must divide our result by $$$2$$$ as we would have counted each pair twice.
For each semiprime $$$pq$$$, add $$$cnt[pq]\cdot cnt[p]+cnt[pq]\cdot cnt[q]$$$.
For each semiprime $$$pq$$$, add $$$cnt[pq]\cdot (cnt[pq]+1)/2$$$.
All of these can be done in $$$O(n\log n)$$$ time. Be sure to not use dictionary, counter, or unordered_map as they can be hacked!
Will be added after open hacking phase
2065H - Bro Thinks He's Him
Problem Credits: Proof_by_QED
Analysis: efishel
A brute attempt at a solution would be to go through each non-empty subset of $$${1,2,...,n}$$$ and, for every pair of adjacent indices $$$(i, j)$$$ in the subset, increase $$$ans$$$ if $$$s[i] \neq s[j]$$$ In other words, increase ans every time $$$s[i]$$$ and $$$s[j]$$$ create a new border
This is extremely slow at $$$O(2^n*n)$$$; however, we can notice that every adjacent pair is independent from the rest in the subset. We may ask ourselves: for a fixed $$$(i, j)$$$, how many subsets increase ans through that $$$(i, j)$$$? The conditions are that:
- $$$i$$$ and $$$j$$$ are in the subset
- $$$i$$$ and $$$j$$$ are adjacent in the subset (there's no other included value in between)
- $$$s[i] \neq s[j]$$$
Which leaves us free to choose the prefix and the suffix. $$$(2^{i-1}*2^{n-j})$$$.
An $$$O(n^2)$$$ solution is:
ans := 2^n-1
for j (1<=j<=n):
for i (1<=i<j):
if (s[i] != s[j])
ans += 2^(i-1)*2^(n-j)
The rest of the solution will try to optimize how to compute that sum, and then how to maintain the answer through updates. We may notice we can pull out the $$$2^{n-j}$$$ factor and rewrite the loops as:
ans := 2^n-1
for j (1<=j<=n):
sumI := 0
for i (1<=i<j):
if (s[i] != s[j])
sumI += 2^(i-1)
ans += sumI*2^(n-j)
Since the second for loop only cares about what $$$s[j]$$$ is (nothing else about $$$j$$$), we can again easily optimize it as:
ans := 2^n-1
sumI := [0, 0]
for j (1<=j<=n):
ans += sumI[s[j]]*2^(n-j)
sumI[s[j]\oplus1] += 2^(j-1)
In other words, we don't need to recalculate $$$sumI$$$ each new $$$j$$$. Instead, we can maintain its $$$2$$$ possible values ($$$s[j]=0, s[j]=1$$$) as we increase $$$j$$$ (since $$$sumI$$$ cares about ($$$1\leq i<j$$$))
We can run this $$$O(n)$$$ solution once before any updates, but not after each update because $$$O(q*n)$$$ is too slow. Instead, we can make the minimal adjustments needed to maintain ans correctly. Let's call the toggled index $$$k$$$: How much does $$$s[k]$$$ contribute to ans in the first place? We can partition $$$s[k]$$$'s contribution to the answer in $$$2$$$ cases: - When $$$j=k$$$, $$$ans += sumI[s[k]]*2^{n-k}$$$ - After $$$sumI[s[k]\oplus1] += 2^{k-1}$$$, every time $$$sumI[s[k]\oplus 1]$$$ is used to increase ans
As for the first case, we can calculate the value of $$$sumI[s[k]]$$$ at $$$j=k$$$ using the sum of $$$2^{i-1}$$$ for $$$i < k$$$ and $$$s[i]=s[k]\oplus1$$$. As for the second case, it's only slightly trickier, but along the same general idea. It can be calculated using the sum of $$$2^{n-j}$$$ for $$$j > k$$$ and $$$s[j]=s[k]\oplus 1$$$.
Fenwick (or segment) tree solves both cases, which are essentially dynamically calculating range sums on an array. Since for both cases we may consider when $$$s[k]=0$$$ or $$$s[k]=1$$$, a total of $$$4$$$ different fenwick trees will be needed. $$$(2^{i-1}$$$ when $$$s[i]=0, 0$$$ otherwise); ($$$2^{i-1}$$$ when $$$s[i]=1, 0$$$ otherwise); $$$(2^{n-j}$$$ when $$$s[j]=0, 0$$$ otherwise); $$$(2^{n-j}$$$ when $$$s[j]=1, 0$$$ otherwise)
The procedure is thus: before toggling a bit, subtract its contribution from ans. After toggling the bit, add its new contribution to ans. Also, update the $$$4$$$ fenwick trees accordingly. This correctly maintains ans in $$$O(log(n))$$$ per update.
So, the final complexity is $$$O(n+q*log(n))$$$
Will be added after open hacking phase
First time I tried competing in Rust. Hopefully next time will go better. Thanks for the round!
++
thats great
Do you recommend it?
Auto comment: topic has been updated by Proof_by_QED (previous revision, new revision, compare).
That was not Div4......
what was it then
bro last div 3 was easier than wtv this div 4 was
How so? I think F and G in round 998 were quite difficult, and far more than any problem in this problemset.
I'm sure exactly zero people used the Auxillary Tree method to solve F.
Even after reading the tutorial, I have no idea what an Auxiliary Tree is.
what is that thing
it's also known as a virtual tree if i'm not wrong
It was originally in the statement :) (notes to be precise)
It doesnt make much sense in the editorial indeed.
It'll be fun to research though lol
Problems really weren't newbie-friendly. The problems are excellent, but not for Div.4 contest. More like Div.3 — Div.2
This was my first ever competition other than the one i gave previously. First Div 4 competition. And the first and second problem were i mean pretty easy. The third problem was tough though i was able to solve it.
Hope there are no more GPT or any AI during future contests.
so true. There is no way so many pupils and newbies can solve beyond E and F without cheating
Maybe they can solve F, but not E
hahaha yes, during the break-ins, guys with a rating of <1200 are in the top 200 and comments on every line in the code XD
I've been struggling for more than an hour to optimize Problem G, but I haven't been able to succeed.
pls tell me i'm not the only one that used LCA to AC F.
Can you explain your approach please?
Neal used that approach too.
Alternative solution for H:
Make a segment tree, and in each node, place the following things:
The length of the segment (call it $$$l$$$);
The number of subsequences with each start and end (call it $$$C_{i,j}$$$);
And the number of non-equal adjacent elements across all subsequences (call it $$$ans$$$).
We can find $$$ans$$$ in the following way: either the adjacent elements are both in the left, both in the right, or one's in the left and the other is on the right. So it's gonna be
.
This is what the code looks like: 305334877
Can someone please explain why two pointer does not work in Problem C2 after sorting array b?
Because a is not sorted, so while you move the first pointer forward the second pointer may move backward, then forward, then backward and so on. The solution's time complexity will be no better than O(n^2).
F is a very interesting question. It could've been set in a Div 2 or 3.
Could someone please explain why my submission for C1 is wrong?
https://codeforces.net/contest/2065/submission/305319973 (ignore "printDiffs" and "brute" functions, I used those for debugging)
I tried figuring it out but couldn't find what I did incorrectly...
Think about what you should do if a[i — 1] > a[i] is not true (i.e.: a[i — 1] <= a[i]). Are there any cases where it would be beneficial to perform the operation in that case?
could C1 also be solved using masks? 305285624 if yes, why doesn't this work ?
no
I liked problem D. never used prefix sums like that before. Very interesting contest overall :D (A little too much brainrot for me tho). Also I was curious if using DFS/BFS is a good idea in problem F. It might be redundant, but if anyone solved with bfs/dfs, please share your solution.
I solved using BFS,created a map for adjacent elements for each node in the tree ...305322643..hope you like it :D
Yep. That's literally what I wanted! Thank you kind sir.
Problems were defo not sorted according to difficulty, D was much easier than C1C2 combined! I had to do a very weird sorting pref sum thing just to solve it bcz i thought sorting according to sum was too easy,AC is AC lhamdoullah but still D shouldve been put before C
Can anyone tell me where this solution for problem G might be going wrong
I believe, I did it similar to the approach given in editorial
Seems that your code give WA in large cases only. When $$$n \ge 460$$$ your code print a lower answer that the expected. Like, your output is for example
4098
and the correct answer is108219
. Maybe you aren't counting some semi-primes or primes.Can someone pls help with F problem. I have maintained a neighboring frequency map and just checking if frequency > 1 for some element.
https://codeforces.net/contest/2065/submission/305373353
I have used a similar approach. you can check my submission if you want https://codeforces.net/contest/2065/submission/305357602
What ???
2065D - Skibidus and Sigma Editorial
Sort each array in decreasing order. Sort the arrays themselves in terms of their sum, from largest sum to smallest Put together the final array Take the score This score is guaranteed to be maximal.
Bolded part is a mistake?
I believe so
Can someone please help on what mistake I'm making for Problem G,
My submission
Thank you so so much!!
Maybe your code is getting TLE because of this line:
You are allocating $$$2 \cdot 10^5$$$ for each test case $$$t$$$ ($$$t \le 10^4$$$), this is like $$$2 \cdot 10^9$$$ causing the TLE. The statement says that: It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\cdot 10^5$$$.
If you replace
2e5+5
ton+5
you'll get an AC. 305391811Thank you so much for this.
Problem G https://codeforces.net/contest/2065/submission/305402634 Can someone please tell me what i am doing wrong I am wrong answer on 4th case
Brainrot Question names
Why my O(16 * n * logn) solution on H got tle :(
why this contest (DIV-4) rating is not updated...
Due to large number of participation + long hacking phase + A lot of cheaters
It takes time to asses and declare the final leaderboard, Its better to wait and get honest rating than to see cheaters getting +400 above you.
Oh okay
can somebody tell me at what test case my code might be failing 305361698
PLZ Somebody help me with this
Nevermind sorry, the advice I gave earlier is for C2.
I looked through your code. I would try to make sure of two things:
It seems like when you shift the one in front (
d[i + 1] = 1
), you then set the next one to always enter the first part of the for loop. In other words, in your code, I think once you flip one in front, it always flips the one in front regardless of whether or not it should. Always check, in your code, that every flip you do decreases or increases the number if it is expected to do that. It is a bit hard to tell what the d array is used for, it seems to be telling whether or not a bit is able to be flipped but is interacting with the ones in front, which haven't been checked yet?Make sure your code is not O(n^2) time complexity. I think your funci() and funi() functions are O(N), and if these run on every index, you might get a time limit problem because doing this on every index is O(n^2). I am not 100% sure of this.
Sorry for the initial wrong example/
thanks
Try this example:
a = [800, 100, 50, 25, 999]
andb = [1000]
Your code should say "YES" to this.Question H's tutorial has faulty LaTeX in the "Solution" section near the bottom. In the last math's pseudocode, there's some
oplus1
thing. I think it's just supposed to bes[j] XOR 1
.$$$\oplus$$$
represents $$$\oplus$$$ (XOR).CAN ANYONE EXPLAIN WHY THIS APPROACH TO c WAS WRONG?
https://codeforces.net/contest/2065/submission/305299896
we need something greater than prev( i.e, a[i-1]) in the ith position. two options: a[i] and someB-a[i].
how do we find someB such that someB — a[i] >= a[i-1]? binary search for someB >= a[i-1] + a[i].
However, your binary search looks for the incorrect equation.
oh nevermind I misread your equation.
Okay, you are not considering a[i] as a better alternative to the binary searched someB — a[i]. Since the question says we have two options but you seem to be consider a[i] assignment as directly someB — a[i] instead of picking the minimum of the two options if someB is found.
Here's a modification of your code that should work: https://www.programiz.com/online-compiler/58tGE9B62DSgh
Does anyone tell me why my O(16 * n * logn) solution on H was TLE ? I read William Lin's solution and it may the same with mine
Here is my solution https://codeforces.net/contest/2065/submission/305249433
Here is William Lin's solution https://codeforces.net/contest/2065/submission/305272835
Lol I didn't solved B. after 1st wrong submission big mistake
I’m working on problem C2 and I’m unsure where my code is going wrong. Could anyone help me figure it out?
You're only applying the operation when you get a shorter element compared to current one. But this is not always true.
Consider the case:
a = [6, 4] b = [1000]
You won't apply the operation on 4, because it would be substituted to > 4(1000 -4), but if you've used that you should've got a non-decreasing array.