Search found 143 matches

by angga888
Tue Jun 15, 2004 5:51 pm
Forum: Volume 106 (10600-10699)
Topic: 10663 - Non-Powerful Subsets
Replies: 27
Views: 7037

Your output is same compared with mine. is there any tricky cases? Not tricky ones, but you can try... :wink: Input: 999 999 100 1000 200 1000 300 1000 400 1000 500 1000 Output: 999 101 102 103 104 105 106 143 145 147 249 200 201 202 203 204 205 206 242 258 402 300 301 302 303 304 305 306 326 327 40...
by angga888
Tue Jun 15, 2004 12:39 pm
Forum: Algorithms
Topic: A Game - Usaco Sec 3 problem
Replies: 2
Views: 1428

Re: A Game - Usaco Sec 3 problem

i'm trying to solve this problem, but i don't understand what is mean by optimal strategy. is this mean player 2 always choose largest number that can be pick? If I remembered correctly the answer for your question is NO. Player can also choose the smaller number if it will give him/her better resu...
by angga888
Sat Jun 12, 2004 11:27 am
Forum: Volume 101 (10100-10199)
Topic: 10192 - Vacation
Replies: 58
Views: 14898

No............ I still got WA............................>.< So strange... :-? I have modified your program and submitted it. It got AC. This is the only change in your program: [pascal]var a,b:string; cost:array[0..2000,0..2000] of longint; i,j,k,n:longint; begin k:=0; while not eof(input) do begi...
by angga888
Sat Jun 12, 2004 10:50 am
Forum: Volume 101 (10100-10199)
Topic: 10192 - Vacation
Replies: 58
Views: 14898

Oops... :o I forgot to tell you about the array.
The index should start from 0.
[pascal]cost:array[0..2000,0..2000] of longint;[/pascal]
Btw, 2000 is too big, isn't it?

Now it should be AC :D
by angga888
Sat Jun 12, 2004 8:42 am
Forum: Volume 101 (10100-10199)
Topic: 10192 - Vacation
Replies: 58
Views: 14898

Your algorithm seems ok, maybe you can try this:
[pascal]while not eof(input) do
begin
...
readln(a);
if a='#' then exit;
readln(b);
...
end;[/pascal]
Hope it helps :wink:
by angga888
Sat Jun 12, 2004 5:54 am
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 27856

Hi, samueljj
In this problem we must assume that 'A'<'a'<'B'<'b'.
by angga888
Sat Jun 12, 2004 5:26 am
Forum: Volume 104 (10400-10499)
Topic: 10405 - Longest Common Subsequence
Replies: 103
Views: 30114

You can change the way you read the input:
[cpp]while ( cin.getline( s1, 1001) ){
cin.getline( s2, 1001 );
...
}[/cpp]
Hope it helps :wink:
by angga888
Sat Jun 12, 2004 4:46 am
Forum: Volume 104 (10400-10499)
Topic: 10405 - Longest Common Subsequence
Replies: 103
Views: 30114

it's very surprising that even after allocating a 1000 X 1000 array at compile time, the judge shows that my code runs in 64k..
I don't know either. If your program runs fast, usually the memory will become only 64k. :o
by angga888
Fri Jun 11, 2004 8:49 pm
Forum: C
Topic: arctan() and abs() functions
Replies: 4
Views: 2343

And also you can find everything on the Help menu. :wink:
by angga888
Fri Jun 11, 2004 8:48 pm
Forum: C
Topic: arctan() and abs() functions
Replies: 4
Views: 2343

Re: arctan() and abs() functions

lobow wrote:Hi! I have to use these fuctions arctan() and abs() but the compiler didnt find it in math.h .
Are you sure? arctan() -> atan()
My C compiler support those functions.
by angga888
Fri Jun 11, 2004 6:21 pm
Forum: Volume 106 (10600-10699)
Topic: 10609 - Fractal
Replies: 20
Views: 6208

More questions post me via PM. 8)
by angga888
Fri Jun 11, 2004 4:45 pm
Forum: Volume 101 (10100-10199)
Topic: 10147 - Highways
Replies: 67
Views: 21037

Also I don't understand how can I assume more vertices (cities) as one vertex you can assume more than one cities as one vertex. Let me continue my example: vertex 1 : 1 2 3 vertex 2 : 7 9 vertex 3 : 4 vertex 4 : 5 vertex 5 : 6 vertex 6 : 8 Assume that dis[city1][city2] is the cartesian distance be...
by angga888
Fri Jun 11, 2004 4:06 pm
Forum: Volume 6 (600-699)
Topic: 680 - Movement of Reading Head
Replies: 4
Views: 2239

Hi,
I haven't test your code, but I have an input.
Have you consider for k=1 (only one file) ?
Try this input.

Input

Code: Select all

1 5 5 5 2
Output

Code: Select all

4
The output is not 0.

Hope this helps. :wink:


Anggakusuma
by angga888
Fri Jun 11, 2004 4:01 pm
Forum: Volume 106 (10600-10699)
Topic: 10609 - Fractal
Replies: 20
Views: 6208

lobow wrote:The only thing that may be wrong then its the midpoint. What formula did you use to find it? I used (A+B)/2, maybe it is wrong.
Yes, same with mine. :wink:
by angga888
Fri Jun 11, 2004 8:18 am
Forum: Volume 106 (10600-10699)
Topic: 10609 - Fractal
Replies: 20
Views: 6208

the result x' and y' will be the valors of C. is it right? I don't really understand your algo. I interpret your steps this way: Assume we want to build an equilateral triangle ABC. Now, we only know two points (A and B) and going to find the third one (point C). Let's take an example: the coordina...

Go to advanced search