| # | User | Rating |
|---|---|---|
| 1 | Benq | 3857 |
| 2 | jiangly | 3810 |
| 3 | maroonrk | 3534 |
| 4 | tourist | 3528 |
| 5 | Kevin114514 | 3510 |
| 6 | turmax | 3411 |
| 7 | Um_nik | 3387 |
| 8 | Radewoosh | 3367 |
| 9 | heuristica | 3322 |
| 10 | strapple | 3317 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 158 |
| 2 | maspy | 150 |
| 3 | Um_nik | 146 |
| 4 | Errichto | 139 |
| 5 | adamant | 136 |
| 6 | maroonrk | 134 |
| 7 | DNR | 133 |
| 8 | Dominater069 | 131 |
| 9 | Proof_by_QED | 130 |
| 9 | AmShZ | 130 |
|
+4
Well we have the upper and lower bound. Just take the diff |
|
+3
exactly. one solution for A, B, and C |
|
+3
trial and error? need only around 30k levels to reach $$$10^9$$$ |
|
+1
could be 8 8 8 8 thus on 1st second |
|
0
No need to count connectivity of red edges. Merge all nodes with red edges to components and multiply each member count of adjacent components |
|
-9
Especially this part. Can elaborate more? |
|
0
All 3 just fine |
|
0
I found the problem G day 1 has a weak testcase. My submission got a bit typo and yet still AC |
|
0
I dont know for BIT but for segtree you can store additional |
|
0
In this case just 3 times (2,2,5). But anyway number of choosing doesn't really matter to optimal choosing. We can get optimal value by more than one way |
|
0
choose any 2 -> delete 3 choose another 2 choose 5 -> delete 4 total 9 |
|
0
|
|
0
Cycle with 3 or more elements can still exist, yet can't return to original sequence (see (nxy) example above) |
|
0
To maximize dimension of pieces, we must divide choco such that row and col of each piece nearly equal. So we divide n to x choco rows and m to y cols, and take floor because of minimum area |
|
0
And at least a neighbor dot have visited to ensure it reachable from start point |
|
0
Remove an intersection is remove a horizontal and vertical bar. Rest is yours ^^ |
|
+3
It should be i,j,k in bound checking and counting chances |
|
+2
|
|
+3
have an explanation? |
|
0
Have you try Euler Theorem ? |
|
0
Factor of luck |
|
+9
Sleep is for da weak. |
|
+5
Optimize it more by change the stack type become stack of current node only. If you pop the current stack top element must be parent |
|
+13
still here |
|
0
Actually same as usual hashing. And since we look for palindrome, just find whether prefix and suffix match or not Here's the official editorial : link |
|
0
Easy to noticed there are only 2 case of arrangements, RRG and RGB. Use the second one when number of colors "balanced" enough, and the first one to the rest. Then consider if all arrangement is first scenario. So, you have (a[1] + a[2]) triples, and use 2 * (a[1] + a[2]) from the a[0] |
|
0
could you explain what kind of knapsack? |
|
0
Any other solution of E aside the segtree? UPD : sorry i mean E but i wrote D |
|
0
easy to note that we can build palindrome by add same character to begin and end of another palindrome. just consider the case of odd and even length, so we could just check every 2 and 3 consecutive letters |
|
0
Why we cant change 1 to 1000000001 ? In description we can change to any integer we want, not neccessarily <= 10^9 (although the constraint of input is between 1 and 10^9). Am i wrong? |
|
+4
|
|
0
The key is the merging step While merging Shifting can be done by using identity Fn + m = FnFm - 1 + Fn + 1Fm |
|
0
I just realized telescoping series in this sum. Anyway, thanks |
|
0
could you explain this simplification? |
|
+4
\sum_{i=1}^m i * \frac{i^n — (i-1)^n}{m^n}
|
|
+15
could you please explain more? |
|
0
Has matrix-exponent optimizations been included here? |
|
0
That's look like "lazy propagation of colorness", "sum of colorness", and "same color of range" |
|
0
Could someone explain more bout solution using fenwick tree on Div1 C ? Or, specifically, how can we maintain range of color if we dont use segtree? Thanks |
|
+3
Remember a/a is 1. If we have a/b resistance, put one more resistor parallel will give |
|
0
Hmmm chinese contest. Brave yourselves guys!! Actually all we need is bravery :)) |
|
+8
Actually we just need |
|
+8
Clean your code first. Put some spaces and indentations would be enough |
|
0
I'm sure i don't change anything. Also i've changed class to public and still output 4 edit : this code works well in public class http://ideone.com/zZ0l5e |
|
0
I don't have idea why the grader and custom output different. Could someone help me on this? Submission : 6930710 |
|
0
I'll try with the bruteforce one. Since it's very simple Suppose we take first k leftmost items with left hand and -obviously- the rest with right hand. Total cost we make for taking those : sum Of First K Leftmost * L + sum Of First (N-K) Rightmost * R. Bruteforce all possible K and find the minimum cost. Calculate those two sum can use precalc left[n] (sum of K leftmost items) and right[n] (sum of K rightmost items). Then we need to minimize penalty Ql and Qr by taking items alternately (ex: LRLRLRL). As you see we got penalties only when different of taking left and right items |k - (n - k)| > 1. If left taken items more than right ones (ex: LRLRLRLRLLLL), add penalties Ql * (|k - (n - k)| - 1) else add Qr * (|k - (n - k)| - 1) Sorry for bad english. Here the code : solution |
|
0
You may consider using Prim instead, it's easier to write edges back UPD: has been answered above. I didnt mean duplicate comment. sorry :( |
|
0
I'm surprised that C can be solved by bruteforce :O |
|
+3
Ohh nice idea. Thanks a lot |
|
+1
Till max day + 1 of course :)) |
|
0
Notice that answer must be mod by 1e9+7. Some factor may lost within this operation |
|
0
Can someone tell me why this code got TLE? |
|
0
I'm not pretty sure if its called DP or else Suppose we have range If we add one more element from S, supposed to be M. We can update range become After we precalc last component for each X <= sum, we can backtrack the query and find all of components of sum. Sorry for my bad english ^^ Here is my solution if you want to know more |
|
0
How is your dp then? Actually using dp and simple backtrack can run in linear time, should be fast enough |
|
-6
how can you find it? can you tell me please? UPD : why you so rude to me? I just wanna ask for solution :( |
|
+18
I hope there are editorial after contest has ended |
|
0
How do you know that? Are there any differences in these accounts? LOL |
|
0
Someone told that B can be solved in O(N2). Can anyone please explain me about this solution? |
|
+1
Since you didnt use memo, your program can run up to o(k^n) |
|
+1
48 here same as '0'. Read this http://www.asciitable.com/ |
|
0
Nice explanation. You can consider the prefix sum instead of binsearch to make it O(N) |
|
+1
Not really Goldbach conjecture i think. It's just construct minimum prime partition of a swap-range |
|
but i didn't know they had a open contest for intl students too |
|
+3
Try understand this first. I think this should be clear enough http://www.geeksforgeeks.org/dynamic-programming-set-7-coin-change/ |
|
+3
Any editorial? |
|
-8
Tutorual? |
|
0
I think explanation above inspiring enough. |
|
+3
use the counting sort |
|
0
and the other half are worse than usual :( |
|
0
how can it be? can you explain a bit more? |
|
+1
Consider we have dp[msk][last] = amount of min money spent on solving problems chosen on msk with hire maximum first last friends. (msk is bitmask of chosen problems) Then suppose we want to hire the (last + 1)'s friend which cost is dp[msk][last] + cost[last + 1]. If this amount less than dp[msk|solve[last + 1]][last + 1], update it. The answer is minimum of dp[allproblems][k] for all (1<=k<=N) plus cost of monitors required. |
|
-7
Surely it's obvious. Maybe you can fix it for few so that it can be right |
|
0
My greedy approach for D didn't work. Can you tell me why? 6357863 |
|
0
1 2 9 5 with N=1, A=2, B=9, and x1=5 see (2*5)%9 = 1 |
|
0
Try 1 2 9 5 the answer should be 0. But your formula |
|
0
If you use iteration inside |
|
0
For Ediv2 / Cdiv1 i come up with the fact that But still dunno how to make efficient solution with this. Can someone help me? |
|
0
can you tell me how the idea of this? |
|
0
same as mine. try this 1 2 9 5 the answer should be 0 |
|
0
why the answer is 0? still dont get it UPD : okay i understand now |
|
0
as you see |
|
0
well with memo solution above still running in O(N) |
|
0
I'm still wondering in D. Should I submit for every combination of 16 bytes? |
|
+1
You dont have any 't' and 'w' and you can't make 'tttwtqq' with only 'y','q' and 'f' letters |
|
0
Good solution. But i still dont get how to save queries in each element and find the current element? |
|
On
hari862 →
Effective Usage of C++ STL for quick and concise code writing in competitive programming, 12 years ago
0
I see. Since the problem only in range 10^5 using array is more efficient right? I didnt notice this while implementing. Thank you |
|
On
hari862 →
Effective Usage of C++ STL for quick and concise code writing in competitive programming, 12 years ago
0
I also use |
|
0
Is it just me here think that Div2 D is easier than C ? :)) |
|
0
exactly. its been clarified during the contest Problem C. Restore Graph ***** The distance between two vertices is the minimal number of edges in the path between themc |
|
0
your answer is valid if input 5 4 0 1 1 1 2 well, there is no vertex can be in distance 4 if there is no vertex in distance 2 and 3. so there are no answer |
|
+5
Thanks. I'm waiting for it |
|
+3
When the editorial posted then? |
|
0
your 4th vertex has more than 3 edges. It should be 3 or less UPD : okay maybe comment need some correction |
|
0
So complicated way. Why dont you just find the first element of the corresponding element of array and count it? And the constraint is so small only about 1000 first element was able to counted. If there are some element had been in the right order in sequence for a first element most, so its the most probable sequence. Then find differences with corresponding element in array. Just it Here my solution : 6037944 |
|
+2
I didnt really understand the problem and just generate the pattern for C div2... and got AC :v |
|
+9
For problem D can you tell me what 'mask of reshuffle' means? sorry i don't get the solution clearly |
|
0
Just try submit again. It's only temporary |
|
0
luckily in last contest i became specialist. now it's turned back |
| Name |
|---|


