Comments

There can only every exist two unique sequences (considering all the elements $$${mod}$$$ $$$2$$$) which satisfy $$$(A_i + A_{i+1}) \equiv B_i \pmod{m}$$$ for all $$$1 \leq i \leq n-1$$$.

These can be found out by modifying the prior condition to:

$$$A_{i+1} \equiv {B_i - A_i} \pmod{m}$$$

Hence, if we know know the first element we can always re create the entire sequence. So, we first assume the first element to be 0 and then 1. And choose the better case of the two as final state.

This was probably the problem I liked the most:

I spent an entire day thinking on this, and at the end I drew inspiration from tetra valency of carbon in organic chemistry to solve it.

0

Went from 0 -> 1662 (max) (1575 current); So +1662 max delta

same here

Wonderful extension!

Do you have it on github?

Wonderful platform, though I have some suggestions, Can you add something like an "Open Room" which anyone can join; by clicking "Open Room" option on the website itself a list of such open rooms be displayed, and for joining such rooms you don't require the room code, you just find them in the list and click them, and thus join them. The option for making the room open / private can be given to the admin whilst creating the room. Also a chat option for such rooms would be extremely helpful.

I mean what he is trying to promote isn't wrong, even if it is ChatGPT.

On iezSelf Made Problem help., 15 months ago
0

Assuming that you mean, that we have to maximize the length of subarray such that it's sum is not divisible by $$$x$$$. Here is an approach I thought of for your second problem.

We consider the entire array, and if the sum is divisible by $$$x$$$, then search from both start and the end to find the first number that is not a multiple of $$$x$$$, choose to remove elements from the side which minimizes the length of the array the least.

For example consider, $$$x = 10$$$ and the array to be $$$A = [10, 20, 34, 55, 49, 32, 30]$$$. We first choose the entire array, then we get the sum to be $$$230$$$, now we see that it is divisible by $$$x$$$ so we search from the start and from the end for the element that is not divisible by $$$x$$$. So, from the start the third element $$$34$$$ is such an element, and from the end the second element from last that is $$$32$$$ is one such element. Since, if we remove the prefix, we will end up decreasing the length by 3 and if we remove suffix we will reduce the length by 2. So, we'll prefer suffix (since it minimizes the length by the least).

I cannot prove that this works, but I think it should, counter examples are always appreciated.

I was so in search of such a tool, thanks a lot for this!

(PS- Also, a suggestion, can you add Dijkstra and Hierholzer aswell?)

On _tran.haian_0317.Road to Expert, 15 months ago
0

more or less the same ig.

On _tran.haian_0317.Road to Expert, 15 months ago
+4

Damnn dude, something similar happened to me aswell, I went till 1590 easily, but then I choked, and got -73 delta in the very next round, but hopefully I rebounded and finally reached expert yesterday, hope you do aswell.

I tried something different on F, I realised that whenever a unit square shares exactly two sides with the existing shape, adding or removing it changes only the area (by +1 and -1 respectively) and leaves the perimeter unchanged. After this, I reduced the p/s fraction to it's basic form, where gcd(p, s) = 1; In this form, s * 2 + 2 is the maximum possible perimeter achievable by s squares, if the needed perimeter ratio exceeds this, then we output -1. Otherwise, we start at (0,0) and alternately attach one square upward or leftward: each step adds area +1 and perimeter +2. As soon as the current perimeter is divisible by p and the target area = s·(perimeter/p) fits inside the m×n “L” we have built (where m,n count how far up/left we have gone), we fill exactly the needed interior squares (each of which shares two edges, so perimeter stays fixed) until area = s·(perimeter/p). This makes a single connected shape with perimeter/area exactly p/s and under 50,000 pieces.

Here is my submission that implements the same, 322889890

+5

I would suggest you to watch some videos on bitwise operators and learning about a few identities. Also, learn how to manipulate kth bit of a number. Also, when faced with certain bitmasks (at unrated level), try this thing, first try to solve it for a binary string instead of an actual array of numbers. Then just repeat the solution for 32 (or 64) binary strings combining to form the numbers.

ClownGPT

On zenny0212Debug in C++, 16 months ago
+1

Damn, this is good. I used something like this (the code below) (but it messes up on vector<multiset<T>>, vector<set<T>>, etc., type structures). But I guess this doesn't have that problem.

