## Search found 16 matches

Mon Jul 25, 2005 3:59 am
Forum: Volume 103 (10300-10399)
Topic: 10323 - Factorial! You Must be Kidding!!!
Replies: 106
Views: 33758
we know fact(n)=nfact(n-1)
->fact(n-1)=fact(n)/n
->fact(n)=fact(n+1)/(n+1)

if n=-1 ,
-1!=fact(0)/0=infinity so overflow
if n=-2
-2!=fact(-1)/(-1)=-infinity so underflow

nd so on
Mon Sep 13, 2004 10:24 am
Forum: Volume 105 (10500-10599)
Topic: 10591 - Happy Number
Replies: 61
Views: 21557

### 10591

i found the fault myself,yet thanx to raiyan

Code: Select all

``````[cpp]
the code has been cut
[cpp]``````
Thu Mar 11, 2004 7:40 am
Forum: Volume 1 (100-199)
Replies: 135
Views: 23426

### why wa 111 history grading

i used lcs for this prigram so why wa? [cpp]#include<stdio.h> #include<string.h> #include<stdlib.h> int cor[40],stu[40],array[40][40],n; void work() { int i,j; for(i=0;i<40;i++) memset(array ,0,sizeof(int)*40); for(i=0;i<n;i++) for(j=0;j<n;j++) { if(stu ==cor[j]) array[i+1][j+1]=array [j]+1; else if...
Wed Mar 10, 2004 11:37 am
Forum: Volume 100 (10000-10099)
Topic: 10006 - Carmichael Numbers
Replies: 66
Views: 21560

### 10006

i can't understand why it is wa?
[cpp]
what a funny mistake
[/cpp]
Tue Mar 09, 2004 3:49 pm
Forum: Volume 100 (10000-10099)
Topic: 10013 - Super long sums
Replies: 212
Views: 42608
i tried with extra newline but still got wa.i am tired with it
Tue Mar 09, 2004 11:39 am
Forum: Volume 100 (10000-10099)
Topic: 10013 - Super long sums
Replies: 212
Views: 42608
yet i got wa.in problem it was told the sum will be no longer than the given integer.so why extra place.i think there is problem in taking input.
plssss will you check
Tue Mar 09, 2004 11:36 am
Forum: Volume 4 (400-499)
Topic: 482 - Permutation Arrays
Replies: 159
Views: 33585
it's a multiple input problem.i think i can't manage multiple input
problem.please tell what should be code change to provide multiple
input correctly.i took array outside main function but got wa.
Tue Mar 09, 2004 9:54 am
Forum: Volume 100 (10000-10099)
Topic: 10033 - Interpreter
Replies: 88
Views: 26539

### 10033

why it is wa?i am confused about input 000.will i then increase instruction? [cpp]#include<stdio.h> #include<string.h> long int ram[1001],r[11]; int main() { long int test,n,ip,i,k; int f,d,s; scanf("%ld",&test); for(k=0;k<test;k++) { i=0; ip=0; while(1==(scanf("%ld",&ram[i++]))); for(i=0;;) { n=ram...
Tue Mar 09, 2004 9:21 am
Forum: Volume 100 (10000-10099)
Topic: 10032 - Tug of War
Replies: 91
Views: 33557

is my algorithm correct? need some input&output. at first i sorted the iputs.entered 1st man in group1&2nd man in group 2. kept track for man in 2 groups with man1&man2 variable. then for every next input checked if there is equal man in 2 groups. if man number is equal then checked in which group i...
Mon Mar 08, 2004 4:18 pm
Forum: Volume 100 (10000-10099)
Topic: 10032 - Tug of War
Replies: 91
Views: 33557

### 10032

is my algorithm correct? need some input&output. #include<stdio.h> #include<stdlib.h> #include<math.h> int n; int a[105]; void input() { int i; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a ); return; } void work() { int temp,i,j,k,p1,p2,t1,t2,man1,man2,test; scanf("%d",&test); for(k=0;k<test;k++) ...
Mon Mar 08, 2004 4:15 pm
Forum: Volume 4 (400-499)
Topic: 482 - Permutation Arrays
Replies: 159
Views: 33585

### why compile error 482

why compile error? is my algorithm correct? [cpp] #include<stdio.h> #include<string.h> #include<stdlib.h> int main() { long int a[1000000]; char array[1000000][1000]; char str[1000000],s[1000]; long int in,i,num,n,j,len,k; double p; scanf("%ld",&n); fflush(stdin); for(k=0;k<n;k++){ in=0; gets(str); ...
Mon Mar 08, 2004 4:12 pm
Forum: Volume 100 (10000-10099)
Topic: 10013 - Super long sums
Replies: 212
Views: 42608

### 10013

why it's wa?i need some input& output. is my algorithm correct?then why wa? #include<stdio.h> int d1,d2; long int n,m,i,j,num; int a[1000001]; int main() { int c,k; scanf("%ld",&n); for(i=0;i<n;i++) { scanf("%ld",&m); for(j=0;j<m;j++) { scanf("%d %d",&d1,&d2); a[j]=(d1+d2)%10; c=(d1+d2)/10; if(c>0) ...
Sun Mar 07, 2004 8:08 pm
Forum: Volume 4 (400-499)
Topic: 482 - Permutation Arrays
Replies: 159
Views: 33585

### why compile error 482

why compile error? #include<stdio.h> #include<string.h> #include<stdlib.h> int main() { long int a[1000]; char array[1000][20]; char str[1000],s[100]; long int in,i,num,n,j,len,k; double p; scanf("%ld",&n); fflush(stdin); for(k=0;k<n;k++){ in=0; gets(str); len=strlen(str); for(i=0;i<len;){ while(str...
Sun Mar 07, 2004 12:30 pm
Forum: Volume 4 (400-499)
Topic: 489 - Hangman Judge
Replies: 52
Views: 15464

### 489 why wa

why wa? need some sample input&output my coding: [cpp] #include<stdio.h> #include<string.h> int posn[258],travel[258],nmtrv[258]; int main() { long int num,i,in; char str[10000],res[10000],s[5]; long int match=0,notm=0,len,len1; for(;;) { scanf("%ld",&num); gets(s); if(num==-1) break; gets(str); get...
Sun Mar 07, 2004 12:28 pm
Forum: Volume 100 (10000-10099)
Topic: 10008 - What's Cryptanalysis?
Replies: 55
Views: 18240