This file contains hidden or 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 <stdio.h> | |
#include <stdbool.h> | |
#define SWAP(T, X, Y) \ | |
do { \ | |
T johnchen902_swap_temp = X; \ | |
X = Y; \ | |
Y = johnchen902_swap_temp; \ | |
} while(0) | |
int main() { | |
int t; |
This file contains hidden or 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 <cstdio> | |
#include <algorithm> | |
using namespace std; | |
int n, a, b; | |
int y[2000]; | |
long long sum[2001]; | |
bool dp1[101][101]; | |
bool ok1(long long mask) { |
This file contains hidden or 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 <cstdio> | |
#include <cmath> | |
using namespace std; | |
double p[100001]; | |
double c[100000]; | |
int main() { | |
int maxn = 100000; | |
p[1] = 1; |
This file contains hidden or 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 <cstdio> | |
#include <vector> | |
#include <utility> | |
#include <algorithm> | |
#include <memory> | |
using namespace std; | |
using ull = unsigned long long; |
This file contains hidden or 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 <cstdio> | |
#include <limits> | |
#include <algorithm> | |
using namespace std; | |
constexpr int max_r = 5000; | |
constexpr int max_c = 100; | |
int r, c; | |
int h[max_r][max_c - 1]; |
This file contains hidden or 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 <cstdio> | |
#include <vector> | |
#include <algorithm> | |
#include <utility> | |
using namespace std; | |
struct Range{ | |
int l, r; | |
Range(): l(0), r(0) {} | |
Range(int ll, int rr): l(ll), r(rr) {} | |
bool empty() const { return l == r; } |
This file contains hidden or 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 <cstdio> | |
#include <algorithm> | |
using namespace std; | |
int data[2][128 * 1024]; | |
int left[17][128 * 1024]; | |
/** | |
* Precondition: data[17 % 2] is b | |
* Postcondition: left is properly filled |
This file contains hidden or 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 <cstdio> | |
#include <algorithm> | |
using namespace std; | |
struct Node { | |
int sum; | |
Node *lc, *rc; | |
Node(int s); | |
Node(Node*, Node*); | |
}; |
This file contains hidden or 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 <cstdio> | |
#include <cstdlib> | |
#include <ctime> | |
#include <cstring> | |
#include <new> | |
using namespace std; | |
struct Tree; | |
class TreeRef { |
This file contains hidden or 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[] sc = new int[36]; int sum = 0; | |
for (int i = 0; i < 6; i++) | |
sc[i * 6 + (5 - i)] = i; | |
for (int i = 0; i < gC.length; i++) { | |
for (int j = 0; j < 6; j++) { | |
sc[j * 6 + t[i]] += j + t[i]; | |
sc[g[i] * 6 + j] -= g[i] + t[i]; } } | |
for (int m = 0; m < 36; m++) { | |
if (sc[m] < 1) sc[m] = 1; sc[m] *= sc[m]; | |
sum += sc[m]; } |
NewerOlder