y rte??? :roll:
#include<stdio.h>
long dif(long a,long b);
int main()
{
long n,p,x[10099],r=0,s,m,j,min,k;
while(scanf("%ld",&n)==1)
{
for(long i=0;i<n;i++)
scanf("%ld",&x[i]);
scanf("%ld",&p);
r=0;
for(k=0;k<n-1;k++)
{
for(j=k+1;j<n;j++)
{
if(x[k]+x[j]==p)
{
min=dif(x[k],x[j ...
Search found 17 matches
- Sun Aug 03, 2008 9:54 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11057 - Exact Sum
- Replies: 50
- Views: 30481
- Sun Aug 03, 2008 1:37 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10062 - Tell me the frequencies!
- Replies: 235
- Views: 69435
Re: 10062 - Tell Me the Frequencies!
where is the bug???? :roll:
#include<stdio.h>
#include<string.h>
int main()
{
char x[5000];
char a[5000];
int b[5000];
int i,j,cs;
int c=1,p,pass,t,m;
while(gets(x))
{
if(cs==1)
printf("\n");
cs=1;
p=strlen(x);
int k=0;
for(i=0;i<p;i++)
{
c=1;
if(x[i]=='\0')
continue;
for(j=i ...
#include<stdio.h>
#include<string.h>
int main()
{
char x[5000];
char a[5000];
int b[5000];
int i,j,cs;
int c=1,p,pass,t,m;
while(gets(x))
{
if(cs==1)
printf("\n");
cs=1;
p=strlen(x);
int k=0;
for(i=0;i<p;i++)
{
c=1;
if(x[i]=='\0')
continue;
for(j=i ...
- Sun Aug 03, 2008 11:42 am
- Forum: Volume 4 (400-499)
- Topic: 406 - Prime Cuts
- Replies: 187
- Views: 60412
Re: 406 - Prime Cuts
these are some output...where should i print "\n"?? :roll:
100 100: 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
100 50: 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
100 51: 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 ...
100 100: 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
100 50: 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
100 51: 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 ...
- Sun Aug 03, 2008 8:04 am
- Forum: Volume 4 (400-499)
- Topic: 406 - Prime Cuts
- Replies: 187
- Views: 60412
Re: 406 - Prime Cuts
cut.....acc
- Thu Jul 17, 2008 4:27 pm
- Forum: Volume 4 (400-499)
- Topic: 498 - Polly the Polynomial
- Replies: 73
- Views: 21956
Re: 498 TLE
what is meant by "evaluating" here??plz help........For each pair of lines, your program should evaluate the polynomial for all the values of x
- Thu Jul 10, 2008 12:14 pm
- Forum: Volume 3 (300-399)
- Topic: 355 - The Bases Are Loaded
- Replies: 74
- Views: 30569
Re: 355 - The Bases Are Loaded
still WA...
should i use array for generating output??
should i use array for generating output??
- Wed Jul 09, 2008 9:53 pm
- Forum: Volume 3 (300-399)
- Topic: 355 - The Bases Are Loaded
- Replies: 74
- Views: 30569
Re: 355 - The Bases Are Loaded
getting WA.plz help
#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
long long int a,i,k,n,m;
long long int p,q;
long long int y[5000];
char x[5000];
while(scanf("%lld",&p)!=EOF)
{
scanf("%lld",&q);
scanf("%s",x);
n=strlen(x);
int f=1;
for(i=0;i<n;i++)
{
if(x ...
#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
long long int a,i,k,n,m;
long long int p,q;
long long int y[5000];
char x[5000];
while(scanf("%lld",&p)!=EOF)
{
scanf("%lld",&q);
scanf("%s",x);
n=strlen(x);
int f=1;
for(i=0;i<n;i++)
{
if(x ...
- Sat Jul 05, 2008 9:37 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10849 - Move the bishop
- Replies: 44
- Views: 23450
- Sat Jul 05, 2008 7:20 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10849 - Move the bishop
- Replies: 44
- Views: 23450
- Sat Jul 05, 2008 3:36 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10849 - Move the bishop
- Replies: 44
- Views: 23450
Re: 10849 - Move the bishop
check this input && output :roll:
1 //test case
16 // the number of tests for that case.
5 //chess board with NxN squares
1 1 1 1
0
1 1 2 1
no move
1 1 1 2
no move
1 1 2 2
1
1 1 6 1
no move
1 1 1 3
2
1 1 3 1
2
2 1 3 1
no move
2 1 3 2
1
2 1 2 3
2
1 1 5 5
1
1 2 5 4
2
1 1 1 5
2
1 2 1 5
no move
2 2 ...
1 //test case
16 // the number of tests for that case.
5 //chess board with NxN squares
1 1 1 1
0
1 1 2 1
no move
1 1 1 2
no move
1 1 2 2
1
1 1 6 1
no move
1 1 1 3
2
1 1 3 1
2
2 1 3 1
no move
2 1 3 2
1
2 1 2 3
2
1 1 5 5
1
1 2 5 4
2
1 1 1 5
2
1 2 1 5
no move
2 2 ...
- Fri Jul 04, 2008 8:26 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10849 - Move the bishop
- Replies: 44
- Views: 23450
Re: 10849 - Move the bishop
what will happen if the bishop or the target is placed out of the board??
you should consider the black and white cells of the chess board accurately.......
the bishop can be white and black colours too.....
you should consider the black and white cells of the chess board accurately.......
the bishop can be white and black colours too.....

- Fri Jul 04, 2008 5:34 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10849 - Move the bishop
- Replies: 44
- Views: 23450
Re: 10849 - Move the bishop
check this input:

output of my acc code is:1 1 2 2
hope it will help....there are more conditions than u have assumed.......1

- Mon Jun 30, 2008 12:07 pm
- Forum: Volume 102 (10200-10299)
- Topic: 10252 - Common Permutation
- Replies: 150
- Views: 73237
Re: 10252 - Common Permutation
Given two strings of lowercase letters, a and b, print the longest string x of lowercase letters such that there is a permutation of x that is a subsequence of a and there is a permutation of x that is a subsequence of
what is meant hear by "permutation" && "subsequence"??
i am totally in dark ...
what is meant hear by "permutation" && "subsequence"??
i am totally in dark ...
- Thu Jun 26, 2008 7:58 pm
- Forum: Volume 1 (100-199)
- Topic: 191 - Intersection
- Replies: 103
- Views: 33472
Re: 191, WA
code removed
- Thu Jun 19, 2008 12:21 pm
- Forum: Volume 111 (11100-11199)
- Topic: 11192 - Group Reverse
- Replies: 22
- Views: 15778
Re: 11192 - Group Reverse
thank u shiplu vai
i hv got ac
i hv got ac
