Skip to content

Instantly share code, notes, and snippets.

View haroldxin's full-sized avatar

Harold Xin haroldxin

View GitHub Profile
@haroldxin
haroldxin / Power
Last active August 29, 2015 14:06
QUICKLY MI
#include <iostream>
#include <stdio.h>
using namespace std;
typedef unsigned int uint;
void pow(uint x,uint y){
uint pow;
if(x == 1)
cout << 1;
if(x != 0 && y == 0)
cout << 1;
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std; //爲什麽總是忘!!!
typedef vector<int> vec;
typedef vector<vec> mat;
typedef long long lint;
const int M = 10000;
//caculate A*B
mat martix(mat &A,mat &B) {
@haroldxin
haroldxin / POJ 2386 Lake Counting
Last active August 29, 2015 14:06
Lake Counting
//POJ NO.2386 LAKE COUNTING
#include <iostream>
#include <cstdio>
using namespace std;
int N,M;
const int Max = 10000;
char field[Max][Max+1]; //園子
void dfs(int x,int y){
field[x][y]='.';
for (int dx=-1;dx<=1;dx++){
@haroldxin
haroldxin / Lottery!
Created September 20, 2014 04:12
Lottery!
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
freopen("lottery.in","r",stdin);
freopen("lottery.out","w",stdout);
int n;
cin >> n;
int caipiao[8];
for (int i=1;i<=7;i++)scanf("%d",&caipiao[i]);
@haroldxin
haroldxin / Rectangle
Created September 20, 2014 04:13
Rectangle
const
max=100;
fin='rectangle.in';
fout='rectangle.out';
var
f:array[0..max+1,0..max+1] of integer;
n,k,i,j,x1,y1,x2,y2,ans:integer;
begin
assign(input,fin); reset(input);
assign(output,fout);rewrite(output);
@haroldxin
haroldxin / Circle
Created September 23, 2014 09:02
Circle
//Unfinshed
#include <iostream>
#include <cstdio>
int n;
const int maxn = 7000;
bool check[maxn+1];
void init() {
for(int i=0,i<=maxn;i++)check[i]=false;
return ;
}
@haroldxin
haroldxin / Rectangle 2 ?
Created September 23, 2014 09:06
Rectangle 2
#include <iostream>
#include <cstdio>
using namespace std;
const int maxn = 101;
int main () {
int n;
cin >> n;
int f[maxn][maxn];
for (int i=0;i<=100;i++){
for (int j=0;j<=100;j++){