Comments
|
+13
Nope. Your post was written in russian. I like SP too :) |
|
+3
|
|
+15
i don’t know what’s wrong with that test, but i think there is another WA test: abcde cde cd correct answer is 0 |
|
+15
“Substrings are different if and only if their contents aren’t equal, their positions of occurence don’t matter.” You are comparing length of this substrings. Use hachcodes. |
|
+18
They just don’t like google ;) Also, there are people who love -’s. Forget it, contribution is not important, a good post is more valuable for people than all of these contribution ratings. |
|
0
TL 22 Comparer checks distance, not the vertex. For example, pairs (fst=1,snd=5) and (fst=1,snd=6) are equal. SortedList uses comparer and removes first element with same "fst" value. I fixed it and got TL 22. |
|
0
Grundy function usually takes small values. Initilize vector M[v] with 10 elements and then enlarge it if necessary. |
|
+8
Your solution fails if R/2 < r < R.
|
|
+3
O(n*n) if all points belong to the hull.
|
|
+8
6
0 10 10 0 20 10 10 20 1 7 6 1 all points in the hull. |
|
+19
6
0 4 4 0 8 4 4 8 1 2 1 1 1 2 is not in the hull. |
|
0
e-maxx has a site with algorithms, but it's on russian: http://translate.google.ru/translate?sl=ru&tl=en&js=n&prev=_t&hl=ru&ie=UTF-8&layout=2&eotf=1&u=http%3A%2F%2Fe-maxx.ru%2Falgo%2F&act=url |
|
+1
I wonder, if there is any person on codeforeces who has a relative with access to the military archives. I don't know where to search, i think that social networks are useless - too many people with the same last name.
|
|
On Sayakiss →
The root of ax+by=c given by Extended Euclidean algorithm is always smaller(or equal) than max(abs(a),abs(b))?, 8 months ago
0
It's for c=0; in other cases it will fail. You should use max(abs(x-c/b), abs(y)), for example ) |
|
0
So you know maxflow algorithm. 1. Find the path 2. Increase flow through it 3. Repeat For a weighted graph: 1. Find the SHORTEST path ... Don't forget about back edges - they have negative weight. Is there a problem with understanding how to solve biparate a matching without weights using maxflow? |
|
0
For me maxflow is easier, for you it might be hungarian. Anyway , maxflow is more useful, there are many problems that can be solved by it.
|
|
0
Do you know how to solve biparate matching without weights with maxflow algorithm?
|
|
0
gla
|
|
0
Write a TCL script :)
|
|
+1
Thanks to you now we know io :)
|
|
+11
Free Pascal :)
|
|
+11
n = (n - (n%10)) / 10
|
|
+3
Nice round! Unfortunately, i was late by 40 minutes. Everyone, you must see my solution for D :) http://www.iolanguage.com/paste/p/40c888e58.html |
|
0
Yes
|
|
+50
Petr wins
|
|
+1
That's the point - to learn new language during contest time : - )
|
|
0
Special for equation problems like "3+4-7"
|
|
0
Taylor Reece I AM DONE WITH THIS CRAP! Input files for chess2 DO NOT match the example. There was no way to parse the input file I received and push it out into something readable. 2 hours down the drain, again!
|
|
0
negative numbers.
ans = (2*ans - n)%mod in my case, victim wrote if (ans<0) ans+=n; instead of ans+=mod; |
|
0
i hacked one guy with that test too :)
|
|
+1
try this test:
AXAAA AAAXA replace"A" with dots my answer is 2.62500000 |
|
0
Find 4 points: min by x - y, min by x + y, max by x - y, max by x + y. Convex hull is a rhombus, the answer is max(x + y) - min(x + y) + max(x - y) - min(x - y).
I thought about octagon at the contest and used 8 points. |
|
+1
Assume D = GCD(N, M)
Waiting time of starship is a divisor of D, because it is always linear combination of N and M. Assume waiting time of i-th starship is ai. ai + 1 = ( - i * M)modN, a0 = aN = 0, , so the sequence is linear and has a period. The answer is an average value of one period of the sequence. D = x * N + y * M for some x, y (extended euclidian algorithm ), so ay = N - D, hence every k * D , 0 < = k * D < N is found in the sequence. The answer is average of k * D where 0 < = k * D < N which is (N - D) / 2.0 |
|
0
Test
|
|
0
Eclipse for Java
|
|
0
In case of W>=2 and N>=2 solution always exist. |
|
+1
i replaced your detCh function with mine:
char detCh(int i, int j){ return (char)((i+5*j)%26 + 'a'); } and received AC. you should check all neibours in 5x5 square :) |
|
On weiqi →
why problem C is PE at test 5(Codeforces Beta Round #26 (Codeforces format))?, 21 month(s) ago
+4
Oops, it's my fault :)
Your program writes in output symbol with code 1. flag[n-1][i]=1; Replace it with (char)('y'+(i/2%2)) and you will get WA test 21. Add a case m==0 (mm==1) in the code and you will get AC :) |
|
0
|
|
+17
Topcoder SRM often starts at 5AM MSK. That is our revenge :)
|
|
+1
new Thread(null, new Sample(), "1", 1<<23).start(); - 8 megabytes stack.
|
|
0
forget it. Found a bug :)
|
|
0
I mistaken, that's other test. What is test case #9?
|
|
0
Empty cycle of length 0 is bad thing (test 9, problem D).
|
|
0
cool :)
|
|
0
phi(c) is divisible by phi(c2) and phi(c1)
|
|
+11
b1 = b mod C
if n is less than 1000 then n1 = n; else n1 = n mod phi(c) + 10 * phi( c ); answer is b1^n1 mod C |
|
0
![]() |
|
0
Offtopic:
The solution for this problem is simple: modified Z-algorithm. |
|
0
(shift+4)\frac{x}{y}(shift+4)
|
|
0
oops..
![]() ![]() |
|
0
frac{x}{y} = 3
frac{x}{y} = 3 for example. |
|
0
You can use TeX for the mathematical formulas.
|
|
Hello. I'm Jedi_Knight, you know me from topcoder :)
|






