Skip to content

Instantly share code, notes, and snippets.

View vectorijk's full-sized avatar

Kai Jiang vectorijk

  • Seattle, WA
  • 12:43 (UTC -07:00)
View GitHub Profile
@vectorijk
vectorijk / Programming_Question_1.cpp
Last active August 29, 2015 14:14
Coursera Algorithms: Design and Analysis, Part 1 (Stanford)
/***
Algorithms: Design and Analysis, Part 1
Week 1
Jan 2015
***/
#include <bits/stdc++.h>
using namespace std;
// [s,e) consider boundary!! make range uniform
@vectorijk
vectorijk / AstParser.jj
Last active August 29, 2015 14:14
Compiler Homework CS321
// (For CS321 Assignment 3. Winter'15)
//
// miniJava AST parser (starter version).
//
// Kai Jiang (at jiangkai (dot gmail com))
// Feb 2015
PARSER_BEGIN(AstParser)
import java.util.*;
import java.io.*;
@vectorijk
vectorijk / RoundD_A.cpp
Last active August 29, 2015 14:09
Google APAC 2015 University Graduates Test Round D
#include <bits/stdc++.h>
using namespace std;
int s;
bool inmap(int i,int j,int s){
if( i < 0 || j < 0 || i >= s || j >= s){
return false;
}
else{
return true;
@vectorijk
vectorijk / Polar-Angles.py
Created November 6, 2014 07:56
Hackerrank Back2school 2014
import math
n = input()
def ang(x,y):
if math.atan2(y,x) < 0:
return (x,y,2.0*math.pi+math.atan2(y,x))
else:
return (x,y,math.atan2(y,x))
M = []
@vectorijk
vectorijk / L_Tongues.cpp
Created November 5, 2014 08:53
ICPC PacNW 12 Problem L Tongues
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
char s[150];
char vow[] = "aiyeou";
char con[] = "bkxznhdcwgpvjqtsrlmf";
@vectorijk
vectorijk / RoundC_A.cpp
Created October 31, 2014 08:58
Google APAC 2015 University Graduates Test Round C Problem A
#include <bits/stdc++.h>
#define Inf 0x3f3f3f3f
using namespace std;
int dir[8][2] = { {-1,-1}, {0,-1}, {1,-1},
{-1,0} , {1,0},
{-1,1} , {0,1}, {1,1} };
char mp[350][350];
int sum[350][350];
int vis[350][350];
//============================================================================
// Name : minimum-path-sum.cpp
// Author : jiangkai
// Version :
// Copyright :
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
#include <bits/stdc++.h>