Author Archives: toad, die

说说回忆

Seeing female pig climb the tree home! Personals Condition 1.female 2.coarse legs 3.breast-feeding 4.eat less

Posted in 默写 | Comments Off on 说说回忆

说说回忆

只要每天有饭吃,有程序写,就很开心

Posted in memory | Comments Off on 说说回忆

说说回忆

做程序员的最高境界就是像和尚研究佛法一样研究算法!

Posted in memory | Comments Off on 说说回忆

说说回忆

我的意中人是个绝色大美女,终有一天她会骑着喷火的恐龙来嫁我,可是我看见了她的座骑,却没有看见它的主人

Posted in memory | Comments Off on 说说回忆

Sault fish ready to turn over!

Sault fish ready to turn over!

Posted in memory | Comments Off on Sault fish ready to turn over!

虽然只剩记事本,还要坚持写程序

虽然只剩记事本,还要坚持写程序

Posted in memory | Comments Off on 虽然只剩记事本,还要坚持写程序

论伤南师

南师荼毗,晚辈自当勤勉怀念,然无自知者徒以扮相,文不实伤南师。小虽不敏,亦受教于夫子曰:“蜀犬虽吠,其伤日月何”。夫子南子举世家,习礼制,知贪婪纵欲易,克己复礼难,然帅之以复礼渡人,其不亦于晨门曰:“是知不可为而为之者欤?”。 夫夫子类阳货有困于匡,夫子何罪邪? 徒以子南子类国师伤之,知其不畏天命也。然子南子亦不困名衔,无自居,但寡过而已,未闻子南子学衔重重之论。无常师,师道,无及长幼。夫文安能皆实,法言功高,修《切韵》 ,经乱五代,无整本传世,至今无全本。广韵虽在,安能尽得切韵之妙?再者王阁序亦有 “豫章”“南昌”本,子安若知,情何以堪。子南子少习于塾,安知诸夫子之学其或有乍乎?或尝论葛侯,怪之文采不鲜,其实不然。咎繇著《尚书》 ,其文鲜而难通,周公著《周官》其文繁而难循,至于亮集,凡夫俗子皆能观而诵之。何也?咎繇圣人,所谈论者帝尧,虞舜,故其文鲜而难通。姬旦所论者群臣,其为万世立宗法,定礼制,故其文不得不繁,所虑者远故也。亮所论者群下也,故其文不敢不易,或以为后表非亮所出,乃他人伪作,盖伤亮文不宜鲜也。夫子南子所论者,既无圣人,鲜有群臣,盖群下者众矣,子南子何能以鲜文渡人?此百年流弊故也,是为论。

Posted in memory | Comments Off on 论伤南师

能才论

很早之前中毒太深时写的 尝习文,试言能才.才者,所以载于文而识于心者也.能者,用才之术也. 凡人者,盖习才于书社,而未能化才为能者多矣.习才者,习<大学>为先。夫大学之道,学为大, 修身为本,竟以至善.亮曰:’夫才须学也,学须静也,无学无以成才,无才无以为能’, 亦习才之道也.夫善化才为能者,鲜矣.昔或誉夫子曰:’夫子其圣人乎?何其多能也?’, 赐以为然,以告夫子.曰:’少且贱,固能多鄙事’,盖多能者亦多鄙事也? 才得者修身为重.夫一坛哥喻能为滚汤,修身为壶.盖人之壶高于汤也,反之, 则汤出而伤人,修身为能者不可以不慎.小窝沪期年,见汤出于壶者不可胜数,为人臣者 不可以不慎,为人子者不可以不慎.夫修身求能者须立远志,夫子十五有志于学而四十有成. 中人当有所虑也.夫修之大者何如?夫子问蘧瑗使,答之以思寡过,师德训弟以唾面,过获冢而戒其军樵采者死也. 小也立志修身,久未得其道,近有所得,为文以志之.

Posted in memory | Comments Off on 能才论

A man in his twenties (in hex)

As a full stack programmer,which is also a experienced software architect, whom has one boy and one girl ,happy with everyday life~~

Posted in wanted | Comments Off on A man in his twenties (in hex)

Poj Solution 3984

http://poj.org/problem?id=3984 #include <iostream> using namespace std; const int M=2147483647; int b[5][5]; void calc(int a[][5],int i,int j); void print(int i,int j); int main() { int i,j; int a[5][5]; for(i=0;i<=4;i++) for(j=0;j<=4;j++) { cin>>a[i][j]; if(a[i][j]==1) a[i][j]=M; } calc(a,0,0); print(4,4); return 0; } void … Continue reading

