## Search found 10 matches

Thu Sep 22, 2005 9:54 pm
Forum: Volume 109 (10900-10999)
Topic: 10902 - Pick-up Sticks
Replies: 24
Views: 12937
I think there are better solutions than O(n^2). One easy thing is to go backwards through the sticks and do something like a sieve. If the actual stick is one of the top stick you try do find the cutting with all of the sticks thrown before. This works in worstcase O(n*nr_of_topsticks) Another possi...
Wed Sep 21, 2005 11:17 pm
Forum: Algorithms
Topic: Geometry Problem...
Replies: 7
Views: 1780
Yes that will work for any number of edges greater than 2
Wed Sep 21, 2005 11:24 am
Forum: Algorithms
Topic: Geometry Problem...
Replies: 7
Views: 1780
Yes, what Krzysztof said is right, you can always create it, if longest edge < sum of the other edges. This was one of the problems of this years Baltic Olympiad of Informatics. One Solution to find such a polygon is to put all the points on a circle and do a binary search over the radius. You can t...
Fri Sep 16, 2005 10:07 am
Forum: Volume 100 (10000-10099)
Topic: 10004 - Bicoloring
Replies: 93
Views: 28115
I think there are some things missing in your code. First you just insert the edge from input [0] to input [1] and not the backedge. In the problemstatement its clearly said that we have nondirectional edges. Another thing is that you go through the nodes by there number. You should do a DFS (or BFS...
Thu Sep 08, 2005 10:44 pm
Forum: Volume 100 (10000-10099)
Topic: 10061 - How many zero's and how many digits ?
Replies: 43
Views: 20691
There is nothing said about the case where N=0,
but I think you can assume that
0! = 1 should be taken and so there are no trailing zeroes and the length is one in every number system...
Mon Jun 13, 2005 11:36 pm
Forum: Volume 100 (10000-10099)
Topic: 10062 - Tell me the frequencies!
Replies: 235
Views: 34260
Hello, i just found out your mistake.
It is really really sad mistake:
In the statement
for i:=33 to 128 do
you should begin with 32, because the first 32 chars are 0..31!!!!

i got your code acc but with PE cause you print a newline after last case.
Mon Jun 13, 2005 7:41 pm
Forum: Volume 100 (10000-10099)
Topic: 10093 - An Easy Problem!
Replies: 52
Views: 14372
I think that there is a problem with your q, because it can easily become very large and so wont fit in a long variabel. So you can after every loop take the mod of q so, instead of q*=base you can use q := q*base mod (base -1) // i am a pascal programmer, so i think it must be (q*base)%(base-1) in ...
Mon Jun 13, 2005 1:51 pm
Forum: Volume 101 (10100-10199)
Topic: 10107 - What is the Median?
Replies: 74
Views: 17695
Also, I usually use readln instead of read but I don't understand why this makes WA! I thought they should work similar in this kind of problem. The problem with using read is, that you dont skip the newline at the end of line. So it doesnt matter while you are somewhere in the input, but when you ...
Fri Jun 10, 2005 6:45 pm
Forum: Volume 100 (10000-10099)
Topic: 10054 - The Necklace
Replies: 62
Views: 30316
and that is right too, especially by better your runtime complexity you can even shorten your program. when you just test if all nodes have odd degree and after that do your solve procedure this is enough. you just have to check weather all edges have been used to create the circle. if not all edges...
Fri Jun 10, 2005 5:37 pm
Forum: Volume 100 (10000-10099)
Topic: 10054 - The Necklace
Replies: 62
Views: 30316
Hello Eduard, this is my first post in board, so you should be very proud, that it trys to help you :wink: i think there is a bug in your prog, the array cv, which stores the eularian circle can become as long as 1000, because you visit one node for every edge. So hence there are 1000 edges you can ...