Search found 3 matches
- Mon Jul 21, 2008 12:28 pm
- Forum: Volume 2 (200-299)
- Topic: 294 - Divisors
- Replies: 91
- Views: 39717
294-Divisors #RTE. Please help
I could not understand why is it runtime error. Please help me.
/*Run Time error.*/
#include<stdio.h>
#define n 400000
long long prime[n];
long long prime_factor(long m)
{
long long i,j,fact,div,sum;
div = 1;
sum =0;
j = i = 2;
fact = m;
while(1)
{
if(i>j)
{
div = div*(sum+1 ...
- Tue Jul 15, 2008 2:46 am
- Forum: Volume 4 (400-499)
- Topic: 445 - Marvelous Mazes
- Replies: 93
- Views: 22101
445 - Marvelous Mazes #WA! Please help me.
I tried this problem for several time but still getting WA. Could you please help me?
#include<stdio.h>
#include<string.h>
int main()
{
char str[500];
int i,j,val=0;
int len,flag =0;
while(gets(str)!=NULL)
{
//printf("\n");
len = strlen(str);
if(len==0)
{
printf("\n");
continue ...
#include<stdio.h>
#include<string.h>
int main()
{
char str[500];
int i,j,val=0;
int len,flag =0;
while(gets(str)!=NULL)
{
//printf("\n");
len = strlen(str);
if(len==0)
{
printf("\n");
continue ...
- Fri Jul 11, 2008 4:35 pm
- Forum: Volume 3 (300-399)
- Topic: 371 - Ackermann Functions
- Replies: 196
- Views: 51368
371 - Ackermann Functions #TLE. Please Help!
Please help me. I found the TLE. Please help me to solve the problem.
#include<stdio.h>
int main()
{
long l,h,j,i,s,count,max,t;
while(scanf("%ld %ld",&l,&h)==2)
{
max = 0;
if(l==0&&h==0) break;
if(l>h)
{
t = h;
h = l;
l = t;
}
for(j = l; j<=h; j++)
{
i = j;
count = 0;
while(i!=1 ...
#include<stdio.h>
int main()
{
long l,h,j,i,s,count,max,t;
while(scanf("%ld %ld",&l,&h)==2)
{
max = 0;
if(l==0&&h==0) break;
if(l>h)
{
t = h;
h = l;
l = t;
}
for(j = l; j<=h; j++)
{
i = j;
count = 0;
while(i!=1 ...