129 Archived Topics
Remove Filter Android Launch! [2012-12-14 21:55:11 - myfirstapp] adb is running normally. [2012-12-14 21:55:11 - myfirstapp] Performing com.example.myfirstapp.MainActivity activity launch [2012-12-14 21:55:11 - myfirstapp] Automatic Target Mode: launching new emulator with compatible AVD 'myfirstavd' [2012-12-14 21:55:11 - myfirstapp] Launching a new emulator with Virtual Device 'myfirstavd' [2012-12-14 21:55:16 - Emulator] Failed to … | |
if i want an array of 10000 ints and i just nned to use it like array only (not the functions which vector have seprately from array), then i make an array int a[10000] and vector<int>a(10000); then memory allocation time will be different for them ? if yes, then please … | |
#include<stdio.h> #include<conio.h> int main() { long double p=778.567; printf("%Lf",p); getch(); return 0; } it's output is : -115403.... something... why is it so ? | |
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 … | |
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. | |
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 … | |
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) { … | |
#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 … | |
#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 | |
#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 … | |
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 … | |
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. | |
#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; … | |
#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 … | |
in my exam, there was a question: what is linux/command which can't be ignored in any way? write the command to kill a process having id 1234 ? my answer was : SIGKILL and for second part i have written a C code function kill(1234,SIGKILL). now my teacher is saying … | |
**Because it is a compile-time operator that, in order to calculate the size of an object, requires type information that is only available at compile-time. This doesn't hold for C++.** i have read this statement roght now when implementing one library function. why it doesn't hold for C++? secondly, i … | |
actually, i have just started using Ubuntu these days(though i have knowledge of unix/linux from past 2-3 years but didnot worked practically) .Can you give me best links in your knowldge for commands related to networking? I have read from about 15 links from google.com. But still i want more … | |
hi, actually I am learning C from past 1 year now and have learnt alot in C. I have read many many books and have solved alot problems in C. now, i am thinking so as to do some kind of project in C/C++. can anyone suggest me some kind … | |
char c[]= "JOJO1993"; char *p =c; printf( "%s", p+p[3] -p [1]) ; this is a code snippet. p is a pointer and when it is used as *(p+3) means 4th character. but my question how can a char pointer can be used as pointer to first byte of any object … | |
i Wana start a project on this topic. what is the scope of this topic as i want to do MS in future. Is there any coding related work in this ? I have just started this project 5 days before. thanks | |
actually, I was thinking arbitrary that i should make my own sizeof function. till date, i have made many many my own C functions which are also defined in C libraries. but i got strucked in sizeof operator desiging. can anyone give me hint how to start with this ? … |
The End.