|
On
zeyd1234 →
Why China dominates IOI year after year (and why CTS is harder than IOI itself), 3 months ago
0
Isn't it a big gamble to focus in NOI and ignore school? NOI gold is pretty competitive and hard, rather than getting into NOI itself from local competitions. |
|
On
zeyd1234 →
Why China dominates IOI year after year (and why CTS is harder than IOI itself), 3 months ago
+32
IQ is a lie, Education is the truth, Practice is the source, Community is the goat. |
|
0
Already supported by Polygon, but only for C++ and Python. It needs to be supported their at least for Java and Rust before you see it in public contests. |
|
On
demonicc →
Your Algorithm is Fast, Your Implementation is Slow: A Guide to Data Locality and Cache Optimization, 13 months ago
+1
Number 3 is automatically done by G++ compiler (I'm not sure if it needs -O2, but it is done automatically by Codeforces) G++ is smart and makes any modulo by a constant value much faster in compile time. Check how does it usually in https://godbolt.org/ |
|
+12
Heeeeell nah. if arvindf saying this then what about us the newbies. |
|
0
Do you have the tasks? |
|
0
Well, I discussed this with GPTs most of the time, and they provided me the reference websites. Some Codeforces blogs and Reddits discussed this: |
|
0
You can easily conclude that all top 10 countries have a national olympiad and have a good team selection method. The way I see it to make progress is by encouraging participation in olympiads, like:
And it depends on those 4 things how good are they provided. |
|
+10
You know tierlist is cooked when Python is better than C |
|
+9
If it's cost was higher than the cost of bots/IPs/servers, then it won't prevent |
|
+4
What is the website for this year? |
|
0
|
|
0
Link doesn't work, put the invitation link |
|
+1
Sul_A. is the goat |
|
0
You can do it in $$$O(n \cdot \log{n})$$$ offline. you only need rollbacks (in this case you just save maximums along with a trie), and you can add offline deletion. |
|
0
I wish this isn't an April fool |
|
-8
This IOI will be an easy 4 golds for Saudi team :) |
|
+4
It would be good to put the official link in the blog: https://naoi2025.algerianoi.com/teams Saudi Arabia team (identical to BOI 2024):
Average of max ratings: 1541.5 |
|
0
I don't know their official email or any website related, if you know tell me. |
|
+29
You can do it using presistent segment tree. |
|
0
Don't you think this ruins the competition on CSES? because this is the point of CSES |
|
0
Every Discord invite is expired, can you send an invite that works for infinite amount of people and no expiration date? |
|
0
This problem is the exact same as CSES — Permutations II, although the constraints are $$$n \leq 5000$$$. Note, this task could be solved in $$$O(n)$$$, you can check it on USACO Guide — Solution |
|
+8
Congrats, hope you the best |
|
0
Sorry, I assumed that it is a full binary tree (either 2 children or 0). Here is another observation that will solve the problem: For every vertex, all of its adjacent must be in opposite color, otherwise it's not a Magical Panda Tree If this condition is satisfied, then you can put the root at any vertex that has degree 2. |
|
+5
First, you need to ensure that it is a binary tree. Any tree such that there exists: - Exactly one node with degree 2 - All other nodes are of either degree 3 or 1 If it was the case, then you found the root. Now your goal to determine if it's a Magical Panda Tree or not, you can do it using DFS/BFS. |
|
0
Well, you can handle this it using your old DP definition. Here is my submission |
|
0
Thanks I was wrong, I'll update it |
|
+1
First, you can construct a directed graph consisting of $$$n$$$ edges $$$i \rightarrow A_i$$$ (known as sunflower graph). The sunflower would look like a cycle and some trees from other nodes. Example image Compress the cycle to be a single node and make it the root, so it will become a normal tree. Now you can do $$$O(N^2)$$$ DP like this: $$$dp(i, j) = $$$ How many ways to assign numbers to subtree $$$i$$$, such that the assigned number is $$$j$$$. The formula: $$$dp(i, j) = \prod\limits_{c \in adj(i)}{ \sum\limits_{v = 1}^{v \le j} {dp(c, v)} }$$$ |
|
On
THE.ROCKSTAR →
how to convert a directed graph into a DAG( directed acyclic graph ) ?, 22 months ago
0
This is called Strongly Connected Components (SCC). You can check some resources: USACO Guide, CP-Algorithms |
|
0
You need to store the answer for every node after finishing, here what I would modify: Code |
|
+3
Thanks for the correction |
|
0
This code seems to be for problem CSES — Distinct Colors. If you did small to large, the complexity would be $$$O(n \cdot \log{(n)}^2)$$$, but this code is $$$O(n^2)$$$ |
|
+78
Isn't this just Suffix Array? |
|
On
Shisuko →
How to make IOI-style "implement this function" problems in Polygon? Can it be done in Python?, 2 years ago
+7
Yes, it can be done. Write the grader in resources section then select it as grader for *.py files at runtime |
|
0
Here is another source mentions this technique: https://robert1003.github.io/2020/02/14/graphs-and-segment-tree.html |
|
0
|
|
0
It's better to use Read this blog for more |
|
+33
|
|
+8
When will every country participated and I can discuss problems? |
|
On
no_lie →
Introducing cses-enhancer: An extension for CSES problemset to add notes and mark tasks as favorite, 2 years ago
+2
Amazing, can you also upload it on Firefox? |
|
+1
This problem already exists in Codeforces (Div.1 — B — Xor Pyramid), and here is my solution: Do a range dp, where $$$pyr(l, r)$$$ is the value of the head of the pyramid if we considered range $$$[l, r]$$$. $$$pyr(l, r) = pyr(l, r-1) \oplus pyr(l+1, r)$$$ And you can create another DP where you calculate the maximum: $$$dp(l, r) = max(dp(l, r-1), dp(l+1, r), pyr(l, r))$$$ |
|
+19
You're right, it might be because of random-access and you are defining vectors inside the function (i.e. heap/stack thing). But I don't think so because I resubmitted with defining in global and no difference. |
|
+11
I guess it's a compiler optimization In your code if $$$g[i][j]$$$ is false, it won't do anything in the loop. I guess GCC adds |
|
0
Does it work when submitting problems on groups/private mashups? |
|
+1
I think you solution is something like this: Let's sort points, then do this DP: $$$dp(i, msk) =$$$ Maximum number of points $$$\leq p_i$$$, where $$$msk$$$ is a bitmask of used segments. $$$dp(i, msk) = min(dp(i-1, msk), dp(lowerbound(i-sz_j), msk \oplus 2^j))$$$ |
|
0
As a participant you hacked, I wanted to say that probably many people know that their hashes are weak. I was actually speed coding this problem in last 9 minutes & I managed to get it accepted. The only thing that I thought it could defend my hash is randomized base, but it also got hacked because you can submit too many testcases with some range of bases you try to hack + I used a bad random I believe this is a good lesson :) |
|
+8
Is there a mirror/virtual where I can submit? |
|
+8
I found this code which solves CSES — Subtring Reversals using some kind of sqrt blocking |
|
+1
|
|
0
|
|
0
Sorry, I misunderstood, edited it |
|
0
Longest subsequence with at most $$$k$$$ non-equalling elements? $$$dp_{i,p,j} = $$$ Longest subsequence with $$$k$$$ non-equalling elements, ending with element $$$p$$$ $$$dp_{i,p,j} = max(dp_{i,p,j}, dp_{i-1,p,j})$$$ $$$dp_{i,a_i,j} = max(dp_{i,a_i,j}, dp_{i-1,p,j-(a_i \neq p)}+1))$$$ Time Complexity: $$$O(n^3)$$$ Memory Complexity: can be optimized to be $$$O(n^2)$$$, probably $$$O(n)$$$ |
|
0
Yes, I solved it using Parallel Binary Search, it's really similar to Stamp Rally. Can you explain your idea? or send your code? Accepted Code: https://cses.fi/paste/bfe897265843ddb05a70d4/ |
|
+2
USACO Guide is a really good resource that contains explainations, videos, problems, and solutions. |
|
+8
These tasks also solvable using Parallel Binary Search:
|
|
0
Auto comment: topic has been updated by Muaath_5 (previous revision, new revision, compare). |
|
-16
What should I put in the checker in intractive problems? The intractor is enough in my case. |