Posted in poj | Comments Off on Poj Solution 3984

Poj Solution 3983

http://poj.org/problem?id=3983 #include<stdio.h> int main(){ printf("5*(5-(1/5))n"); return 0; }

Posted in poj | Comments Off on Poj Solution 3983

Poj Solution 3982

http://poj.org/problem?id=3982 #include <stdio.h> #include <string.h> #include <stdlib.h> #define MAX_LEN 1024 void BigIntegerAdd(const char a[], const char b[], char res[]) { int i, j, k; int x, y, z; int up, l; char *c; if(strlen(a) > strlen(b)) { l = strlen(a) … Continue reading

Posted in poj | Comments Off on Poj Solution 3982

Poj Solution 3981

http://poj.org/problem?id=3981 #include <stdio.h> #include <string.h> #define MAX_LEN 1024 int main(int argc, char **argv) { char str[MAX_LEN]; int i, len; while(gets(str)) { len = strlen(str); for(i = 0; i < len; ++i) { if(‘y’ != str[i]) { putchar(str[i]); } else { … Continue reading

Posted in poj | Comments Off on Poj Solution 3981

Poj Solution 3980

http://poj.org/problem?id=3980 #include <stdio.h> int mod(int n, int m){ return n%m; } int main(){ int m,n; while(scanf("%d%d",&n,&m)!=EOF){ printf("%dn",mod(n,m)); } return 0; }

Posted in poj | Comments Off on Poj Solution 3980

Poj Solution 3979

http://poj.org/problem?id=3979 #include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> int gdb(int a,int b) { int tmp,ret; if(a < b) { tmp = a; a = b; b =tmp; } while(b) { tmp = a; a = b; b = tmp%b; … Continue reading

Posted in poj | Comments Off on Poj Solution 3979

Poj Solution 3934

http://poj.org/problem?id=3934 #include <stdio.h> int dp[81][201]; int main() { int n,m,i,j,k; for(i=1;i<=80;i++){ for(j=0,k=i-1;j<k;j++) dp[i][j]=0; } dp[1][0]=1; dp[2][1]=2; dp[3][2]=4; dp[3][3]=2; for(i=4;i<=80;i++){ for(j=i-1;j<=200;j++){ dp[i][j]=0; if(j>=2) dp[i][j]=(dp[i-1][j-2]*(i-2))%9937; if(j>=1) dp[i][j]=(dp[i][j]+dp[i-1][j-1]*2)%9937; } } while(scanf("%d%d",&n,&m),n||m){ if(m>=200) printf("0n"); else printf("%dn",dp[n][m]); } return 0; }

Posted in poj | Comments Off on Poj Solution 3934

Poj Solution 3768

http://poj.org/problem?id=3768 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNextInt()) { int n = sc.nextInt(); if (n == 0) break; sc.nextLine(); String[] template = new String[n]; for (int i = … Continue reading

Posted in poj | Comments Off on Poj Solution 3768

Poj Solution 3767

http://poj.org/problem?id=3767 import java.util.Scanner; public class Main{ public static void dijkstra(int[][] GA, int[] leader, int road) { if (road == 0) System.out.println(-1); else { int size = GA.length; // System.out.println(size); int[] dist = new int[size]; int[] isUsed = new int[size]; isUsed[1] … Continue reading

Posted in poj | Comments Off on Poj Solution 3767

Poj Solution 3763

http://poj.org/problem?id=3763 //* @author import java.util.*; import java.io.*; public class Main { static Scanner in = new Scanner(System.in); static class Node extends LinkedList< Node> { final int[] dp = new int[]{-1, -1}; int query(int b) { if(dp[b]< 0) init(null); return dp[b]; … Continue reading

Posted in poj | Comments Off on Poj Solution 3763

Poj Solution 3753

http://poj.org/problem?id=3753 import java.io.BufferedInputStream; import java.util.Scanner; /** * *poj3753 * C������� * while(EOF != scanf("%s",source)) *�ȼ���java���while (scan.hasNext()) * @author NC */ public class Main { public static void main(String[] args) { Scanner scan = new Scanner(new BufferedInputStream(System.in)); while (scan.hasNext()) { String … Continue reading

Posted in poj | Comments Off on Poj Solution 3753

Poj Solution 3752

