User Profile
Collapse
-
it just shows wrong answer -
i have modified my code but still it is showing wrong answer on spoj compiler and correct answer on ideone
earlier i was not able to detect eof but now i have corrected it. My algorithm just computes 2*(n-1) for large numbers and computes 1 for n=1. Is my algorithm correct?
...Code:#include<stdio.h> #include<string.h> int main() { char a[109]; int i,j,b[109],x,temp; while(fscanf(stdin,"%s",a)==1)Leave a comment:
-
http://www.spoj.com/problems/BISHOPS/
here is the link to the problem. I'm getting all the answers correct on my compiler and even on ideone compiler but spoj compiler shows wrong answer...Leave a comment:
-
spoj question BISHOPS. getting wrong answer. heres my code
...Code:#include<stdio.h> #include<string.h> int main() { char a[109]; int i,j,b[109],x,temp,t=1024; while(t>0) { scanf("%s",a); if(strlen(a)==1 && a[0]=='1') { printf("1"); } else { if(a[strlen(a)-1]!='0') -
How to input a string in C with white spaces in between
I want to input a string in C with white spaces in between. I have tried %[^\n]*c, and fgets, but both do not work. PLEASE HELP -
sorting numbers up to 10^6
which sort is best for sorting numbers upto 10^6 and each number is upto 10^6 large? -
Which sort is this and is it better than insertion sort?
...Code:#include<stdio.h> #include<time.h> #include<conio.h> #include<assert.h> int main() { clock_t start, stop; int n,i,j,temp,a[100]; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); double t = 0.0; assert((start = clock())!=-1); for(i=0;i<n-1;i++)
No activity results to display
Show More
Leave a comment: