Category: ACM

23
Nov
2014

C code for bisection method

The Bisection Method is a numerical method for estimating the roots of a polynomial f(x). It is…

23
Nov
2014

C code for bisection method

The Bisection Method is a numerical method for estimating the roots of a polynomial f(x). It is…

23
Nov
2014

C code for bisection method

The Bisection Method is a numerical method for estimating the roots of a polynomial f(x). It is…

09
Apr
2014

UVa Solution – 11827 – Maximum GCD

#include<cstdio> #include<algorithm> using namespace std; int num[100], n; int gcd(int a, int b) { return b ?…

05
Apr
2014

UVa Solution – 11417 – GCD

#include<stdio.h> int main() { int N; while(scanf(“%d”,&N)==1) { if(N==0) break; int G=0,i,j; for(i=1;i<N;i++) { for(j=i+1;j<=N;j++) { G+=GCD(i,j);…

02
Mar
2014

Lightoj Solutions: 1001 – Opposite Task

Problem Link : http://www.lightoj.com/volume_showproblem.php?problem=1001 Solution: #include<bits/stdc++.h> int main(){ int t,i,n; scanf(“%d”,&t); for(i=0;i<t;i++) { scanf(“%d”,&n); if(n>10) { printf(“%d %d\n”,n-10,n-(n-10));…