Search found 12 matches

by Daniel Chia
Fri Aug 15, 2003 8:29 am
Forum: Algorithms
Topic: Help about MAX Flow
Replies: 8
Views: 4478

Problem 10030 can be solved by max flow.
by Daniel Chia
Sat Aug 02, 2003 3:55 am
Forum: Volume 101 (10100-10199)
Topic: 10198 - Counting
Replies: 30
Views: 17145

This might be a little late, but i just thought i'll try and explain his algo.. let f(n) denote the no of ways to make numbers with the sum n. The number of ways to make n is the same as the number of ways to make n-1 + no of ways to make n-2 + no of ways to make + no of ways to make n-3 + no of way...
by Daniel Chia
Tue Dec 31, 2002 4:39 am
Forum: Other words
Topic: Problems Solved
Replies: 2
Views: 1054

Problems Solved

It seems that the number of problems solved has dropped for almost everyone? Or is it just me?
by Daniel Chia
Sun Oct 06, 2002 4:08 pm
Forum: C
Topic: about output of floating point numbers
Replies: 7
Views: 3685

not sure how accurate this is, but u can get pi by using
[c]
2*acos(0);
[/c]

My -1 cents.
by Daniel Chia
Fri Oct 04, 2002 2:28 pm
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 29159

Correct me if i'm wrong but 195 has both upper case and lower case.
Your sort function ( or what i managed to make out ) only handles upper case letters
by Daniel Chia
Wed Oct 02, 2002 12:39 pm
Forum: Volume 102 (10200-10299)
Topic: 10200 - Prime Time
Replies: 202
Views: 64200

Not the fastest method, but will get a accepted.

Your code will get accepted with slight modifications. The main redundancy there is repeatedly checking certain n. for example, the input set 0 300 0 10000 will regenerate all the numbers from 0 to 300. As such, you should pre-generate and check for primality all the numbers. After which, just loop ...
by Daniel Chia
Mon Sep 30, 2002 3:05 pm
Forum: Volume 3 (300-399)
Topic: 371 - Ackermann Functions
Replies: 196
Views: 30929

I got AC

Actually, the method is sufficient for this problem. Although there is a faster method, which must be used in qn 100.
It turns out that certain points of the computation exceeds the capacity of long int :)
by Daniel Chia
Sat Sep 28, 2002 4:17 pm
Forum: Other words
Topic: ( to Judge ) Flooding the server
Replies: 6
Views: 2817

Nan

The problem no was 836. I sumbitted the problem while the judge was being flooded.
I checked my mail after and hour or so and it said i got nan time. As such i can't tell what the status showed.

The last referred to the last post i saw about nan.
by Daniel Chia
Sat Sep 28, 2002 1:29 pm
Forum: Other words
Topic: ( to Judge ) Flooding the server
Replies: 6
Views: 2817

I agree

Its really digusting that people take advantage of this free OJ that people have put alot of work into. To think that person flooded the judge with TLE entries is a sad thought. On another note, maybe related to the high volume of submission, my program ran in "nan" time. I read about the problem, b...
by Daniel Chia
Sun Aug 04, 2002 2:01 pm
Forum: Volume 1 (100-199)
Topic: 113 - Power of Cryptography
Replies: 163
Views: 18482

i get the same problem :( and btw..as far as my measly knowledge of c++ is concerned... setprecisio(0) sets it back to the default of infinite precision, no?
by Daniel Chia
Fri Aug 02, 2002 4:29 pm
Forum: Volume 4 (400-499)
Topic: 400 - Unix ls
Replies: 93
Views: 18640

the following code gets WA. any help would be appreciated :D [c]#include <stdio.h> #include <string.h> #include <stdlib.h> char input[100][100]; int sort_function( const void *a, const void *b); int main() { int a,b,c,d,e,f,g,h,i,n; while (scanf("%d%*c", &n) == 1) { for (i=0; i< n; i++) { gets(input...
by Daniel Chia
Wed Jul 31, 2002 4:37 pm
Forum: Volume 3 (300-399)
Topic: 371 - Ackermann Functions
Replies: 196
Views: 30929

Could someone look my code over and kindly tell me y WA?

[c]#include <stdio.h> int main() { long l,h,v, i,e,t,c; scanf("%ld %ld", &l,&h); while((l != 0) && (h != 0)) { if (l > h) { v = l; l = h; h = v; } v = 0; for (i =l; i<=h; i++) { e = i; t = 0; do { if ( e % 2 ==0 ) e /= 2; else e = e*3 +1; t++; } while ( e != 1); if (t > v) { v = t; c = i; } } printf...

Go to advanced search