Monthly Archives: August 2016

Useful Contents

May be there are many sources to gain knowledge or logic or hints, I am trying to give some links,if there is anything i forget ,please help me to add! Google Stack Overflow Shafaet’s Planet   Advertisements

Rate this:

Posted in Uncategorized | Leave a comment

Normal Programming+Projects

Normal Programming Solutions Delete File BigInteger Factorial in Java nCr optimized way n-th fibonacci numbers Converting string of numbers to individual numbers Calculator App Development using Java Swing GUI

Rate this:

Posted in Uncategorized | Leave a comment

Delete File

#include<stdio.h> int main() { int status; char file[12]; printf(“Delete file: “); gets(file); status=remove(file); if(status==0) printf(“Deleted\n”); else { printf(“Unable to delete\n”); perror(“ERROR”); } }

Rate this:

Posted in Uncategorized | Leave a comment

598A:Tricky Sum

<Problem Link> <Source Code> #include<stdio.h> int main() { long long n,x,i,t; scanf(“%lld”,&t); while(t–) {x=1; scanf(“%lld”,&n); i=n*(n+1)/2; while(x<=n) { x*=2;} x–; printf(“%lld\n”,i-2*x); } }

Rate this:

Posted in Uncategorized | Leave a comment

707A. Brain’s Photos

Problem Link <Source Code> #include<stdio.h> #include<string.h> #include<bits/stdc++.h> using namespace std; int main() { int i,s=0,co=0,j,n,m; cin >> n >> m;char o; for(i=0;i<n;i++) { for(j=0;j<m;j++) { cin >> o; if(o==’C’ ||o==’M’ ||o==’Y’) s=1; } } if(s) printf(“#Color\n”); else printf(“#Black&White\n”); }  

Rate this:

Posted in Uncategorized | Leave a comment

707C. Pythagorean Triples

Problem Link <Source Code> #include<stdio.h> int main() { long long int n,d,a,b; scanf(“%lld”,&n); if(n<=2) { printf(“-1\n”); return 0;} else {n=n*n; if(n%2) printf(“%lld %lld\n”,(n/2),(n/2)+1); else printf(“%lld %lld\n”,(n/4)-1,(n/4)+1); } }    

Rate this:

Posted in Uncategorized | Leave a comment

678 C. Joty and Chocolate

Problem Link <Source Code> #include<stdio.h> int gcd(long long int n1,long long int n2) { return (n2!=0)?gcd(n2,n1%n2):n1; } long long lcm(long long a,long long b) { return (a/gcd(a,b))*b; } int main() { long long n,a,b,p,q,ans=0; scanf(“%lld %lld %lld %lld %lld”,&n,&a,&b,&p,&q); ans+=(n/a)*p; … Continue reading

Rate this:

Posted in Uncategorized | Leave a comment