http://poj.org/problem?id=3752 import java.io.BufferedInputStream; import java.util.Scanner; /** * *poj3752 * ģ�� * @author NC */ public class Main { public static void main(String[] args) { Scanner scan = new Scanner(new BufferedInputStream(System.in)); if (scan.hasNext()) { int m = scan.nextInt(); int n = … Continue reading

Posted in poj | Comments Off on Poj Solution 3752

Poj Solution 3751

http://poj.org/problem?id=3751 import java.io.BufferedInputStream; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Locale; import java.util.Scanner; import java.util.logging.Level; import java.util.logging.Logger; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * poj3751 easy * … Continue reading

Posted in poj | Comments Off on Poj Solution 3751

Poj Solution 3750

http://poj.org/problem?id=3750 #include <stdio.h> #include <string.h> int main() { int n, w, s; int i, j; char name[65][16]; scanf("%d", &n); getchar(); for (i=0; i<n; ++i) { gets(name[i]); } scanf("%d,%d", &w, &s); i = w-1; while (n != 0) { if (i+s-1 … Continue reading

Posted in poj | Comments Off on Poj Solution 3750

Poj Solution 3749

http://poj.org/problem?id=3749 #include<stdio.h> #include<string.h> int main() { void translate(char word[]); char start[20]; char end[20]; char word[205]; while(1) { gets(start); if(strcmp(start,"START")!=0) break; gets(word); translate(word); puts(word); gets(end); } } void translate(char word[]) { int i,len; len=strlen(word); for(i=0;i<len;i++) { if(word[i]>=’A’&&word[i]<=’E’) { word[i]+=21; } else … Continue reading

Posted in poj | Comments Off on Poj Solution 3749

Poj Solution 3748

http://poj.org/problem?id=3748 import java.io.BufferedInputStream; import java.util.Scanner; /** * *poj3748 * λ���� * @author NC */ public class Main { public static void main(String[] args) { Scanner scan = new Scanner(new BufferedInputStream(System.in)); if (scan.hasNext()) { String[] ss = scan.nextLine().trim().split("[,]"); Integer r = … Continue reading

Posted in poj | Comments Off on Poj Solution 3748

Poj Solution 3747

http://poj.org/problem?id=3747 //* @author /** * @version 2009/08/31 * @author sbzlyessit */ import java.io.*; import java.util.*; public class Main { private static BufferedReader in =new BufferedReader(new InputStreamReader(System.in)); private static StringTokenizer st; private static double[] x = new double[10], y = new … Continue reading

Posted in poj | Comments Off on Poj Solution 3747

Poj Solution 3744

http://poj.org/problem?id=3744 //* @author: <strong> import java.util.*; public class Main{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); double p,p1,p2,p3; while (sc.hasNext()) { int n=sc.nextInt(); int a[]=new int[n+1]; p=sc.nextDouble(); for (int i=1;i<=n;i++) a[i]=sc.nextInt(); if (a[1]==1) {System.out.println("0.0000000");continue;} int now=1; p1=0;p2=1; for (int … Continue reading

Posted in poj | Comments Off on Poj Solution 3744

Poj Solution 3742

http://poj.org/problem?id=3742 import java.math.BigInteger; import java.io.*; import java.util.*; public class Main { static int n; static BigInteger t=new BigInteger("1"); static BigInteger c[][] = new BigInteger [210][210]; /* static BigInteger C(int n,int m) { if(m==0||m==n) return BigInteger.ONE; BigInteger res=new BigInteger("1"); int i; … Continue reading

Posted in poj | Comments Off on Poj Solution 3742

Poj Solution 3740

http://poj.org/problem?id=3740 //* @author /** * @version 2009/08/28 * @author sbzlyessit */ import java.io.*; import java.util.*; public class Main { private static BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); private static StringTokenizer st; private static int[] matrix = new int[300]; public static … Continue reading

Posted in poj | Comments Off on Poj Solution 3740

Poj Solution 3737

http://poj.org/problem?id=3737 //* @author: <strong> import java.util.*; public class Main{ static final double pi=Math.PI; public static void main(String args[]){ Scanner sc=new Scanner(System.in); double s; while (sc.hasNext()) { s=sc.nextDouble(); double h=Math.sqrt(2*s/pi); double r=Math.sqrt(s*s/(pi*pi*h*h+2*pi*s)); double v=(1.0/3.0)*(s*s)*h/(pi*h*h+2*s); System.out.printf("%.2fn%.2fn%.2fn",v,h,r); } } }

