Skip to content

Instantly share code, notes, and snippets.

#include <bits/stdc++.h>
template<typename T> T gcd(T a, T b) {
if(!b) return a;
return gcd(b, a % b);
}
template<typename T> T lcm(T a, T b) {
return a * b / gcd(a, b);
}
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <math.h>
#define N 1048576
double wall_time(void) {
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <math.h>
#define N 2097152
double wall_time(void) {
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <math.h>
#include <omp.h>
#define N 10000000
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <math.h>
#define N 2097152
double wall_time(void) {
@aajjbb
aajjbb / merge_sort
Created December 4, 2017 03:11
merge sort dissection
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <math.h>
#define N 10000000
double wall_time(void) {
long long fat(int n, int r) {
if (n == 1) {
return 1;
} else if (r == 0) {
return 0;
} else {
return fat(n, r - 1) + fat(n - 1, n - 1);
}
}
/* aajjbb */
#include <bits/stdc++.h>
using namespace std;
const int INF = 10010010;
const int MAX_N = 19;
const int MAX_M = 1000;
/* aajjbb */
#include <bits/stdc++.h>
using namespace std;
const int INF = 10010010;
const int MAX_N = 1000;
const int MAX_M = 1000;
/* aajjbb */
#include <bits/stdc++.h>
using namespace std;
const int INF = 10010010;
const int MAX_N = 19;
const int MAX_M = 2000;