Search found 12 matches
- Sat Feb 22, 2003 7:39 pm
- Forum: Algorithms
- Topic: How can I use a bit to store a boolean value in C?
- Replies: 3
- Views: 2895
- Tue Oct 22, 2002 4:31 pm
- Forum: Other words
- Topic: help needed: matrix chain multiplication (reversed!)
- Replies: 0
- Views: 1688
help needed: matrix chain multiplication (reversed!)
To calculate an optimal solution for matrix chain multiplication we have to make two tables : one for the cost ('m' table) and other one to take the point where to break ('s' table).
Now given a sequence of matrix we can easily calculate an optimal solution.
Now the question is that:
If we are ...
Now given a sequence of matrix we can easily calculate an optimal solution.
Now the question is that:
If we are ...
- Tue Sep 10, 2002 5:28 am
- Forum: C
- Topic: Round up float value
- Replies: 5
- Views: 3669
Code: Select all
char str[100];
sprintf(str,"%.2f",a);
a=atof(str);
// be sure u're not using Turbo C++.The atof function in it has bugs.
// u can write a subroutine also that does the same thing life atof.
- Wed Aug 07, 2002 5:27 pm
- Forum: Volume 1 (100-199)
- Topic: 160 - Factors and Factorials
- Replies: 205
- Views: 45123
- Wed Jul 31, 2002 9:24 pm
- Forum: Volume 3 (300-399)
- Topic: 389 - Basically Speaking
- Replies: 94
- Views: 36431
- Wed Jul 31, 2002 6:34 am
- Forum: Volume 3 (300-399)
- Topic: 389 - Basically Speaking
- Replies: 94
- Views: 36431
Hellow.......anyone alive to help me on 389
PLease help me:(
- Mon Jul 29, 2002 7:10 am
- Forum: Volume 3 (300-399)
- Topic: 389 - Basically Speaking
- Replies: 94
- Views: 36431
- Sun Jul 28, 2002 8:24 pm
- Forum: Volume 3 (300-399)
- Topic: 389 - Basically Speaking
- Replies: 94
- Views: 36431
389 - Basically Speaking
Why does my program give WA again and again and again.......
/* @JUDGE_ID:XXXXXX 389 C++ */
#include<stdio.h>
#include<string.h>
#include<ctype.h>
char str[100];
long from,to;
long num;
long power(long b,long n)
{
long i,p=1;
for(i=0;i<n;i++)
p=p*b;
return p;
}
void str_rev(char *s ...
/* @JUDGE_ID:XXXXXX 389 C++ */
#include<stdio.h>
#include<string.h>
#include<ctype.h>
char str[100];
long from,to;
long num;
long power(long b,long n)
{
long i,p=1;
for(i=0;i<n;i++)
p=p*b;
return p;
}
void str_rev(char *s ...
- Sun Jul 28, 2002 5:01 pm
- Forum: Volume 4 (400-499)
- Topic: 412 - Pi
- Replies: 104
- Views: 30222
- Mon Jul 22, 2002 3:02 pm
- Forum: Volume 1 (100-199)
- Topic: 160 - Factors and Factorials
- Replies: 205
- Views: 45123
- Fri Jul 19, 2002 7:17 pm
- Forum: Volume 1 (100-199)
- Topic: 160 - Factors and Factorials
- Replies: 205
- Views: 45123
- Fri Jul 19, 2002 6:37 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 317808
Fix the input taking part
There's nothing wrong in the logic..but the way of taking input is not right.
change the code of taking input :
replace the lines -> while(!feof(stdin))
and -> scanf("%d%d",&min,&max)
write it in the following way:
while(2==scanf("%d%d",&min,&max))
and your program will get accepted.
change the code of taking input :
replace the lines -> while(!feof(stdin))
and -> scanf("%d%d",&min,&max)
write it in the following way:
while(2==scanf("%d%d",&min,&max))
and your program will get accepted.