Latest DMOJ Commentshttps://dmoj.ca/2017-09-21T13:34:03+00:00The latest comments on the DMOJ: Modern Online Judge websitewleung_bvg -> CCC '17 S5 - RMT2017-09-21T13:34:03+00:002017-09-21T13:34:03+00:00https://dmoj.ca/problem/ccc17s5#comment-5909<p>Well since \(N \leq 150000\) and \(Q \leq 150000\), \(Q\) updates taking \(N\) time would result in at least \(2e10\) operations per second in the worst case, and would almost certainly TLE.</p>
AceWrecke -> CCC '04 J1 - Squares2017-09-21T13:08:02+00:002017-09-21T13:08:02+00:00https://dmoj.ca/problem/ccc04j1#comment-5908<p>Ok I didn't look at the output properly. Thanks!</p>
Ninjaclasher -> CCC '17 S5 - RMT2017-09-21T12:44:44+00:002017-09-21T12:44:44+00:00https://dmoj.ca/problem/ccc17s5#comment-5906<div><h4>Hint that's not really a hint</h4>
<p>Before I waste hours on a solution that doesn't even work...... will a solution with O(N) query and O(1) update work?</p>
</div>Healingnoob -> CCC '04 J1 - Squares2017-09-21T03:17:23+00:002017-09-21T03:17:23+00:00https://dmoj.ca/problem/ccc04j1#comment-5905<p>Look carefully at the Sample Output. It does not output <em>only an integer.</em></p>
Infernape77 -> ECOO '12 R2 P2 - Password Strength2017-09-20T16:37:30+00:002017-09-20T16:37:30+00:00https://dmoj.ca/problem/ecoo12r2p2#comment-5904<p>howdy</p>
Evan_Yu123 -> ECOO '12 R2 P2 - Password Strength2017-09-20T16:36:07+00:002017-09-20T16:36:07+00:00https://dmoj.ca/problem/ecoo12r2p2#comment-5903<p>Greetings</p>
kobortor -> TSS Club Fair 2017 Problem A2017-09-20T16:13:54+00:002017-09-20T16:13:54+00:00https://dmoj.ca/problem/tss17a#comment-5902<p>Lollipops will be given at the first computer club meeting to those who solved the problem.</p>
Ninjaclasher -> A Plus B (Hard)2017-09-20T16:06:19+00:002017-09-20T16:06:19+00:00https://dmoj.ca/problem/aplusb2#comment-5901<p>Fixed that, but there's still something wrong with the output..... Any suggestions?</p>
TheZombieCloud -> ECOO '12 R2 P2 - Password Strength2017-09-20T15:04:07+00:002017-09-20T15:04:07+00:00https://dmoj.ca/problem/ecoo12r2p2#comment-5900<p>Thx</p>
Roynaruto -> TSS Club Fair 2017 Problem A2017-09-20T14:08:29+00:002017-09-20T14:08:29+00:00https://dmoj.ca/problem/tss17a#comment-5899<p>I need the lollipop pls</p>
AceWrecke -> CCC '04 J1 - Squares2017-09-20T13:55:36+00:002017-09-20T13:55:36+00:00https://dmoj.ca/problem/ccc04j1#comment-5898<div><p>what is wrong with my code(python 3)?</p>
<p>-snip-</p>
</div>Infernape77 -> ECOO '12 R2 P2 - Password Strength2017-09-20T03:40:56+00:002017-09-20T03:40:56+00:00https://dmoj.ca/problem/ecoo12r2p2#comment-5897<p>hi</p>
aeternalis1 -> A Plus B (Hard)2017-09-20T02:20:04+00:002017-09-20T02:20:04+00:00https://dmoj.ca/problem/aplusb2#comment-5896<p>If you look at your output for test case 6 (on your most recent submission), there is a leading zero after the negative. Get rid of that.</p>
Ninjaclasher -> A Plus B (Hard)2017-09-20T01:01:32+00:002017-09-20T01:01:32+00:00https://dmoj.ca/problem/aplusb2#comment-5895<p>Code is correct, output compares correctly, still WAs. Anyone have any idea why?</p>
anasschoukri2 -> Uneven Sand2017-09-17T19:04:30+00:002017-09-17T19:04:30+00:00https://dmoj.ca/problem/seed2#comment-5893<p>update : it s ok
hehe :p</p>
Xue_Alex -> CCC '09 S1 - Cool Numbers2017-09-16T13:29:59+00:002017-09-16T13:29:59+00:00https://dmoj.ca/problem/ccc09s1#comment-5892<p><a href="https://dmoj.ca/about/codes/">https://dmoj.ca/about/codes/</a></p>
1419903188 -> CCC '09 S1 - Cool Numbers2017-09-16T01:36:05+00:002017-09-16T01:36:05+00:00https://dmoj.ca/problem/ccc09s1#comment-5891<p>wut does RTE mean?</p>
bqi343 -> Back to School '172017-09-16T01:15:23+00:002017-09-16T01:15:23+00:00https://dmoj.ca/contest/bts17#comment-5890<div><p>P8 Outline (d):</p>
<p>First, create a digit retrieval system with O(N) memory. Given the i'th number and jth MSD (most significant digit), you can get the digit in O(log N). Next, form a list of 2^19 numbers. 2^19 is too big, so make the remaining missing numbers equal to the last number. then calculate the answer for this list of numbers and delete a suffix to get the final answer. Another way is to just make all the remaining missing numbers have length 0.</p>
<p>After doing this, form a segment tree which stores the length of the shortest number in this segment range; call this the value of the segment. Now for each segment, let u be the value of parent segment, and v be the value of this segment. If the segment is the root, use u=0. You want to add all of the digits in the rectangle defined by</p>
<p>(all of the numbers in this segment) * ((u+1)'th MSD ... v'th MSD) to the answer array.</p>
<p>Notice that digits u+1 to v are the same for all of the numbers in the segment, and also, v-u is bounded by the length of the segment (because the length changes by at most 1 each time). Then it is possible to perform multiplication in O((segment length) log (segment length)) to get all of the integers to add to the answer array, using Number Theoretic Transform.</p>
<p>After getting the answer array, do a bit of carrying and print the answer. The overall runtime is O(N log^2 N).</p>
</div>aeternalis1 -> Kirito2017-09-15T20:19:50+00:002017-09-15T20:19:50+00:00https://dmoj.ca/problem/mmcc14p2#comment-5889<p>Yes, since JeffreyXiao has an AC solution in java.</p>
Ninjaclasher -> Inaho2017-09-15T17:07:52+00:002017-09-15T17:07:52+00:00https://dmoj.ca/problem/mmcc15p1#comment-5888<p>Question: Can an edge be added between U and V twice?</p>
Pleedoh -> A Plus B (Hard)2017-09-15T15:06:42+00:002017-09-15T15:06:42+00:00https://dmoj.ca/problem/aplusb2#comment-5887<p>No</p>
aeternalis1 -> A Plus B (Hard)2017-09-15T12:07:24+00:002017-09-15T12:07:24+00:00https://dmoj.ca/problem/aplusb2#comment-5886<p>Can the two integers have leading zeros?</p>
Roynaruto -> Kirito2017-09-15T01:36:38+00:002017-09-15T01:36:38+00:00https://dmoj.ca/problem/mmcc14p2#comment-5885<p>hm is this possible in java</p>
Cueball1234 -> Back to School '172017-09-14T18:26:27+00:002017-09-14T18:26:27+00:00https://dmoj.ca/contest/bts17#comment-5884<p>Ah I see, thank you so much for all your help!</p>
maxhflow -> Back to School '172017-09-14T01:12:44+00:002017-09-14T01:12:44+00:00https://dmoj.ca/contest/bts17#comment-5883<div><p>The line of reasoning goes like this. The distances to the target will form two ascending/descending sequences as the path approaches the target bifurcation, and then goes past it. We can update our HLD by keeping an arithmetic progression segment tree at each HLD chain. This lets us update any range of our HLD chain by addition of an arithmetic progression. This means we can update any node by doing at most 2 (2 in the case where the target bifurcation is in a chain, 1 in all other cases) range update operations. Also, there are at most \(O(\log n)\) chains. Hence, we need to do only \(O(\log^2 n)\) work to update every node in the path.</p>
<p>In short, you can update an entire sub-range of a HLD chain efficiently with a segment tree that supports range updates. This means we don't need to do some operation for each node in a path.</p>
</div>