Skip to content

Instantly share code, notes, and snippets.

View henrybear327's full-sized avatar

Chun-Hung Tseng henrybear327

View GitHub Profile
@henrybear327
henrybear327 / simulation_frog.c
Last active March 9, 2018 02:42
simulation_frog.c
#include <stdio.h>
#include <string.h>
void simulate(int instruction[], int n, int pos, int dir)
{
int seen[n][2]; // if you land at a location and face the same direction as
// your previous visit -> cycle
memset(seen, -1, sizeof(seen));
if (dir == -1) // change -1 to 0, so we can use array with ease
dir = 0;
@henrybear327
henrybear327 / union.cpp
Last active March 18, 2018 09:57
Eric's question regarding union in C
#include <cstdio>
typedef unsigned char uint8;
union Color {
float a;
uint8 b[4];
};
// print data by bit so you can check the data
#include <bits/stdc++.h>
using namespace std;
void solve()
{
int n;
scanf("%d", &n);
// read input
@henrybear327
henrybear327 / 2D array using new.cpp
Created January 23, 2018 10:51
2D array using new.cpp
#include <bits/stdc++.h>
using namespace std;
int main()
{
static int** Array2D = NULL;
int row = 1000;
int col = 1000;
@henrybear327
henrybear327 / TMD.cpp
Created January 3, 2018 13:17
TMD.cpp
#include <bits/stdc++.h>
using namespace std;
const int MAX_V = 22222;
int V;
vector<int> g[MAX_V];
int match[MAX_V];
bool used[MAX_V];
#include <stdio.h>
#include <string.h>
#define N 210
int main()
{
char s1[N], s2[N], s3[N];
int ncase, i, length1, length2, maxlength;
freopen("string_addReverseNumber.in", "r", stdin);
// freopen("my.out","w",stdout);
scanf("%d", &ncase);
#include <stdio.h>
#include <string.h>
typedef long long ll;
/*
ll reverseNumber(ll num)
{
ll res = 0;
while (num > 0) {
3
4
1 2 50
3 5 20
6 19 100
2 100 200
5
1 2 1
2 3 1
3 4 1
@henrybear327
henrybear327 / chinese.md
Last active October 18, 2017 14:56 — forked from BeMg/chinese.md
Statement of purpose

進修計劃書

在大學期間的選修課程選擇,令我廣泛的接觸了多個不同的資訊研究領域。在這其中,我對於電腦視覺與圖形識別的發展特別有興趣,接下來也打算朝著這個方面進行探索,期許自己可以在進入研究所前,有更明確的研究方向。

短程- 進入研究所前

在取得入學許可之後,會盡速與相關實驗室進行聯絡,尋求意見與協助,以利未來入學做準備。並且複習電腦科學的基本課程,重新溫習一些重要的概念,不忘記基本的準則,為此後的研究進行準備。準備複習的內容為下表:

  • 線性代數
  • 離散數學
#include <bits/stdc++.h>
using namespace std;
#define N 10010
typedef pair<int, int> ii;
void solve(int n)
{