ya thanx codemaker i got my error and got accepted
my correction is followings
while(pos!=-1)
{
s.replace(pos,f.length(),r);
pos=s.find(f);
}
Search found 22 matches
- Thu Oct 06, 2005 8:42 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10115 - Automatic Editing
- Replies: 29
- Views: 12270
- Thu Sep 29, 2005 5:37 am
- Forum: Volume 4 (400-499)
- Topic: 450 - Little Black Book
- Replies: 57
- Views: 12339
- Wed Sep 28, 2005 10:09 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10115 - Automatic Editing
- Replies: 29
- Views: 12270
10115
hi whatz wrong with my 10115 please help , code is given below
#include<iostream>
#include<string>
#include<stdio.h>
#define MAX_F_R 1000
#define MAX_A 3600
using namespace std;
char find[MAX_F_R][MAX_F_R];
char replace[MAX_F_R][MAX_F_R];
char array[MAX_A];
int main()
{
int no_of ...
#include<iostream>
#include<string>
#include<stdio.h>
#define MAX_F_R 1000
#define MAX_A 3600
using namespace std;
char find[MAX_F_R][MAX_F_R];
char replace[MAX_F_R][MAX_F_R];
char array[MAX_A];
int main()
{
int no_of ...
- Tue Sep 27, 2005 8:19 pm
- Forum: Volume 4 (400-499)
- Topic: 450 - Little Black Book
- Replies: 57
- Views: 12339
whatz wrong with 450 help please
whatz wrong with 450 help please code is given below
-------------
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define MAX 1000
struct info
{
char t_name[MAX];
char f_name[MAX];
char l_name[MAX];
char add[MAX];
char dept[MAX];
char h_phone[MAX];
char w_phone[MAX];
char cmp_box ...
-------------
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define MAX 1000
struct info
{
char t_name[MAX];
char f_name[MAX];
char l_name[MAX];
char add[MAX];
char dept[MAX];
char h_phone[MAX];
char w_phone[MAX];
char cmp_box ...
- Sat Jul 23, 2005 9:20 pm
- Forum: Volume 3 (300-399)
- Topic: 332 - Rational Numbers from Repeating Fractions
- Replies: 83
- Views: 34337
- Thu Jul 21, 2005 9:08 pm
- Forum: Volume 3 (300-399)
- Topic: 371 - Ackermann Functions
- Replies: 196
- Views: 51197
371 why WA
thanx mr. raj i just make max=0 after every print and got accpted
code removed
code removed
- Thu Jul 21, 2005 9:06 pm
- Forum: Volume 3 (300-399)
- Topic: 371 - Ackermann Functions
- Replies: 196
- Views: 51197
371 why WA
whats wrong here i got WA
#include<stdio.h>
unsigned long fun(unsigned long i)
{
unsigned long count=0;
while(i!=1||(count==0))
{
if(((i%2)==0))
i=i/2;
else
i=(3*i)+1;
count++;
}
return count;
}
int main()
{
unsigned long a, b,tmp,i,value;
unsigned long print_a,print_b;
unsigned ...
#include<stdio.h>
unsigned long fun(unsigned long i)
{
unsigned long count=0;
while(i!=1||(count==0))
{
if(((i%2)==0))
i=i/2;
else
i=(3*i)+1;
count++;
}
return count;
}
int main()
{
unsigned long a, b,tmp,i,value;
unsigned long print_a,print_b;
unsigned ...
- Thu Jul 21, 2005 7:51 pm
- Forum: Volume 3 (300-399)
- Topic: 332 - Rational Numbers from Repeating Fractions
- Replies: 83
- Views: 34337
but still problem
hi raj,
my modified code is given below i tried to avoid here divided by zero,
my RTE IS
Your program has died with signal 8 (SIGFPE). Meaning:
Floating point exception
Before crash, it ran during 0.000 seconds.
------
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h ...
my modified code is given below i tried to avoid here divided by zero,
my RTE IS
Your program has died with signal 8 (SIGFPE). Meaning:
Floating point exception
Before crash, it ran during 0.000 seconds.
------
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h ...
- Sat Jul 16, 2005 8:17 pm
- Forum: Volume 3 (300-399)
- Topic: 332 - Rational Numbers from Repeating Fractions
- Replies: 83
- Views: 34337
332 - Rational Numbers from Repeating Fractions
pleae say me why i am getting RTE
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
#define MAX 1000
char val[MAX];
int array2intiger(char array[MAX],int count)
{
int i,p=count,intiger=0;
for(i=2;i<count;i++)
{
p=p-1;
intiger+=((val[i]-48)*((int)(pow(10,p ...
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
#define MAX 1000
char val[MAX];
int array2intiger(char array[MAX],int count)
{
int i,p=count,intiger=0;
for(i=2;i<count;i++)
{
p=p-1;
intiger+=((val[i]-48)*((int)(pow(10,p ...
- Tue Jul 05, 2005 8:41 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10192 - Vacation
- Replies: 58
- Views: 24047
10192 TLE : though i use DP solution i got TLE help PLZ
10192 TLE : though i use DP solution i got TLE help PLZ. my code is following
#include <stdio.h>
#include <string.h>
#define SIZE 100
char X[SIZE],Y[SIZE];
int c[SIZE][SIZE];
int i,j,m,n;
int LCSlength()
{
m=strlen(X);
n=strlen(Y);
for (i=1;i<=m;i++)
c[i][0]=0;
for (j=0;j<=n;j++)
c ...
#include <stdio.h>
#include <string.h>
#define SIZE 100
char X[SIZE],Y[SIZE];
int c[SIZE][SIZE];
int i,j,m,n;
int LCSlength()
{
m=strlen(X);
n=strlen(Y);
for (i=1;i<=m;i++)
c[i][0]=0;
for (j=0;j<=n;j++)
c ...
- Tue Jul 05, 2005 8:11 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10192 - Vacation
- Replies: 58
- Views: 24047
10192 TLE : though i did dp solution but got TLE Help please
10192 though i did dp solution but got TLE Help he please.my code is following. please say why i got TLE .
#include <stdio.h>
#include <string.h>
#define SIZE 100
char X[SIZE],Y[SIZE];
int c[SIZE][SIZE];
int i,j,m,n;
int LCSlength()
{
m=strlen(X);
n=strlen(Y);
for (i=1;i<=m;i++)
c[i][0 ...
#include <stdio.h>
#include <string.h>
#define SIZE 100
char X[SIZE],Y[SIZE];
int c[SIZE][SIZE];
int i,j,m,n;
int LCSlength()
{
m=strlen(X);
n=strlen(Y);
for (i=1;i<=m;i++)
c[i][0 ...
- Mon Jul 04, 2005 7:56 pm
- Forum: Volume 3 (300-399)
- Topic: 382 - Perfection
- Replies: 95
- Views: 35413
PLEASE HELP ME IN 382 , WHY I GETTING WA
PLEASE SAY ME WHAT IS MY WRONG
WHY I GETTING WA. MY CODE IS GIVEN BELOW
#include<stdio.h>
int main()
{
long n,i;
printf("PERFECTION OUTPUT\n");
freopen("328.txt","r",stdin);
while(1)
{
scanf("%d",&n);
if(n==0)
{
printf("END OF OUTPUT\n");
break;
}
long sum;
for(i=1;i<=n/2;i ...
WHY I GETTING WA. MY CODE IS GIVEN BELOW
#include<stdio.h>
int main()
{
long n,i;
printf("PERFECTION OUTPUT\n");
freopen("328.txt","r",stdin);
while(1)
{
scanf("%d",&n);
if(n==0)
{
printf("END OF OUTPUT\n");
break;
}
long sum;
for(i=1;i<=n/2;i ...
- Wed Jun 15, 2005 8:07 pm
- Forum: Volume 2 (200-299)
- Topic: 263 - Number Chains
- Replies: 45
- Views: 15441
thanx i got accepted
thanx Mr. Rahman i got accpeted . just memeset my array with -1 and got accpted
- Tue Jun 14, 2005 8:58 pm
- Forum: Volume 2 (200-299)
- Topic: 263 - Number Chains
- Replies: 45
- Views: 15441
i modified it but still wrong answer
i modified it but still WA
see my modified code
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
int num[10];
int cmp(const void *a,const void *b)
{
int *p=(int*)a;
int *q=(int*)b;
if(*p>*q)
return 1;
else if(*p<*q)
return -1;
else
return 0;
}
int digit ...
see my modified code
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
int num[10];
int cmp(const void *a,const void *b)
{
int *p=(int*)a;
int *q=(int*)b;
if(*p>*q)
return 1;
else if(*p<*q)
return -1;
else
return 0;
}
int digit ...
- Mon Jun 13, 2005 4:35 am
- Forum: Volume 2 (200-299)
- Topic: 263 - Number Chains
- Replies: 45
- Views: 15441
for the test case my program is right but WA
for the input 123456789. it is in the sample input i test it. following output occur.
Original number was 123456789
987654321 - 123456789 = 864197532
987654321 - 123456789 = 864197532
Chain length 2
please check my prog throwly and say what is my wrong so that i got wrong answer.
Original number was 123456789
987654321 - 123456789 = 864197532
987654321 - 123456789 = 864197532
Chain length 2
please check my prog throwly and say what is my wrong so that i got wrong answer.