Skip to content

Instantly share code, notes, and snippets.

View henrybear327's full-sized avatar

Chun-Hung Tseng henrybear327

View GitHub Profile
/*
assumptions
1. have 1*1 cells
2. no rotation
3. no overlapping
*/
int greedySolver(vector<Shape> shapes, Floor floorDimension)
{
// generate starting state
@henrybear327
henrybear327 / vpn.md
Created June 10, 2018 11:14 — forked from joepie91/vpn.md
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

(A Russian translation of this article can be found here, contributed by Timur Demin.)

Why not?

@henrybear327
henrybear327 / a.cpp
Last active May 21, 2018 01:16
2018 GCJ Round 2
#include <bits/stdc++.h>
using namespace std;
void solve()
{
int n;
scanf("%d", &n);
vector<vector<char>> ans(111, vector<char>(111, '.'));
@henrybear327
henrybear327 / weighted longest increasing subsequence.cpp
Last active May 15, 2018 15:10
weighted longest increasing subsequence
// max weight, might not be the LIS!
#include <bits/stdc++.h>
using namespace std;
void solve()
{
int n;
scanf("%d", &n);
#include <bits/stdc++.h>
using namespace std;
struct Interval {
int s, t, w;
};
void solve()
{
@henrybear327
henrybear327 / Constrained 0-1 Knapsack Problem.cpp
Created May 15, 2018 13:47
Constrained 0-1 Knapsack Problem
#include <bits/stdc++.h>
using namespace std;
struct Data {
int v, w;
};
bool solve()
{
#include <bits/stdc++.h>
using namespace std;
int main()
{
int ncase;
scanf("%d", &ncase);
while (ncase--) {
@henrybear327
henrybear327 / a.cpp
Last active May 2, 2018 06:19
第四屆桂冠闖關組
#include <cstdio>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
int main()
{
#include <bits/stdc++.h>
using namespace std;
const int N = 55555;
vector<int> g[N];
void dfs(int u, bool seen[], int w[], int &ans)
{
if (seen[u])
@henrybear327
henrybear327 / 8.cpp
Created May 1, 2018 15:09
ITSA 第四屆
#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
int ncase;
scanf("%d", &ncase);