#ifndef ONLINE_JUDGE
vector<string> DBGc{ "\033[0m", "\033[94m", "\033[36m", "\033[92m" }; //debugging colors
template<typename A, typename B> ostream& operator<<(ostream& os, const pair<A, B>& p) {
    return os << "(" << p.first << ", " << p.second << ")";
}  template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "["; for (auto it = v.begin(); it != v.end(); it++) os << (it == v.begin() ? "" : ", ") << *it; return os << "]";
}  template<typename T> ostream& operator<<(ostream& os, const set<T>& s) {
    os << "{"; for (auto it = s.begin(); it != s.end(); it++) os << (it == s.begin() ? "" : ", ") << *it; return os << "}";
}  template<typename T> ostream& operator<<(ostream& os, const multiset<T>& s) {
    os << "{"; for (auto it = s.begin(); it != s.end(); it++) os << (it == s.begin() ? "" : ", ") << *it; return os << "}";
} template<typename A, typename B> ostream& operator<<(ostream& os, const map<A, B>& m) {
    os << "{"; for (auto it = m.begin(); it != m.end(); it++) os << (it == m.begin() ? "" : ", ") << *it; return os << "}";
} void dbg_out() { cout << DBGc[0] << endl; }
template<typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) { cout << DBGc[3] << H; if(sizeof...(T)) cout << ", "; dbg_out(T...); }
#define dbg(...) cout << endl << DBGc[1] << "[line:" << __LINE__ << "] " << DBGc[2] << #__VA_ARGS__ << " = ", dbg_out(__VA_ARGS__)
#else
#define dbg(...) void(false)
#endif
On 123gjweq2How fast can you type?, 16 months ago
0

Can vary from a couple of hours to a day. (in my case)

On 123gjweq2How fast can you type?, 16 months ago
+13

Typing Test

This took a lot of tries, I kept on reading ahead only to realise I typed a character wrong, making the entire thing I typed after it incorrect (especially whilst switching between lines) (monkeytype effect).

On Jinwoo-SungNEED HELP !, 16 months ago
0

I think you are trying to simulate the entire process through your code, maybe using multisource bfs (or dijkstra since you are using priority queues). I think efficiently simulating this would be harder, but there's a much simpler observation you can make to solve it easily. That is :-

All of Neo's clones should be placed at local maxima's, this way Neo would efficiently be able to get all the buttons pressed in the non increasing order of b.

On Jinwoo-SungNEED HELP !, 16 months ago
0

I am not able to completely understand your code, but from what I get from here:-

for(int k = 0; k < l; k++){
    int count = 0, j = a[k];
    dfs(1 , visited , adj ,res , count , j);
}

I think you might be trying to find all the vertices reachable from vertex 1 by performing dfs for that particular value of multiset, but this is not correct. Some nodes can only be reached with the value achieved by summing up two or more values in the multiset.

Good luck! Hope you make it to Specialist by July!

Ah yup, when I add two three new problems (making 6 or more in total), and then I scroll a bit to choose the rating for the latter problems (6th or later), then the drop down is dropped in "not the correct way", I guess you can see it here.

Image Here

Uh, hey, I think I found a small bug; If you choose to have more than three problems in the contest, and you decide to choose the rating for the fourth problem or the problems after it, the drop down by default opens from problem 3. Please fix this soon.

This is actually very useful, thanks a lot for this man!

Ah I see, thanks for clarifying.

Can't we just check all the simple paths of length K emerging from the vertex 1 and ending at the Vertex n. Since k <= 5, I think this should pass for n and m even going upto 1e6.

Please correct me if I am wrong.

Amazing!

The tools, such as custom contest and online compiler, are really useful. Thanks!

+3

Atleast, give the AI better prompts bro, it's painfully funny to see someone not being able to write comments even to defend themselves without help of LLMs.

+8
Bro is playing in third person irl.
Totally, agreed on his skill, after seeing how much time he invested to write these extremely sane comments in his copied precode.

And even after all this, if you still insist that the solution was by your own skill, would you mind explaining how this new template appeared out of nowhere mid contest? Or you forgot the place from where you copied this new template of yours from, by another mere (fateful) coincidence?