Search found 29 matches

by haaaz
Sat Mar 15, 2008 6:07 pm
Forum: Volume 2 (200-299)
Topic: 216 - Getting in Line
Replies: 57
Views: 24465

I am also getting WA on the new server when I tried to resubmit codes I wrote long time ago... I have tried all sample inputs I found in this forum and I think my program gives the correct outputs. I am just using DFS brute force.... AND most importantly my code got accepted a few years ago on the o...
by haaaz
Fri Oct 17, 2003 4:30 pm
Forum: C++
Topic: g++ problem!?
Replies: 6
Views: 2498

i got into a infinite loop because the statement n%10==0 always evaluates to TRUE. I can't figure out why the value of n can become zero if i enter n as 10, 20 or even 100
by haaaz
Wed Oct 15, 2003 2:31 pm
Forum: C++
Topic: g++ problem!?
Replies: 6
Views: 2498

I forget to clarify a point: I'm using gcc version 3.3.1 (cygming special)
by haaaz
Wed Oct 15, 2003 2:05 pm
Forum: C++
Topic: g++ problem!?
Replies: 6
Views: 2498

g++ problem!?

I want to extract the last two non-zero digits from an int n, using the following code: [cpp]while (n%10 == 0) n /= 10; n %= 100;[/cpp] if i input 26300, the change of value of n is as expected n=26300 n=2630 n=263 n=63 but it doesn't run as expected when the value of n is 10... [cpp]n%10 == 0 [/cpp...
by haaaz
Thu May 22, 2003 3:11 pm
Forum: C++
Topic: About CPU time
Replies: 5
Views: 2712

How about memory usage?
by haaaz
Sat Apr 19, 2003 4:37 pm
Forum: Other words
Topic: acm solve sites
Replies: 51
Views: 25920

I think solutions for most problems should not be provided, it is reasonable to have the number of model soultions limited to 1-20.
by haaaz
Sat Apr 19, 2003 4:26 pm
Forum: C++
Topic: About CPU time
Replies: 5
Views: 2712

About CPU time

How can I know how long my program runs?
Do I have to code myself or I can get such information from my compiler.......?

And how about the memory size a program uses?
by haaaz
Fri Dec 20, 2002 3:21 pm
Forum: Volume 100 (10000-10099)
Topic: 10013 - Super long sums
Replies: 212
Views: 39396

Sorry your algorithm doesn't work.
by haaaz
Sat Nov 16, 2002 2:25 pm
Forum: Volume 100 (10000-10099)
Topic: 10055 - Hashmat the Brave Warrior
Replies: 166
Views: 45878

Why don't you guys simply use double?
by haaaz
Sun Nov 10, 2002 1:35 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 181645

Sorry...What is the input?
159487?
by haaaz
Sun Nov 10, 2002 1:29 pm
Forum: Algorithms
Topic: Another GRAPH problem
Replies: 1
Views: 2170

May I ask a question-what is a graph?
(Sorry I don't understand your problem)
by haaaz
Sun Nov 10, 2002 1:26 pm
Forum: Volume 100 (10000-10099)
Topic: 10055 - Hashmat the Brave Warrior
Replies: 166
Views: 45878

so.... :D
Use real!
by haaaz
Sat Oct 26, 2002 3:15 pm
Forum: Volume 5 (500-599)
Topic: 530 - Binomial Showdown
Replies: 137
Views: 33257

My suggestion:

1. Use double.
2. Multiplies and divides at the same time to reduce run time.
3. nCr(n,r) == nCr(n,n-r)
So make r as large as possible to reduce iteration.

Easy problem, right?
by haaaz
Sat Oct 26, 2002 2:54 pm
Forum: Volume 100 (10000-10099)
Topic: 10070 - Leap Year or Not Leap Year and ...
Replies: 233
Views: 53308

Re: 10070 Output Limit Exceeded

This is my source code for problem 10070. When I ran it on my computer, it worked well when I input a long number. But I got "Output Limit Exceeded" when I submit it. Can anyone help me? [c]#include <stdio.h> #include <string.h> main() { char s[10000]; int y[10000]; //... [/c] Maybe 10000 elements ...
by haaaz
Sat Oct 26, 2002 6:59 am
Forum: Volume 100 (10000-10099)
Topic: 10070 - Leap Year or Not Leap Year and ...
Replies: 233
Views: 53308

Re: me w/a too,help!!!

#include "iostream.h" bool mod11(str year) { int i; i=0; long sum1,sum2; sum1=0; sum2=0; while(i<year.len) { sum1+=(year.base -'0'); i+=2; } i=1; while(i<year.len) { sum2+=(year.base -'0'); i+=2; } if( sum1==sum2 ) return true; return false; } it should be ((sum1-sum2)%11 == 0)

Go to advanced search