Posted in poj | Comments Off on Poj Solution 3737

Poj Solution 3736

http://poj.org/problem?id=3736 //* @author: import java.io.*; import java.math.*; import java.util.*; import java.util.Comparator; import java.util.ArrayList; public class Main { public static class node { double x,y,s,r,d,t; node(double xx,double yy,double ss,double rr,double dd,double tt) { x=xx;y=yy;s=ss;r=rr;d=dd;t=tt; } double getx(){return x;} double gety(){return y;} … Continue reading

Posted in poj | Comments Off on Poj Solution 3736

Poj Solution 3734

http://poj.org/problem?id=3734 //* @author: ccQ.SuperSupper import java.io.*; import java.util.*; public class Main { /** * @param args * @return */ static int pow_mod(int a,int b,int c) { int r=1,d=a; while(b>0){ if((b&1)==1) r = r*d%c; d = d*d%c; b>>=1; } return r; … Continue reading

Posted in poj | Comments Off on Poj Solution 3734

Poj Solution 3723

http://poj.org/problem?id=3723 //* @author: //Kruskal �㷨: import java.io.*; import java.util.*; class cin { static int leave=0; static StringTokenizer st; static BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); static int nextInt() throws Exception { while (leave==0) { st=new StringTokenizer(in.readLine()); leave=st.countTokens(); } leave–; return Integer.parseInt(st.nextToken()); } … Continue reading

Posted in poj | Comments Off on Poj Solution 3723

Poj Solution 3720

http://poj.org/problem?id=3720 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; import java.util.StringTokenizer; /** * @author Administrator ѭ��С��+ѭ���� */ public class Main { /** *���� */ private int numerator; /** *��ĸ */ private int denominator; /** * ѭ���ڲ��ᳬ��100����� */ private static int … Continue reading

Posted in poj | Comments Off on Poj Solution 3720

Poj Solution 3708

http://poj.org/problem?id=3708 import java.util.*; import java.math.*; public class Main { static BigInteger x,y; static BigInteger[] a=new BigInteger[1000]; static BigInteger[] m=new BigInteger[1000]; static void egcd(BigInteger a,BigInteger b){ if(b.equals(BigInteger.ZERO)){ x=BigInteger.ONE; y=BigInteger.ZERO; return ; } egcd(b,a.mod(b)); BigInteger temp=y; y=x.subtract((a.divide(b)).multiply(y)); x=temp; } static BigInteger solve(int … Continue reading

Posted in poj | Comments Off on Poj Solution 3708

Poj Solution 3705

http://poj.org/problem?id=3705 //* @author: import java.util.Scanner; public class Main { Scanner cin = new Scanner(System.in); int n; public void inPut() { n = cin.nextInt(); reverse(); } private void reverse() { if (n == 1) { System.out.println(0); } else { if (n … Continue reading

Posted in poj | Comments Off on Poj Solution 3705

Poj Solution 3692

http://poj.org/problem?id=3692 //* @author: <strong>Yeming&nbsp;Hu</strong>&quot;cslittleye@gmail.com&quot; import java.util.*; public class Main { public static int b; public static int g; public static int m; public static boolean[][] graph; public static boolean[] checked; public static int[] link; public static void main(String[] args) { … Continue reading

Posted in poj | Comments Off on Poj Solution 3692

Poj Solution 3687

http://poj.org/problem?id=3687 /* @author: */ import java.util.Scanner; import java.util.Arrays; public class Main{ int degree[]=new int[210]; boolean visit[][]=new boolean[210][210]; int path[]=new int[210]; int n,m,t; void topsort(){ for(int k=n;k>=1;k–){ int i=n; while(i>=1 && degree[i]!=0) i–; if(i< 1){ System.out.printf("-1n"); return; } degree[i]=-1; path[i]=k; for(int … Continue reading

Posted in poj | Comments Off on Poj Solution 3687

Poj Solution 3677

http://poj.org/problem?id=3677 //* @author import java.util.*; import java.io.*; class Main { static int armor[]; final static int MAX = 1000000; static class Node { Node l = null, r = null; int flag, step, value; Node(int k, int v) { flag … Continue reading

Posted in poj | Comments Off on Poj Solution 3677

Poj Solution 3673

http://poj.org/problem?id=3673 import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner scanner=new Scanner(System.in); String str1=scanner.next(); String str2=scanner.next(); char[] array1=str1.toCharArray(); char[] array2=str2.toCharArray(); int sum1=0; for(int i=0;i< array1.length;i++){ sum1+=array1[i]-48; } int sum2=0; for(int i=0;i< array2.length;i++){ sum2+=array2[i]-48; } System.out.println(""+(sum1*sum2)); } }

