## Search found 120 matches

Wed Mar 12, 2003 5:21 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 184328
I see your mistake. first: void ReadInput(void) { scan_r = scanf ("%d %d", &i, &j); if (i > j) { long t = j; j = i; i = t; sw = true; } else sw = false; } void WriteResult(void) { if (sw) printf ("%d %d %d\n", j, i, r); else printf ("%d %d %d\n", i, j, r); } for long int you don't write %d, change %...
Wed Mar 12, 2003 7:53 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 184328
try to change your data type from int to long or unsigned long. And you can't swap A to B when A > B.
like that :
100 50
your output must be:
100 50 result
Tue Mar 11, 2003 3:09 pm
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 39579
yeah, evanmars RE didn't mean your solution wrong. Because before I solve this problem My solution get more true I/O, and that means my solution works fine to me too, but I got SIGSEGV. And I check my array and get AC.
Tue Mar 11, 2003 11:23 am
Forum: Volume 100 (10000-10099)
Topic: 10063 - Knuth's Permutation
Replies: 14
Views: 6046
Thanks red scorpion, I know this rule now, and my solution before is WA.
Tue Mar 11, 2003 11:16 am
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 39579
if you got SIGSEGV first you must check your array.
Mon Mar 10, 2003 7:05 pm
Forum: Volume 103 (10300-10399)
Topic: 10346 - Peter's Smokes
Replies: 46
Views: 16168
I think the formula like ans=n+(n-1)/(k-1) is not exactly valid formula but it can get true for this problem because if you use int, long int or another int the number between a<ans<a+1; the result is a. so this formula cannot be simulated by math algo. But I am very appreciate because deddy and his...
Sun Mar 09, 2003 1:52 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 184328
I think your algo to get answer is right, but I think your problem at your input. why you use string for this problem ? you can use this for input:
while(scanf("%ld %ld",&a,&b)==2)
{
...
}
Sat Mar 08, 2003 8:21 pm
Forum: Volume 101 (10100-10199)
Topic: 10110 - Light, more light
Replies: 76
Views: 26220
for this problem you unnecessary to solve by brute force, you can solve this with math. this is the logic: 1. the question only check the last lamp (ON/OFF). 2. you can know it with the factor from the number of last lamp. 3. if sum of factor is odd, the last lamp condition is ON, and when sum of fa...
Sat Mar 08, 2003 12:19 pm
Forum: Volume 101 (10100-10199)
Topic: 10107 - What is the Median?
Replies: 74
Views: 18779
you can test the sample I/O with sample from red scorpion. if you pass for that sample I/O, I think you not get WA, maybe you can get TLE or RE. RE because your array must be 10000 and your TLE because for sorting you use bubble sort. You only need 1 looping (1 for), because after input your data in...
Fri Mar 07, 2003 5:24 pm
Forum: Volume 100 (10000-10099)
Topic: 10042 - Smith Numbers
Replies: 75
Views: 23163
I give special thanks to you dominick. with your hint I got AC now.
I'm very tired with this problem before......

Thanks.....
Fri Mar 07, 2003 5:20 pm
Forum: Volume 100 (10000-10099)
Topic: 10042 - Smith Numbers
Replies: 75
Views: 23163
I give special thanks to you dominick. with your hint I got AC now.
I'm very tired with this problem before......

Thanks.....
Fri Mar 07, 2003 5:05 pm
Forum: Volume 3 (300-399)
Topic: 371 - Ackermann Functions
Replies: 196
Views: 28790
Tanzim, your algo like mine, but I think your TLE because you use Long int for this problem is not corect, because if the odd number like n= 3212345541 3*n+1 can be larger than 2^32 and produce negative result and this is can make looping forever. you can use double and fmod for this problem. I wish...
Fri Mar 07, 2003 4:52 pm
Forum: Volume 100 (10000-10099)
Topic: 10042 - Smith Numbers
Replies: 75
Views: 23163

### 10042

I always got WA for this problem and I don't know where my mistake. can you help me to give me spesial I/O?

Thanks
Fri Mar 07, 2003 11:11 am
Forum: Volume 1 (100-199)
Topic: 113 - Power of Cryptography
Replies: 162
Views: 16236
with long double we can get input more than 100 digit. and the output only a small digit number.
when I try to solved it before, my mind is same like yours, because I forgot about that.
Wed Mar 05, 2003 10:52 am
Forum: Off topic (General chit-chat)
Topic: just test wy new account
Replies: 1
Views: 2202

### just test wy new account

I just test my new account, because I have some trouble with my old account

Thanks
Hisoka......................hehehe