- 博客(134)
- 收藏
- 关注
原创 USACO:Shaping Regions
#include#include#include#include#include#define mp make_pairusing namespace std;typedef long long lng;typedef pair pii;struct seg{ int l,r; seg(){} seg(int x,int y){l=x,r=y;}};int Mi
2013-04-23 20:14:06 760
原创 USACO:Humble Numbers
/*ID: Jang LawrencePROG: humbleLANG: C++*/#include#include#include#include#include#include#include#include#include#define X first#define Y second#define sqr(a) ((a)*(a))using namespac
2013-04-21 19:40:21 998
原创 USACO:Score Inflation
/*ID: Jang LawrencePROG: inflateLANG: C++*/#include#include#include#include#include#include#include#define X first#define Y second#define sqr(a) ((a)*(a))using namespace std;typedef lo
2013-04-20 19:17:59 900
原创 USACO:Agri-Net
/*ID: Jang LawrencePROG: agrinetLANG: C++*/#include#include#include#include#include#include#include#define X first#define Y second#define sqr(a) ((a)*(a))using namespace std;typedef lo
2013-04-20 19:09:39 904
原创 USACO:Fractions to Decimals
/*ID: Jang LawrencePROG: fracdecLANG: C++*/#include#include#include#include#include#include#include#define X first#define Y second#define sqr(a) ((a)*(a))using namespace std;typedef lo
2013-04-19 21:24:04 742
原创 USACO:Bessie Come Home
/*ID: Jang LawrencePROG: comehomeLANG: C++*/#include#include#include#include#include#include#define X first#define Y second#define sqr(a) ((a)*(a))using namespace std;typedef long long
2013-04-19 20:25:22 782
原创 USACO:PROB Cow Tours
/*ID: Jang LawrencePROG: cowtourLANG: C++*/#include#include#include#include#include#include#define X first#define Y second#define sqr(a) ((a)*(a))using namespace std;typedef long long l
2013-04-19 19:22:34 749
原创 USACO:Overfencing
/*ID: Jang LawrencePROG: maze1LANG: C++*/#include#include#include#include#include#define mp make_pairusing namespace std;typedef long long lng;typedef pair pii;int m,n;int a[301][301];
2013-04-13 15:58:49 787
原创 usaco:The Tamworth Two
/*ID: Jang LawrencePROG: ttwoLANG: C++*/#include#include#include#include#include#define mp make_pairusing namespace std;typedef long long lng;typedef pair pii;char m[11][11];bool is[11]
2013-04-05 20:31:37 678
原创 Java sort 的比较函数写法
import java.io.IOException;import java.util.Arrays;import java.util.Scanner;import java.lang.Integer;public class Main{ static Scanner c=new Scanner(System.in); public static class Stu implemen
2013-03-14 17:40:37 5529
原创 Java BigInteger hdu 1720 为例
import java.io.IOException;import java.math.BigDecimal;import java.math.BigInteger;import java.util.Scanner;public class Main{ static Scanner c=new Scanner(System.in); static BigInteger f(Str
2013-03-13 20:25:03 935
原创 USACO:Controlling Companies
/*ID: Jang LawrencePROG: concomLANG: C++*/#include#include#include#include#include#define mp make_pairusing namespace std;typedef long long lng;typedef pair pii;int n;bool is[110][110];
2013-03-10 16:35:05 717
原创 USACO:Money System
/*ID: Jang LawrencePROG: moneyLANG: C++*/#include#include#include#include#include#define mp make_pairusing namespace std;typedef long long lng;lng dp[26][10001];int n,sum;int a[30];int
2013-03-10 16:03:03 766
原创 USACO: Cow Pedigrees dp
/*ID: Jang LawrencePROG: nocowsLANG: C++*/#include#include#include#include#includeusing namespace std;typedef long long lng;int f(lng x){ return (x%9901+9901)%9901;}int n,k;lng dp
2013-03-08 20:03:04 771
原创 USACO:Zero Sum
/*ID: Jang LawrencePROG: zerosumLANG: C++*/#include#include#include#include#include#define mp make_pairusing namespace std;typedef long long lng;char d[]={" +-"};char opt[10];int n;voi
2013-03-07 21:49:43 953
原创 USACO:Longest Prefix简单dp
/*ID: Jang LawrencePROG: prefixLANG: C++*/#include#include#include#include#include#define mp make_pairusing namespace std;typedef long long lng;int n;string list[201],s,pre,t;bool dp[22
2013-03-07 20:41:46 1268
原创 USACO:Party Lamps
/*ID: Jang LawrencePROG: lampsLANG: C++*/#include#include#include#include#include#define mp make_pairusing namespace std;typedef long long lng;int n,c,an;vector s0,s1;int turn_id[]={0,1
2013-03-07 19:05:18 725
原创 USACO:Runaround Numbers
/*ID: Jang LawrencePROG: runroundLANG: C++*/#include#include#include#include#include#define mp make_pairusing namespace std;typedef long long lng;lng n;int a[9];vector ans;void pushin(
2013-03-07 17:05:16 690
原创 USACO:Subset Sums简单dp
/*ID: Jang LawrencePROG: subsetLANG: C++*/#include#include#include#include#include#define mp make_pairusing namespace std;int n;long long dp[800];int main(){ #ifndef DEBUG freopen(
2013-03-07 15:56:54 644
原创 USACO:Preface Numbering
/*ID: Jang LawrencePROG: prefaceLANG: C++*/#include#include#include#include#include#define mp make_pairusing namespace std;int n;char s[][10][5]={{"M","MM","MMM"},{"C","CC","CCC","CD","D"
2013-03-07 15:41:48 716
原创 USACO:Hamming Codes
/*ID: Jang LawrencePROG: hammingLANG: C++*/#include#include#include#include#include#define mp make_pairusing namespace std;int n,b,d,a[100],ma;int countbit(int x){return x==0?0:1+countbit
2013-03-07 11:21:36 1048
原创 USACO:Healthy Holsteins
/*ID: Jang LawrencePROG: holsteinLANG: C++*/#include#include#include#include#include#define mp make_pairusing namespace std;int need[30];int n,g,val[16][30],ans,ansx;int countbit(int x){
2013-03-06 16:40:21 928
原创 Codeforces Round #169 (Div. 2):E - Little Girl and Problem on Trees
#include#include#include#include#include#include#include#define iinf 1000000000#define pb push_back#define mp make_pair#define lng long long#define sqr(a) ((a)*(a))#define pii pair#define
2013-03-06 15:14:53 733
原创 USCAO:Ordered Fractions
/*ID: Jang LawrencePROG: frac1LANG: C++*/#include#include#include#include#include#define mp make_pairusing namespace std;struct p{ int a,v; p(){} p(int x,int y){a=x,v=y;}
2013-03-06 13:43:57 698
原创 USACO: PROB The Castle
/*ID: Jang LawrencePROG: castleLANG: C++*/#include#include#include#include#include#define mp make_pairusing namespace std;typedef pair pii;int m,n;bool is[55][55][4];int num[3333],id[5
2013-03-06 11:22:55 647
原创 Codeforces Round #149 (Div. 2):XOR on Segment
- -20棵线段树好久没写#include#include#include#include#include#include#include#include#include#include#define iinf 2000000000#define sz(x) x.size()#define pb push_back#define mp make_pair#de
2013-01-28 19:23:07 393
原创 USACO:Checker Challenge
深搜一下 稍微优化一下就ok/*ID: Jang LawrencePROG: checkerLANG: C++*/#include#include#include#include#includeusing namespace std;bool is[14];bool is2[30],is3[30];int n,ans;int c[14];bool f(int &x
2013-01-26 16:57:44 696
原创 USACO:Superprime Rib
枚举/*ID: Jang LawrencePROG: sprimeLANG: C++*/#include#include#include#include#includeusing namespace std;vector ans[9]; int k=0;bool is[10001];int p[10001];bool g(int x){ if(x==1
2013-01-26 15:29:23 587
原创 USACO:Prime Palindromes
枚举枚举枚举/*ID: Jang LawrencePROG: pprimeLANG: C++*/#include#include#include#include#includeusing namespace std;int l,r;int p[10001];bool is[10001];vector ans;char a[11];int n;int turn
2013-01-26 14:59:04 849
原创 USACO:Number Triangles
最简单的dp/*ID: Jang LawrencePROG: numtriLANG: C++*/#include#include#include#include#includeusing namespace std;int Max(int x,int y){if(x<y) return y;return x;}int n;int a[1001][1001],dp[10
2013-01-24 19:05:03 733
原创 USACO: PROB Packing Rectangles
超级蛋疼的题 看到第一遍就不想做 拖啊拖 /*ID: Jang LawrencePROG: packrecLANG: C++*/#include#include#include#include#includeusing namespace std;int Max(int x,int y){if(x<y) return y;return x;}struct ps{
2013-01-24 14:08:02 460
原创 USACO:Mother's Milk
广搜即可/*ID: Jang LawrencePROG: milk3LANG: C++*/#include#include#include#include#includeusing namespace std;bool is[21][21][21];bool in[21];struct ps{ int a[3]; void f(){is[a[0]][
2013-01-22 16:29:56 548
原创 USACO:Arithmetic Progressions
直接枚举/*ID: Jang LawrencePROG: ariprogLANG: C++*/#include#include#include#includeusing namespace std;bool is[125001];int a[125001];int main(){ #ifndef DEBUG freopen("ariprog.in","
2013-01-22 15:54:31 902
原创 USACO:The Clocks
/*ID: Jang LawrencePROG: clocksLANG: C++*/#include#include#include#includeusing namespace std;int as[][6]={{1,2,4,5},{1,2,3},{2,3,5,6},{1,4,7},{2,4,5,6,8},{3,6,9},{4,5,7,8},{7,8,9},{5,6,8,9}
2013-01-21 20:11:56 500
原创 USACO:Prime Cryptarithm
枚举没什么好说的/*ID: Jang LawrencePROG: crypt1LANG: C++*/#include#include#include#includeusing namespace std;int p[5];int b,c,d,e,f;int ans=0;bool in[10];bool is(){ int x=b*100+c*10+d,y
2013-01-19 23:44:44 985 2
原创 USACO:Calf Flac
玩了一天 晚上才做题/*ID: Jang LawrencePROG: calfflacLANG: C++*/#include#include#include#includeusing namespace std;char a[60100],b[25555];int pos[26555];bool is(char c){ return (c>='A'&&c='
2013-01-19 22:17:23 857
原创 USACO:Barn Repair
简单贪心 细节注意点即可/*ID: Jang LawrencePROG: barn1LANG: C++*/#include#include#include#includeusing namespace std;int m,s,c;int a[1111];int main(){ #ifndef DEBUGfreopen("barn1.in","r",stdi
2013-01-18 22:57:07 590
原创 USACO:Mixing Milk
简单贪心 没什么好说的/*ID: Jang LawrencePROG: milkLANG: C++*/#include#include#include#includeusing namespace std;int n,m;structps{ int p,num;}a[5010];bool cmp(ps p,ps q){ return p.p<q.p;
2013-01-18 22:28:12 478
原创 USACO:Dual Palindromes
大水题 /*ID: Jang LawrencePROG: dualpalLANG: C++*/#include#include#include#includeusing namespace std;char a[]={"0123456789ABCDEFGHIJKLMN"};void dfs(int x,int n){ if(x>=n) dfs(x/n,n);
2013-01-18 13:54:41 412
原创 Usaco:Palindromic Squares
简单的进制转换/*ID: Jang LawrencePROG: palsquareLANG: C++*/#include#include#include#includeusing namespace std;int n;char a[]={"0123456789ABCDEFGHIJKLMN"};void dfs(int x){ if(x>=n) dfs(x/n
2013-01-18 13:45:11 488
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人