This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int A[MAX], N; | |
int partitions(int low, int high) { | |
int p=low, r=high, x=A[r], i=p-1; | |
for (int j=p; j<=r-1; j++) { | |
if (A[j]<=x){ | |
i=i+1; | |
swap(A[i],A[j]); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while (unenm != 0) { | |
while (men[j] != -1) | |
j++; //man no. j is unengaged. he proposes to men2[j]. | |
int wc = m[j][men2[j]]; | |
if (women[wc] == -1){ //wc and j get engaged | |
women[wc] = j; | |
men[j] = wc; | |
unenm --; | |
j = 0; | |
} else if (w[wc][women[wc]] > w[wc][j]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <stack> | |
#include <queue> | |
#include <algorithm> | |
#include <cstdio> | |
using namespace std; | |
struct compare { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Author : JAYAPRAKASH S | |
* Maximum liklihood estimator for Laplace density function | |
* Mail : first_name [at] cse [dot] iitb [dot] ac [dot] com | |
* Please mail me, if any error is found. | |
*/ | |
import java.util.ArrayList; | |
import java.util.Collections; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
class _x{ | |
public: int s, e, p,m; | |
}VAL[10005]; | |
int N; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstring> | |
#include <stack> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
char str[]="ALLIZZWELL"; | |
int v[105][105]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
const int MAX=100025; | |
int N,A,B; | |
int v[MAX]; | |
int min2(int a, int b) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
void max( long long int &a, long long int b) { if(a<b) a=b; } | |
long long int res; | |
#define MAX 100005 | |
long long int V[MAX]; int N; | |
int l1[MAX]; | |
int l2[MAX]; | |
int fn(int *l) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstring> | |
#include <stack> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
char str[]="ALLIZZWELL"; | |
int v[105][105]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstring> | |
using namespace std; | |
typedef unsigned ull; | |
void setmax( int &a, int b) { if(a<b) a=b; } | |
ull res; | |
#define MAX 50005 | |
int rem; //0..999 | |
int YEARS; //40 |
OlderNewer