| № | Пользователь | Рейтинг |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | dXqwq | 3436 |
| 8 | Radewoosh | 3415 |
| 9 | Otomachi_Una | 3413 |
| 10 | Um_nik | 3376 |
| Страны | Города | Организации | Всё → |
| № | Пользователь | Вклад |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | adamant | 152 |
| 3 | Proof_by_QED | 146 |
| 3 | Um_nik | 146 |
| 5 | Dominater069 | 144 |
| 6 | errorgorn | 141 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | TheScrasse | 134 |
| 10 | chromate00 | 133 |
|
На
Libraion →
[Help] Count number of integers from 1 to n can be represented as ax + by with given positive integers n,a,b and x,y must be natural numbers, 4 года назад
+27
"Now we just have to count how many pairs $$$(x, y)$$$ there are such that $$$ax + by \lt ab - a - b$$$" I have just read your solution to this line. But the problem is count how many numbers can be represented, not how many pairs $$$(x,y)$$$ (As $$$2$$$ different pairs can result in the same number: $$$1\times 1 + 2\times 2 = 1\times 3 + 2\times 1=5$$$). Sorry if I missed something. PS: You can place your math equations between $$$2$$$ Dollar sign $. |
|
На
Libraion →
[Help] Count number of integers from 1 to n can be represented as ax + by with given positive integers n,a,b and x,y must be natural numbers, 4 года назад
+19
Auto comment: topic has been updated by Libraion (previous revision, new revision, compare). |
|
0
Thanks <3 |
|
+8
Thanks so much! |
|
0
This is the $$$O(N^2)$$$ version. The problem is to find the total weight of Minimum Spanning Tree. |
|
+48
Could you elaborate a little bit more? Like with a real example. Thanks |
|
+48
Thanks <3 |
|
+30
Interesting! Thanks for your reply. |
|
+19
Thanks for your reply. |
|
+22
Thanks for your reply. At least we would know to try to put inline before function with many recursions when getting RTE. |
|
+23
Added #pragma GCC optimization ("O3"): 123037331, but still RTE. Sorry if I missed something. |
|
+16
That's an idea to consider. However, as I'm fed up with this problem, you can try to implement your approach and check the above 3 big testcases google drive link. (If you are successful, please show me your code <3. Thanks) |
|
+32
Thanks so much. Your approach is no neat. Unfortunately, the three big test case didn't match your output (the remaining 17/20 works). I don't know why, maybe the testcase was poorly generated. You can check the three testcase here: https://drive.google.com/drive/u/0/folders/1WdIhtuiy5hML6x2tFmOe6iBQ6KdV4j3I |
|
+32
It seems to me that your solution won't be able to pass the below case. Sorry if I missed something. |
|
+38
Thanks for everybody. Using your ideas and suggestions, I have come up with a weird solution. (It outputs correct for 17/20 test cases — the 3 remaining are huge ones and I don't know what to do — maybe just assume that the test output is wrong by float/double/long double reasons). At first I think about sweepline 2 directions and calculate like Veladus ideas. But I stucked at the polygon which is like the picture below. As we each time we get to an event there can be O(n) different trapezoids (and it seems that there is hardly a way to manage every trapezoid and sum up all of them at once).
So I changed the idea a bit. First I took the convex hull of the polygon. And calculate with the above idea. But it will be redundant of course. So I just iterate through the polygon again and find which inner-polygon is redundant and recursively solve it again then minus the redundant part. It is a lot of implementation, though. I thought it would be slow, but in fact it was fast but it was WA. I'm looking for a way to generate testcase for this problem. But the restrictions of polygon which is not self-intersecting and the input have to be ccw/cw order, makes it really hard. Not only that I don't know how to have correct output for that generated testcases :'(. I'd appreciate if anyone suggest me a way to generate test and help debug my code. |
|
+35
I don't know if it is online or not. I have about 20 local tests for this problem. |
|
+32
Sorry but may I have a few absurd question?
|
|
+32
Thanks for answering! Could you elaborate your idea with the above test case please? Appreciate! |
|
0
Thanks so much ❤❤ |
|
0
Auto comment: topic has been updated by Libraion (previous revision, new revision, compare). |
|
+24
So what happen when there is > 2 odd degree vertex that you cannot fit every vertices into 1 path. Then how many paths? And what if after finishing 1 path you make the graph unconnected ... etc. |
|
+24
Sorry I don't understand what you mean. Could you elaborate it a bit? |
|
+5
Thanks <3 |
|
+5
You can see my proof here |
|
+14
My proof goes like this: Let $$$H, X, P, Q, M, A, R$$$ is declared the same as in the editorial above. We prove (from the editorial), when we increase $$$H$$$ by $$$1$$$:
Let $$$F(H)$$$ is the cost when ADD / REMOVE / MOVE so that the resulting height for all the pillars is $$$H$$$. Let $$$H_0$$$ is the minimum $$$H$$$ such that : $$$P \ge Q$$$ and $$$X$$$ is minimum as possible (call this $$$X$$$ : $$$X_0$$$). When $$$H \ge H_0$$$, because the rate of change when $$$H$$$ increases by $$$1$$$ in $$$F(H)$$$ is $$$AN−M(N−X) \Rightarrow $$$ when $$$H$$$ increases $$$\Rightarrow X$$$ increases $$$\Rightarrow AN−M(N−X)$$$ increases . The same thing implies with $$$H \lt H_0$$$, when $$$H$$$ increases $$$\Rightarrow X$$$ increases $$$\Rightarrow -RN + MX$$$ increases.
So it's a part of a unimodal function. We need to prove that with $$$H \lt H_0$$$ the function $$$F(H)$$$ will be the remaining part of that unimodal function. Proof $$$AN−M(N−X_0) \lt 0 \Rightarrow MX_0 \lt MN - AN \Rightarrow -RN+MX_0 \lt N(M - (A + R)) \le 0$$$. (Because $$$M = min(M, A + R)$$$) $$$\Rightarrow -RN + MX_0 \lt 0$$$ With $$$H \lt H_0 \Rightarrow X \lt X_0 \Rightarrow -RN + MX \lt -RN + MX_0 \lt 0$$$. And we know that $$$H$$$ increases $$$\Rightarrow -RN + MX$$$ increases (but still $$$ \lt 0$$$) which will complete our remaining of an unimodal function.
|
|
0
Thanks so much <3 |
|
+20
Could I ask some stupid questions ^^ ?
Sorry for my poor logic ^^. Hope you will answer me <3 <3. Thank you |
|
На
thebruisedsoul →
How to handle large number of queries related to finding LCM of all numbers in the range [L,R]??, 6 лет назад
+10
I have a question. How can we deal with the problem of calculating $$$LCM(l, l + 1, ..., r)$$$ % $$$(1e9 + 7)$$$ with $$$r - l + 1 \lt = 1e6$$$ and $$$l, r \lt = 1e14$$$ (1 query only) ? Thanks for reading <3 <3. |
|
+5
Thanks |
|
+5
And the time complexity if $$$O(1)$$$ also ? |
|
+5
Can I ask a quite stupid question ? What is the complexity of __builtin_clz ? Is it $$$O(1)$$$ or $$$O(log n)$$$ ? Thanks <3. |
|
+76
Me: Scrolled down the comments section to see if this was a joke :'). |
|
0
People will not have your information like nations, names, schools, ... and you are free to speak what you think straight without worry about some of personal reasons. |
|
+8
Thanks! So the problem setters need to think harder and harder everyday to have new problems for us. Really appreciate them <3. |
|
0
You know people use clones to post weird posts, don't you :D ? |
|
+8
I stucked at this problem too. There are some suggestions here. But he didn't mention how the transtions between the DP states work. I have been comtemplating about that for 3 days and still didn't have an idea. Can anybody help please ? Thanks for reading <3 <3. |
|
0
Thank you for clarify it out <3 <3. At first, I was thinking $$$d[n + 1][j + 1][m + X]$$$ can include $$$d[n + 1][j][m]$$$ somehow but it turned out to be wrong. Love you <3 for answering my question. |
|
+5
Any..body kind in this awesome Codeforces community :< ? |
|
+16
Sorry for asking these silly questions but what knowledge or definitions I need to learn in order to understand what is $$$N_{\supseteq T}$$$, $$$N_{= T}$$$, $$$N_{= \emptyset}$$$, ... and what really $$$N$$$ and $$$T$$$ represents for in this definition: (Because it just pops up from nowhere and I could not understand).
Thanks for reading and helping me!!. |
|
+8
Anybody can help me :<< ? |
|
+5
In problem 167B — Wizards and Huge Prize editorial, it says "The answer will be the sum of $$$d[n+1][j][m]$$$ for all $$$j,m$$$ such ...". I have the question about this: What if there are some $$$d[n + 1][j + 1][m + ...]$$$ that will include $$$d[n + 1][j][m]$$$ (What I means is they are not distinct to each other), so can we just sum all of them so simply like that?. I learned that: Only if all the events A, B, C, .. are pairwise distinct, $$$P(A + B + C + ...) = P(A) + P(B) + P(C) + ...$$$. So how are all the $$$d[n + 1][j][m]$$$ are pairwise distinct anyway? Sorry for my bad English, thanks for reading <3 <3. |
|
На
Libraion →
[HELP] Explanation for calculate modular inverse of all number from 1 to N in O(n), 6 лет назад
+5
Thank you guys very much <3 <3. |
|
+5
So E1 editorial solution can be done for E2 also with some modifications (or a lot of modifications :D). Am I right? |
|
+20
I also wonder about the time complexity :<. Could anyone clarify this? |
|
0
Could you suggest me some problems of this type? |
|
0
Nobody can help me ? :( |
|
+3
Can you suggest anything else? Because that article doesn't focus on explaining the smaller_to_larger I think. |
| Название |
|---|


