Skip to content

Instantly share code, notes, and snippets.

View swapnil-warke's full-sized avatar
:octocat:
I may be slow to respond.

swapnil-warke

:octocat:
I may be slow to respond.
View GitHub Profile
@swapnil-warke
swapnil-warke / gist:5856317
Created June 25, 2013 06:11
uva10640 Josephs problem
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
@swapnil-warke
swapnil-warke / poj_2663_AC.cpp
Created July 23, 2013 10:17
poj2663,dynamic programming
/*
** id :template
** author : swap_coder
** time:
*/
#include<vector>
#include<algorithm>
#include<cstdio>
@swapnil-warke
swapnil-warke / uva543_AC.cpp
Created July 26, 2013 07:32
prime no problem with sieve erotheses,easy one
/*
** id :template
** author : swap_coder
** time:
*/
#include<vector>
#include<algorithm>
#include<cstdio>
@swapnil-warke
swapnil-warke / uva10539.cpp
Created July 26, 2013 08:06
UVA10539 Almost prime
/*
** id :template
** author : swap_coder
** time:
*/
#include<vector>
#include<algorithm>
#include<cstdio>
/*
** id :template
** author : swap_coder
** time:
*/
#include<vector>
#include<algorithm>
#include<cstdio>
@swapnil-warke
swapnil-warke / uva10892_ac.cpp
Created July 27, 2013 22:28
lcm , bruteforce
/*
** id :template
** author : swap_coder
** time:
*/
#include<vector>
#include<algorithm>
#include<cstdio>
@swapnil-warke
swapnil-warke / hrredjohnback
Created July 29, 2013 15:24
Hackers rank july 101 hack red john is back
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n,t;
@swapnil-warke
swapnil-warke / uva11388.cpp
Created July 30, 2013 04:46
UVA 11388 GCD LCM
#include <stdio.h>
int main()
{
int n;
scanf("%d",&n);
while(n--)
{
int a,b;
scanf("%d %d",&a,&b);
if(b%a==0)
@swapnil-warke
swapnil-warke / uva11495_ac.cpp
Created July 31, 2013 18:11
counting inversion problem simple
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
using namespace std;
typedef long long ll;
@swapnil-warke
swapnil-warke / quicksort.cpp
Created July 31, 2013 18:45
QuickSort Randomised with hoares partition and simple partition
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
using namespace std;
typedef long long ll;
template <class T>