Posted in poj | Comments Off on Poj Solution 3673

Poj Solution 3672

http://poj.org/problem?id=3672 //* @author ������&lt;hongxp11@163.com&gt; import java.util.Scanner; public class Main { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner(System.in); int M = in.nextInt(); int T = in.nextInt(); int … Continue reading

Posted in poj | Comments Off on Poj Solution 3672

Poj Solution 3671

http://poj.org/problem?id=3671 import java.util.Scanner; import java.util.Arrays; public class Main{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); int n; int v[]=new int[30002]; int f[]=new int[30002]; int g[]=new int[30002]; n=sc.nextInt(); for(int i=1;i<=n;i++) v[i]=sc.nextInt(); f[0]=0; g[n+1]=0; for(int i=1;i<=n;i++){ if(v[i]==2) f[i]=f[i-1]+1; else f[i]=f[i-1]; } … Continue reading

Posted in poj | Comments Off on Poj Solution 3671

Poj Solution 3670

http://poj.org/problem?id=3670 /* @author: */ import java.util.Scanner; import java.util.Arrays; public class Main{ static int mintwo(int a,int b){ return a< b?a:b; } static int minthird(int a,int b,int c){ int temp=mintwo(a,b); return mintwo(temp,c); } public static void main(String args[]){ Scanner sc=new Scanner(System.in); int … Continue reading

Posted in poj | Comments Off on Poj Solution 3670

Poj Solution 3665

http://poj.org/problem?id=3665 /* @author: */ import java.util.Scanner; import java.util.Arrays; public class Main{ public static void main(String args[]) { Scanner sc=new Scanner(System.in); int arr[]=new int[10010]; int n,m,i,j,u; n=sc.nextInt(); m=sc.nextInt(); for(i=0;i< n;i++) arr[i]=sc.nextInt(); for(i=0;i< m;i++) { int maxx=-1,tag=0; for(j=0;j< n;j++) if(arr[j]>maxx) { maxx=arr[j]; … Continue reading

Posted in poj | Comments Off on Poj Solution 3665

Poj Solution 3664

http://poj.org/problem?id=3664 //* @author ������&lt;hongxp11@163.com&gt; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Scanner; public class Main { static class vote { int first; int second; int index; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int N … Continue reading

Posted in poj | Comments Off on Poj Solution 3664

Poj Solution 3663

http://poj.org/problem?id=3663 //* @author: 82638882@163.com import java.util.*; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); int a=in.nextInt(); int b=in.nextInt(); ArrayList< Integer> arr=new ArrayList< Integer>(); for(int i=0;i< a;i++) arr.add(in.nextInt()); Collections.sort(arr); int count=0; for(int i=0;i< a-1;i++) { int … Continue reading

Posted in poj | Comments Off on Poj Solution 3663

Poj Solution 3660

http://poj.org/problem?id=3660 //* @author popop0p0popo import java.util.*; import java.io.*; public class Main{ public static void main(String[] args){ Scanner in=new Scanner(new BufferedReader(new InputStreamReader(System.in))); int n=in.nextInt(); int m=in.nextInt(); int[][] p=new int[n][n]; for (int i=0;i< n ;i++ ){ for (int j=0;j< n ;j++ ){ … Continue reading

Posted in poj | Comments Off on Poj Solution 3660

Poj Solution 3658

http://poj.org/problem?id=3658 //* @author /** * @version 2009/08/21 * @author sbzlyessit */ import java.io.*; import java.util.*; public class Main { private static final int MAX_N = 100000; private static BufferedReader in =new BufferedReader(new InputStreamReader(System.in)); private static StringTokenizer st; private static int[] … Continue reading

Posted in poj | Comments Off on Poj Solution 3658

Poj Solution 3657

http://poj.org/problem?id=3657  

Posted in poj | Comments Off on Poj Solution 3657

Poj Solution 3653

http://poj.org/problem?id=3653 //* @author: SmilingWang import java.util.*; import java.io.*; public class Main { static final int INF = 100000000; public static void main(String[] args){ Scanner in = new Scanner(new BufferedInputStream(System.in)); int x = in.nextInt(); int y = in.nextInt(); while(x != 0 … Continue reading

Posted in poj | Comments Off on Poj Solution 3653