301 Posted Topics
actually, i have given a task of a fb development. woek is that when ever any one allow the app, then that app will scan the posts and likes of that person. and that app will have database which will check that words (in posts and likes) with its database … | |
actually, I just want the idea here. I have a server, a client . client will request to display the files names in its directory(server's current directory). server will send the list. my thinking : system command will be used here. when clinet enter "-ls" then server will have system() … | |
i have started using C++ these days. Initially , I have done coding alot in C language. I have seen that on my onliune judges , there are 2 different versions. Why they have given 2 versions to compile the code ? Can you tell ? thanks if you can … | |
Re: if i also write the same code without indentaion , then me also will get the compilation error. TIP: if you again want to write this type of code which have so many if else conditions then try to wrute the indented code. use codeblocks or notepad++ or dev c++ … | |
Re: It may or it may not. depends you have all the the header file which it want. if you have , then no point that it will not compile, and if not, then there is not any question of running ;) simple! | |
i am using masm to write assebmly language codes. can you please tell that how can i change binary numbers to its ascii ? like 10 is given what will be its ascii value ? i know that 30h is ascii value of 0 ans so on. please help. | |
Re: but what's the problem in above post trick ? can u please xplain me ? | |
Re: but why it is necessary to have a checking crietria ? I think we just need to convey our message. here, many people are there who are not so good in english and don't spell correctly. although, it will be good, but it's a thing which is not must and … | |
Re: see the tutorials... it has well developed tutorials. and also , still you dont understand the logic, then see the solutions over there. many people has solved this problem, even me also :p :-D | |
Can you please give me hints or can you teach me how can i convert my simple client server program(in which only client can send any number of messages it want to server) to chat server client program ? I am doing this by trivial way, but still only server … | |
hello, Can anyone please tell me the most efficient know till date so as to find the prime numbers up to 10^8 or higher. I am using sieve and using odd number optimization with it also. but it is not too much effiecent which i want. Can you please any … | |
what are they trying to say in this paragraph , I have read it 10 times, but not getting what they want to teach me here: link is this. : http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=primeNumbers and the para which is just before the euler totient theorem. am copying here also. *Or consider a scenario … | |
You have 9 horses and you have to select fastest 3. You can make a race of 3 horses in one time. So how many time you have to make a race? thanks :-) | |
Can any one please help me to optimize the sieve to find the primes upto 10^8 ? I want very efficient algorithm to find all primes till 10^8 for cryptsystem. i have implemented the naive sieve which is taking too much time. please sgare some classic approach with me. i … | |
i have to do division without divison/multiplication/mod operator. how can i ? int divide(int dividend, int divisor) { int p=1; if(dividend<0) { p*=-1; dividend*=-1; } if(divisor<0) {p*=-1; divisor*=-1; } while(dividend>=divisor) { dividend-=divisor; } return dividend*p; } i have done this, but this giving time limit exceeded when input is 1234567890,1. … | |
#include<stdio.h> #include<limits.h> #define num 86090000 int a[5000000]={0}; short int s[99999999]; void sieve() { int i,j,p=sqrt(num); int k=0; a[k++]=2; for(i=3;i<=num;i=i*i) { s[i]=1; } s[3]=0; for(i=5;i<=num;i=i*i) { s[i]=1; } s[5]=0; for(i=7;i<=num;i=i*i) { s[i]=1; } s[7]=0; for(i=11;i<=num;i=i*i) { s[i]=1; } s[11]=0; for(i=13;i<=num;i=i*i) { s[i]=1; } s[13]=0; for(i=17;i<=num;i=i*i) { s[i]=1; } s[17]=0; for(i=19;i<=p;i+=2) { … | |
int main() { int i=5; printf("%u",&i); return 0; } will the address which it will print is physical address of that variable or logical address ? I may not be clear in the defination of physical and logical address. thanks if you can help me ;) | |
Can anyone exactly tell that how do we decide the complexity in this case. like nlogn +n , then the overall complexity is ? like, if O(f(n)+g(n)) can be equal to max(f(n),g(n)) ? Can we say this ? thanks | |
#include<stdio.h> int dp[20]; int lis(int a[],int n) { int i,j,sum=0; dp[0]=1; for(i=0;i<6;i++) { for(j=i+1;j<n;j++) { if(a[j]>=a[i]) { dp[j]=dp[j-1]+1; } else dp[j]=dp[j-1]; } } } int main() { int a[]={ 5, 3, 4, 8, 6, 7}; int i=0; lis(a,6); for(i=0;i<6;i++) printf("%d ",dp[i]); getch(); return 0; } hi , this is the … | |
x^2 + S(x)*x - n=0 where n can be till 10^8 interger . and s(x) is the sum of the digits of the x integer. we have to print the value of x for which this equation holds otherwise print -1. my answer is taking too much time with brute … | |
Re: @ayush I have said you na that daniweb is the best place for your problems and see they all are helping alot. so keep update from here and ya! i have checked it solve() has problem. use a better algo to avoid that. thanks P.S (your senior :p) | |
#include<stdio.h> #define num 10000000 int a[10000009]={0}; void sieve() { int i,j; for(i=2;i<=3164;i++) //loop till sqrt of largest number 10^7 { if(a[i]==0) // all primes are marked 0 { for(j=i*i;j<=num;j+=i) { if(a[j]==0) a[j]=i; // if i is prime then all it's multiples pos have value of i } } } return; … | |
here is a DP problem which i am solving from 2 days now. and i am finding a damn difficult. can you please tell what is overlaaping subproblem and what is optimal substructure in this problem. then i will try it again. any help will be appreciated. thanks http://www.spoj.pl/problems/GNYR09F/ thanks | |
Re: how can you all write too much in the posts ? there can be 2 cases: either your typing speed is too fast or you have someone to type for you. i mean don't you feel lazy ? :p P.S i am just kidding,don't take seriously :-) | |
actually, I want to improve my number theory concepts more and more as i need it in much extent. is there any good website or any book which can help me so as to make my needs? i am not weak or something like that in number theory, but still … | |
Re: awesome thinking! hats off man! i am thinking on this now! ;) that's a cool idea where i can learn alot and alot and without any limit! as james sir has said "sky is the limit!" ;) | |
#include <stdio.h> #include <math.h> int main(void) { int number; double result; printf ("\n Introduce an integer: "); scanf ("%i", &number); result= sqrt (number); if ((result * result)== number) printf ("\n The integer HAS a perfect square \n\n"); else printf ("\n The integer DOES NOT HAVE a perfect square \n\n"); } … | |
actually , I am working on a project and i need to sort the co-ordinates in the increasing y value. input: 1 2 3 4 5 6 6 6 7 8 4 5 like this, and i need to sort them in the increasing y value. my approach: i think … | |
Re: the knowledge which you guys are providing is incredible. hey! what exactly i can do in github ? means what specific use github has ? just uploading your project files ? thanks | |
Re: it is the most easy problem i have seen in my coding carrier. here goes the solution ;' #include<stdio.h> int main() { int a,k,n; scanf("%d%d%d",&a,&n,&k); while(k--) { printf("%d ",a%(n+1)); a/=(n+1); } return 0; } feel free to ask doubts! thanks | |
Can anyone give me hint how to develop the suffix array part ? i know the concept, LCP array design but i am not gettinng how to implement in C ? can anyone please help. I know the uses, algo of suffix array as i have read a lot on … | |
hey, i want to do a question in which i am given n line segments and i want to find the number of intersection of them. Can anyone tell me the most efficient way i can do it ? I have got some links on google and also from books … | |
Re: yes! mircosoft seems to publicize itself by giving the colour of daniweb to its own page ;) i always says "dani and daniweb is awesome!" :-) | |
Re: it is a number in octal form as it has 0 in the starting. So it is 000 000 000 000 001 001, so this is nine as you well know ;) thanks | |
i mean when our solved threads increases, then on what basis they are increased because more of the threads are not marked solved. thanks | |
http://www.spoj.pl/problems/FP/ here is the link. Can anyone please give me the hint only that how greedy approach is following in this question ? It's strange to see how greedy is there in this question. just the hint of this. no code, nothing! thanks. | |
Re: clock() returns double and and number of ticks and you should divide it with ticks_per_second so as to get the time. thanks | |
Re: what's going on ? only walt posts are here. with whom is he talking or say, discussing ? thanks ;) | |
isn't there any way that you can know who is downvoting or upvoting your posts ? if yes, then how can i know that ? thanks ;) may be this feature can be added. ;) | |
Re: in which field, russians are best ? ;-) | |
#include<stdio.h> #define MOD 100000009 #define REP(i, n) for(i = 0; i < n; ++i) void mul(int a[2][2],int b[2][2]) { int i,j,k; int c[2][2]; for(i=0;i<2;i++) { for(j=0;j<2;j++) { c[i][j]=0; for(k=0;k<2;k++) { c[i][j]+=(a[i][k]*b[k][j]); } } } // matrix multiply i=0;j=0; REP(i,2) REP(j,2) b[i][j]=c[i][j]; // copying the value in back to b[][] return; … | |
Re: when there is a new post in our threads, then we need to refresh. Can you(all admins) do something so that we shouldn't do this thing or is it neccessay everytime ? thanks. it's just a suggestion of a problem whioch i face generally. still, it is okay for me … | |
Can anyone tell me the good maths forums' names ? I have sometimes doubts in maths while doing coding or something like that. like daniweb is good for computers, Do anyone know about maths forums ? thanks. | |
#include<stdio.h> int main() { char a[60][60],b[60][60],i=0,n1,m1,n2,m2; int x,y; int j=0; char c; int p=-1,q=-1,f=-1,g=-1; scanf("%d%d",&n1,&m1); for(i=1;i<=n1;i++) scanf(" %s",a[i]); scanf("%d%d",&n2,&m2); for(i=1;i<=n2;i++) scanf(" %s",b[i]); for(i=1;i<=n1;i++) { for(j=1;j<=m1;j++) { if(a[i][j]=='1') { p=i; q=j; break; } } if(p>0 || q>0) break; } for(i=1;i<=n2;i++) { for(j=1;j<=m2;j++) { if(b[i][j]=='1') { f=i; g=j; break; } } if(g!=-1 … |
The End.