
i might have to quit codeforces after this

i might have to quit codeforces after this
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | jiangly | 3631 |
| 4 | Kevin114514 | 3574 |
| 5 | maroonrk | 3521 |
| 6 | strapple | 3515 |
| 7 | Radewoosh | 3461 |
| 8 | tourist | 3428 |
| 9 | turmax | 3378 |
| 10 | Um_nik | 3376 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 161 |
| 2 | adamant | 146 |
| 3 | Um_nik | 145 |
| 4 | Dominater069 | 142 |
| 5 | errorgorn | 140 |
| 6 | cry | 138 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 10 | soullless | 133 |
| Name |
|---|



Auto comment: topic has been updated by TsPcZc (previous revision, new revision, compare).
Auto comment: topic has been updated by TsPcZc (previous revision, new revision, compare).
Auto comment: topic has been updated by TsPcZc (previous revision, new revision, compare).
You can upload img there, then open the link, click on your image RMB, click "Copy URL of pic", and on codeforces in the text section select img button the left side of 'chain' icon. Paste link there, done
Auto comment: topic has been updated by TsPcZc (previous revision, new revision, compare).
Auto comment: topic has been updated by TsPcZc (previous revision, new revision, compare).
If you made the same mistake as me, you might be failing testcases like $$$[2, 1, 3, 1]$$$ for $$$E$$$. If we blindly assign some element that isn't equal to the last two (unique) elements to the end of this array, we could end up with something like $$$[2, 1, 3, 1, 2, 3, 1]$$$ which creates the extra palindrome $$$a[1..5]$$$.
oh nah in those cases I always add an element that doesnt appear first
only then do i add elements that arent at the end of the array (if there are no more unique elements)
Could not agree more
I took a look at your D and you got the idea (more or less) lol
Try to think about it as:
Find the first index where the sum changes.
First index plus the size it's the range.
Anyway by printing
endlthe stream it's flushed; you do not need an explict call tocout.flush()afterwards.Well, I couldn't appear in the contest due to some issues but, while overlooking, I came up with the following approach for D:
1) Find the range r — l, with 2 queries. Sum of original array. Sun of updated array. 2) Now, use queries to find the start element. Like Binary Search. 3) First half of array. If the difference equals range, the range is in first half else, it's in second half, if difference is zero. 4) If difference is less than range but more than zero, you have stumbled upon one of the modified element. Now, use sliding window of range length to find l and r.
Do you think, this works?
To be clear i think you are letting the things to be harder than it's meant to be lol.
By following you reasoning you got the special case where the modified range it's one of those that falls right into the range that we are querying. So i'll exclude this case from futher discussions.
Lets define $$$k$$$ as the size of the range that we are looking for (obtained by querying the entire range and subtracting the modified one with the original).
At some point you got a range $$$[l, r]$$$ that has some elements modified; that implies that the entire needed range falls in the range $$$[l - k + 1, r + k -1]$$$.
As you can see, now by doing a sliding window technique, you have to make one query for each subarray of size $$$k$$$. I think it's pretty clear that you will surpass the limit of the $$$40$$$ query aviable.
Maybe you get do some trick like to query only non overlapping subarray but i'll let you figure it out why it's not going to work.
In the spoiler of my first comment there is the solution that's easy to get.
Actually, no we don't need to iterate the sliding window entirely.
1) Suppose we find a modified element at n.
2) Check the difference of the modified array and original array between range (n-k) and n. Let this be m.
3) Now, the first index would simply be n — m.
This way, we can save on the queries :)
Bruhh sameeee.
I am just bad at reading problems(
i took 40min to understand problem b properly lol, i was staring at my code and couldnt figure out why i got WA on test case 1. thankfully i still managed to solve up to d atleast
i misread subsequence as substring on b lol
Same
was my worst ever contest div 3 contest y was it so hard?
Is it just i am good or is it skill issue
E stumped me for 1.75 hours :((
well,well,well what about mee???
lol
For div3/B your code is way too much . Looks like you are doing a PHD in strings.
ok i was lazy and brute forced it
bruh i thought the problem was finding a subarray, not a subsequence
oops
lol
There was just a tiny swaping opeartion nothing else in the problem E! That got me whole contest to find!!!
Test your code locally before submitting
i was 90% sure it worked but apparently it didn't
That's why you test — to be 100% sure
you do save 30 seconds or so by not testing if you're really confident your code works
This feels like gambling
You lose 10 minutes worth of points for each wrong submission, so the odds aren’t exactly in your favor
it's not that likely that your code would pass the samples and fail other cases though, and even then it's hard to find a test case that fails (as i saw during the contest)
Well you're code didn't pass samples so the chance of passing the rest of the cases is 0%
you don't have penalty for failing samples though
in local testing my answers were correct even it matched with the example outputs but still the jury declared it wrong
in B u can just print index of all 0's or all 1's
in D observe that if u subtract 2nd query from 1st query result for some range u would get number of elements which are increased, now binary search for largest l such that no values are increased in this, print l+1 and l+1+total increased value
in E I first find 3 unique elements which aren't present in array a, if I couldn't find I just fill my array with unique elements from backward and reverse it, now print it ans[i%3] for all i from 0 to k
i see the mamba in you, ask for the ball more
It's very sad to say