Skip to content

Instantly share code, notes, and snippets.

View tarawa's full-sized avatar
🏠
Working from home

Jiaqi Yang tarawa

🏠
Working from home
View GitHub Profile
@tarawa
tarawa / tyvj1661.pas
Created July 6, 2013 02:14
TYVJ1661 (Pascal)
type
seg=record
left,right:longint;
add,sum:int64;
end;
var
a:array [0..500000] of seg;
n,k,l,r,i:longint;
order:char;
@tarawa
tarawa / zoj2767.pas
Created July 4, 2013 06:20
ZOJ2767 (Pascal)
var
n,t,m,i,ans:longint;
f:array ['0'..'9'] of boolean;
ch:char;
g:boolean;
procedure test(p:longint);
var
s:string;
t:boolean;
@tarawa
tarawa / poj3225.pas
Created June 30, 2013 13:14
POJ3225 (Pascal)
const
maxn=132000;
type
segment=record
left,right,cov,res:longint;
//cov:cover
//res:reverse
end;
@tarawa
tarawa / poj2182.c
Created June 22, 2013 07:35
POJ2182 (C) && Differences between poj2828.c & poj2182.c
#include <stdio.h>
#define maxn 8010
int a[maxn],used[maxn];
struct segment {
int left,right,count;
} tree[maxn*3];
@tarawa
tarawa / poj2828.c
Created June 22, 2013 03:27
POJ2828 (C)
#include <stdio.h>
#define maxn 200010
int a[maxn];
struct segment {
int left,right,count;
} tree[maxn*3];
@tarawa
tarawa / poj2777.cpp
Created June 20, 2013 13:19
POJ2777 (C++)
#include <stdio.h>
#include <string.h>
#include <algorithm>
struct segment {
int left,right,color;
} a[275000];
bool f[50];
void segtree_create(int p, int l, int r);
@tarawa
tarawa / poj3368.cpp
Created June 16, 2013 13:25
POJ3368 (C++)
#include <stdio.h>
#include <string.h>
const int maxn=100010;
struct segment {
int left,right;
int count;
} a[maxn*2];
int f[maxn],k;
@tarawa
tarawa / zoj1610.cpp
Created June 7, 2013 13:04
ZOJ1610 (C++)
#include <iostream>
#include <limits.h>
#include <string.h>
using namespace std;
const int maxn=8000,no_color=-1,multi_color=-2;
int flags[maxn];
@tarawa
tarawa / poj3461.cpp
Created May 31, 2013 14:34
POJ3461 (C++)
#include <stdio.h>
#include <string.h>
const int maxn=10005,maxm=1000005;
int next[maxn],n;
char text[maxm],pat[maxn];
inline void get_next() {
int m=strlen(pat),k=-1;
@tarawa
tarawa / ride.cpp
Created May 31, 2013 06:40
USACO 1.1 Your Ride Is Here (C++)
/*
ID: dennis.5
PROG: ride
LANG: C++
*/
#include <fstream>
#include <string>
using namespace std;