## Search found 63 matches

Sun Aug 13, 2006 6:07 pm
Forum: Volume 110 (11000-11099)
Topic: 11064 - Number Theory
Replies: 25
Views: 16207
This is how I am calculating the prime numbers.. //Here n is the number for which I am trying to find the primestwhile(x!=0) { while(x%y!=0 && y<x) y++; if (y>x || y==n) break; totient *= ((double)y-1.0)/(double)y; while(x%y==0) x=x/y; } For Example, a number say 84...the sequence it run thru is......
Sun Jun 04, 2006 6:21 pm
Forum: Volume 110 (11000-11099)
Topic: 11043 - Fast and Easy Data Compressor
Replies: 5
Views: 2157
Your runtime error can be due to the fact that you are using char instead of unsigned char. Btw, Carriage return is '\n' like. I have got ac thanks to Emilio your hint make me think about negtive value :P hello , why char 's value can be negtive ? how does judge input char with negtive ascii value ?
Sun Jun 04, 2006 5:10 pm
Forum: Volume 110 (11000-11099)
Topic: 11045 - My T-shirt suits me
Replies: 18
Views: 10324

### Re: 11045 How to solve?

Ankur Jaiswal wrote:What is the approach to solve this problem??
Is it simple backtracking or is there some trick?
People have solved it in very less time.
So i guess there might be some trick.
there is no trick in this problem .
Sun Jun 04, 2006 3:00 pm
Forum: Volume 110 (11000-11099)
Topic: 11043 - Fast and Easy Data Compressor
Replies: 5
Views: 2157

### 11043 - Fast and Easy Data Compressor

I ' m getting RunTimeError .

Can someone give me some test cases ?
btw , what is " carriage return"
thanks
Wed May 31, 2006 8:14 am
Forum: Volume 110 (11000-11099)
Topic: 11038 - How Many O's?
Replies: 24
Views: 10422
mamun wrote:Can you use %I64d? Use %lld instead.
thanks
I use "%lld" and get ac now !
Wed May 31, 2006 7:03 am
Forum: Volume 110 (11000-11099)
Topic: 11038 - How Many O's?
Replies: 24
Views: 10422
hi , I have solved this prob , and I use cin as input way Why if I use "scanf ( "%lld %lld" , &n , &m ) and scanf ( "%I64d , %I64d" , &n , &m )" , I get tle I have used the scanf to read the input, too, but without any problem with the time limit. Just make sure not to write the colon in "%I64d , %...
Tue May 30, 2006 4:42 pm
Forum: Volume 110 (11000-11099)
Topic: 11038 - How Many O's?
Replies: 24
Views: 10422
hi , I have solved this prob , and I use cin as input way

Why if I use
"scanf ( "%lld %lld" , &n , &m ) and scanf ( "%I64d , %I64d" , &n , &m )"
, I get tle

thanks
Sun May 14, 2006 3:54 pm
Forum: Volume 110 (11000-11099)
Replies: 43
Views: 16851

Hello, everybody!!! How to solve this problem? I think that we can optimize function fun(int a) by replacing line: for(i=1; i<=a; i++){ to for(i=max(1, a-100); i<=a; i++){ But what to do with fun(int a, int b) ??? Thanks, bye! hi ...... your fun function to find "a input number" is almost the same ...
Sat Dec 31, 2005 2:14 pm
Forum: Volume 109 (10900-10999)
Topic: 10973 - Triangle Counting
Replies: 31
Views: 13375
Moha wrote:What is your problem? WA or TLE?
the worst case for TLE is a bipartit graph. it has no triangle.
you can write a generator for this kind of input.
sorry , I got wa , I think my method won't get tle
Sat Dec 31, 2005 1:41 pm
Forum: Volume 109 (10900-10999)
Topic: 10973 - Triangle Counting
Replies: 31
Views: 13375
Adrian Kuegel wrote:Your for-loops should go up to n, not to m.
Btw, you will get TLE with your method.
Can someone give some test cases , thanks .
I can't find my error
Wed Dec 07, 2005 6:16 pm
Forum: Volume 109 (10900-10999)
Topic: 10905 - Children's Game
Replies: 66
Views: 25813
hi ...........

if(n==yl)
{
for(t=0;n<xl;n++,t++)
if(x[0+t]<x[n]) return 1;
else if(x[0+t]==x[n]) continue;
else return 0;
return 1 ;
}
Sat Nov 05, 2005 1:56 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 184416

### Re: a problem with 3n+1

you have too many error in your code
Can your compiler compile it successfully ?
Sun Oct 30, 2005 1:14 pm
Forum: Volume 109 (10900-10999)
Replies: 80
Views: 27969
tywok wrote:Also you can use multiset
thank you
Sun Oct 30, 2005 7:55 am
Forum: Volume 109 (10900-10999)