Comments
|
+1
Probably author mispushed Save instead of Save Draft. |
|
+27
|
|
0
You can shuffle yourself using Random, with seed got from time. |
|
+1
More easy is to shuffle data before sorting. But i don’t think simeting like this will hapen often on codeforecs. It’s not very sporting behavior. |
|
0
Any quick sort impelementation with determinate algotrithm of choosing element for partition can be failed to O(N^2) time. Java implementation too. |
|
-10
When iterations where answer exists work immediately, and time-limit cut-off need only for last iteration where no answer exist, there is no need for any optimization.
|
|
+21
In my solution you need only values of
and K! for N ≤ 106 and K ≤ 5000. Both can be calculated with no problem. C(N, K) can be also calced becouse we need them for fixed N and small K. So we can calc them as product of O(K) numbers, with time of K2. |
|
0
No, this error was also on contest, which this problem from. |
|
-5
No, such problems are often apears on TopCoder too.
|
|
0
In this problem letters typed independently.
|
|
0
Fixed.
|
|
0
Yes, it wil be translated tommorow.
|
|
0
Yes.
|
|
+7
It's not N2logn, but N2. And it have very small constant, so it passed. |
|
0
Contest haven't start yet.
|
|
+1
|
|
0
|
|
0
If you lock your code you can't resabmit it. In any other situation you can do it, but the score on this problem wiil be less, becose of time between submitions and 50-points penalty.
|
|
+3
it is both for div 2 and div 1.
|
|
0
Well, I don't know how to solve the problem. The only idea that i have (ans it's enough) to transponate matrix a (solve for matrix simetric to it). There is no test where both sizes are 3*k+2
|
|
0
Maybe you didn't understand what is sum?
sum for i line is: sum[0]=ans[i][0]+ans[i][1] sum[1]=ans[i][0]+ans[i][1]+ans[i][2] sum[2]=ans[i][2]+ans[i][2]+ans[i][3] ... sum[m-2]=ans[i][m-3]+ans[i][m-2]+ans[i][m-1] sum[m-1]=ans[i][m-2]+ans[i][m-1] where ans[i][j] is 1 if there is mine in (i,j) ans 0 if there is no mine ans m is sizeof of line. |
|
+1
a[][] is what you had write.
sum fror third line are {2(4-2),2(6-4),1(6-5),0(3-3),0(1-1)}. Using that we can understand that anser for third line is {1,1,0,0,0}. As for me 1-0 is mor comfortable than X-. so I will use them. Values in brekets are explanations how numbers had been recived. Then Sum for second line is {1(3-2),2(4-2),2(3-1),1(1-0),0(0-0)} and answer is {0,1,1,0,0} Sum for First line is {1(2-1),2(4-2),3(5-2),2(3-1),1(1-0)} ans answer is {0,1,1,1,0} So answer for all test is 01110 01100 11000. |
|
+1
Oh, there is an error. We should not count prexix sums. We shoud count sums of connected bloks of 3 cells.
|
|
+1
I had 100 on this problem.
My solution is iterative. Firstly we should know how to solve this problem when m=1. It's not difficult. Mines' location uniquely determined by the presence of mines in the first cell. Second we should understand how to calc sum of third line prefixes. sum[i]=a[i][1]-a[i][0]. Indexes are 0-based. a is array with mines number and sum is number of mines neer ith position in third line. Now we can find mines position in third line. Using this idea we can find positions of mines in line with 0-based 3*k+2 lines for all k. If the last of these lines is last or there is only one line after it we can find location in other lines using this idea. If there are too lines after last line we can use it for columns instead of rows. And there is no tests when algorithm don't work both on rows and columns. Sorry for my bad english. |
|
0
In Wiindows version of g++(MinGW) you should use %I64d not %lld for reading and writing long longs.
|
|
0
Про уведомление вообще впервые слышу и никогда не замечал. по поводу почты я, например, всегда отключаю сразу все уведомления( может кроме как соревнованиях). Хотя в принципе нужно просто быть внимательнее.
|
|
0
А еще было бы удобно если бы показывалось что у тебя есть сообщения (окошко выплывало, просто циферка стояла рядом или что-то еще такое). А то можно очень долго ждать ответа на сообщение.
|
|
0
Of course firstly i mae them smaller. the absolute value are not necessary. So you can say that malist value is 1, next is 2 and etc. So values should be not more 5x105.
|
|
+4
I have sorted by first parametr and then make rmq where indexes were second parametr and value is third. Becouse of stecific rmq request you can use Fenvik tree insted of interval tree and I have done it.
But i saw tthat some submited solutions are more easy. |
|
0
your problems was with erase 0 or something like that.
|




and