Skip to content

Instantly share code, notes, and snippets.

View henrybear327's full-sized avatar

Chun-Hung Tseng henrybear327

View GitHub Profile
#include <bits/stdc++.h>
using namespace std;
const int S = 4;
const int INA = 2; // inactive
const int ADA = 0;
const int XY = 1;
const int NON = 3; // nonreachable
const int ACT = 5; // active
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll P = 65537;
ll x[3];
ll y[3];
ll cal(ll a0, ll a1, ll a2, int which)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve()
{
int n;
scanf("%d", &n);
#include <bits/stdc++.h>
using namespace std;
#define sz(x) (int(x.size()))
typedef long long ll;
typedef double db;
int main() {
ll x;
while (scanf(" %lld", &x)) {
@henrybear327
henrybear327 / GPA converter.cpp
Created September 25, 2017 07:42
GPA converter.cpp
#include <bits/stdc++.h>
using namespace std;
double gpa(int cnt[])
{
int sum = cnt[0] + 2 * cnt[1] + 3 * cnt[2] + 4 * cnt[3];
// printf("%d %d %d %d\n", cnt[0], cnt[1], cnt[2], cnt[3]);
int total = cnt[0] + cnt[1] + cnt[2] + cnt[3];
// printf("%d %d\n", sum, total);
@henrybear327
henrybear327 / UVa 1650.cpp
Created September 10, 2017 05:36
UVa 1650.cpp
#include <bits/stdc++.h>
using namespace std;
int dp[1111][1111];
char inp[1111];
const int MOD = 1000000007;
void solve()
#include <bits/stdc++.h>
using namespace std;
#define N 8
bool seen[N][N];
bool row[N];
int ans = 0;
@henrybear327
henrybear327 / indirectCharPtr.cpp
Created April 30, 2017 17:09
indirectCharPtr.cpp
#include <bits/stdc++.h>
using namespace std;
int main()
{
char hello[100][16];
strcpy(hello[0], "hello");
strcpy(hello[1], "world");
@henrybear327
henrybear327 / Round 1C 2017 B.cpp
Created April 30, 2017 15:27
Round 1C 2017 B.cpp
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<int, ii> gapi;
int main()
{
@henrybear327
henrybear327 / README.md
Created April 24, 2017 23:53 — forked from magnetikonline/README.md
Bookmarklet to pretty print Gist pages without the usual page chrome, just content. Handy for Markdown document printing.

Pretty print bookmarklet helper for Gist pages

Create a new bookmark somewhere handy in your browser with the following URL:

javascript:var el=document.createElement('style');el.media='print';el.innerHTML='#header,.pagehead.repohead,.gist-description.container,.file-box .meta,#comments,.js-comment-form,#footer{display:none;}.file-box{border:0!important;}';document.getElementsByTagName('head')[0].appendChild(el);alert('Please consider the environment before printing :)');
  • Navigate to your Gist of choice
  • Hit the bookmarklet
  • Now print