Skip to content

Instantly share code, notes, and snippets.

View dada8397's full-sized avatar

Hsin Ta Chan dada8397

View GitHub Profile
import json
import collections
import csv
f = open('contacts.json')
c = json.load(f)
# c = [
# {'Id': '0', 'Email': 'Wick', 'Phone': '', 'OrderId': '', 'Contacts': '3'},
# {'Id': '1', 'Email': 'John', 'Phone': '', 'OrderId': '12345678', 'Contacts': '5'},
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
@dada8397
dada8397 / test.cpp
Last active March 23, 2017 06:36
test.cpp
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <string>
#define MAX 110
using namespace std;
string in1[MAX], in2[MAX], ans[MAX];
@dada8397
dada8397 / poj-1154.cpp
Created February 18, 2017 08:28
POJ 1154 - Letters
#include <cstdio>
#include <iostream>
#include <stack>
using namespace std;
char map[21][21];
bool visit[30];
int R, C, Max;
@dada8397
dada8397 / uva-673.cpp
Created February 18, 2017 08:25
UVa 673 - Parentheses Balance
#include <cstdio>
#include <stack>
#include <iostream>
#include <string>
using namespace std;
int main(void) {
int n;
string s;
@dada8397
dada8397 / uva-11995.cpp
Last active February 18, 2017 09:29
11995 - I Can Guess the Data Structure!
#include <cstdio>
#include <stack>
#include <queue>
using namespace std;
int main(void) {
int n;
while(scanf("%d", &n) != EOF) {
int cmd, num;
@dada8397
dada8397 / uva-10685.cpp
Last active February 17, 2017 12:17
UVa 10685 - Nature
#include <cstdio>
#include <map>
#include <cstring>
#include <string>
#include <iostream>
using namespace std;
int set[5010];
int num[5010];
@dada8397
dada8397 / uva-10583.cpp
Created February 17, 2017 07:47
UVa 10583 - Ubiquitous Religions
#include <cstdio>
using namespace std;
int p[50000], N;
int Find(int x) {
if(x == p[x]) return x;
return p[x] = Find(p[x]);
}
@dada8397
dada8397 / uva-10420.cpp
Created February 17, 2017 03:58
UVa 10420 - List of Conquests
#include <map>
#include <cstring>
#include <cstdio>
#include <iostream>
using namespace std;
int main(void) {
int n;
while(scanf("%d\n", &n) != EOF) {
@dada8397
dada8397 / uva-11462.cpp
Created February 17, 2017 02:46
UVa 11462 - Age Sort
#include <vector>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(void) {
int n;
while(scanf("%d", &n) != EOF) {
if(n==0) break;