Meta
-
Recent Posts
Recent Comments
Archives
- May 2024
- April 2023
- February 2023
- January 2023
- December 2022
- November 2022
- September 2022
- June 2022
- July 2021
- January 2021
- February 2020
- September 2019
- March 2018
- February 2018
- August 2016
- July 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- May 2014
- April 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013
- September 2013
- August 2013
- July 2013
- June 2013
- May 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- November 2012
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
Categories

Category Archives: poj
Poj Solution 2189
http://poj.org/problem?id=2189 #include <stdio.h> #include <algorithm> #include <memory.h> using namespace std; int n,p,c; int s[1001]; int main() { int i, j, k; scanf( "%d %d %d", &n, &p, &c ); memset( s, 0, sizeof( s ) ); for( i=0; i<n; i++ … Continue reading
Posted in poj
Leave a comment
Poj Solution 2188
http://poj.org/problem?id=2188 //* @author: 82638882@163.com import java.io.*; public class Main{ static long ans=0; public static void main(String[] args) throws NumberFormatException, IOException { InputStreamReader is=new InputStreamReader(System.in); BufferedReader in=new BufferedReader(is); int a=Integer.parseInt(in.readLine()); ans=0; int[] arr=new int[a]; int[] aww=new int[a]; for(int i=0;i< a;i++) { … Continue reading
Posted in poj
Leave a comment
Poj Solution 2187
http://poj.org/problem?id=2187 #include"stdio.h" #include"math.h" #include<vector> #include<algorithm> using namespace std; //////////////////////////////// typedef int Type;/*????????*/ //////////////////////////////// //???????? struct point { Type x,y; point(){x=y=0;} point(Type x,Type y):x(x),y(y){;} bool operator==(point &a){return x==a.x&&y==a.y;} }; //???? inline Type cheng(point a,point b,point c) {return (b.x-a.x)*(c.y-a.y)-(c.x-a.x)*(b.y-a.y);} inline Type cheng(point … Continue reading
Posted in poj
Leave a comment
Poj Solution 2186
http://poj.org/problem?id=2186 //PKU_2186_Popular Cows_ǿlͨ��_���(kosaraju) #include <iostream> using namespace std; struct Point { int Index; Point *Next; Point(int index = 0) { Index = index; Next = NULL; } }; struct HeadPoint { Point *List; Point *LastPoint; HeadPoint() { List = NULL; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2185
http://poj.org/problem?id=2185 #include <stdio.h> char map[10000][80]; int n,m; bool sign[75][10000]; int main() { int i, j, n, m, k, h, l; bool key; scanf( "%d %d", &n, &m ); for( i=0; i<n; i++ ) scanf( "%s", map[i] ); for( k=1; k<m; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2184
http://poj.org/problem?id=2184 #include <stdio.h> #include <memory.h> #include <algorithm> #include <functional> using namespace std; bool mem[200100],*sign = mem+100000; int mem2[200100],*ans = mem2+100000; typedef pair<int,int> node; node c[100]; int n; node mem3[2][100000],*s = mem3[0], *t = mem3[1]; int sn,tn; int main() { int … Continue reading
Posted in poj
Leave a comment
Poj Solution 2183
http://poj.org/problem?id=2183 //* @author: <strong> import java.util.*; public class Main { private int t; private int b[]; public Main(int t){ this.t=t; b=new int[1000000]; } private void doIt(){ int st=0; while(true){ t/=10; t%=10000;//ȡt���м���λ t*=t;//ƽ�� t%=1000000;//ȡt�ĺ���λ if (b[t]!=0){//���t���ֹ�,����ѭ���� st++; System.out.println(t+" "+(st-b[t])+" "+st);//ѭ���ڵĵ�һ����ѭ���ڴ�С����Ҫ���η���ѭ���� break; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2182
http://poj.org/problem?id=2182 /* @author: */ import java.util.Scanner; public class Main{ public static void main(String args[]) { int p[]=new int[8010]; int q[]=new int[8080]; int n,k; Scanner sc=new Scanner(System.in); n=sc.nextInt(); p[0]=0; for(int i=1;i< n;i++) { k=sc.nextInt(); for(int j=i;j>k;j–) p[j]=p[j-1]; p[k]=i; } for(int i=0;i< … Continue reading
Posted in poj
Leave a comment
Poj Solution 2181
http://poj.org/problem?id=2181 //* @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(); boolean flag=true; int sum=0; int[] arr=new int[a+1]; for(int i=0;i< a;i++) arr[i]=in.nextInt(); for(int i=0;i< a;i++) { if(flag) { if(arr[i]>arr[i+1]) { … Continue reading
Posted in poj
Leave a comment
Poj Solution 2175
http://poj.org/problem?id=2175 #include <memory.h> #include <stdio.h> #include <stdlib.h> #include <math.h> #define y1 yy1 const int size = 210; int dis[size][size], n, m; int x1[100], y1[100], x2[100], y2[100]; int s2[100], lim2[100]; int f[100][100]; inline int distance( int i, int j ) { … Continue reading
Posted in poj
Leave a comment
Poj Solution 2173
http://poj.org/problem?id=2173 #include <stdio.h> #include <memory.h> #include <algorithm> using namespace std; typedef pair<int,int> point; int w, h, n; int a[110], x[110], y[110], m; point p[110]; void init( ) { int i, xx, yy; m = 0; n = 0; scanf( "%d … Continue reading
Posted in poj
Leave a comment
Poj Solution 2172
http://poj.org/problem?id=2172 /* @author: */ import java.util.Scanner; public class Main { static final double EPS =1e-7; //����x*y �ܷ���� a*b �� static boolean canfit( double a, double b, double x, double y ) { double t; double l=Math.sqrt(x*x+y*y),ll=x*x+y*y; if(x*x+y*y – a*a-b*b > … Continue reading
Posted in poj
Leave a comment
Poj Solution 2163
http://poj.org/problem?id=2163 //* @author: import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int m=sc.nextInt(); int n=sc.nextInt(); int k=sc.nextInt(); node a[]=new node[k+1]; for(int i=0;i<=k;i++) a[i]=new node(); for (int i=1;i<=k;i++) { a[i].p=sc.nextDouble(); a[i].pm=a[i-1].pm+a[i].p; a[i].pn=a[i-1].pn+a[i].p; if … Continue reading
Posted in poj
Leave a comment
Poj Solution 2159
http://poj.org/problem?id=2159 import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Main { public static void main(String[] args) throws Exception { BufferedReader read = new BufferedReader(new InputStreamReader( System.in)); String chips = null; String source; boolean flg; while ((chips … Continue reading
Posted in poj
Leave a comment
Poj Solution 2155
http://poj.org/problem?id=2155 import java.util.Scanner; public class Main { private static int[][] matrix = new int[1001][1001]; private static int n; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int testNum = sc.nextInt(); for (int i = 0; i < … Continue reading
Posted in poj
Leave a comment
Poj Solution 2153
http://poj.org/problem?id=2153 //* @author: 82638882@163.com import java.util.HashMap; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); int n=in.nextInt(); int[] arr=new int[n]; HashMap< String,Integer> hs=new HashMap< String,Integer>(); String s=in.nextLine(); int tag=-1; for(int i=0;i< n;i++) { s=in.nextLine(); … Continue reading
Posted in poj
Leave a comment
Poj Solution 2141
http://poj.org/problem?id=2141 //* @author popop0p0popo import java.util.*; import java.io.*; public class Main{ public static void main(String[] args){ Scanner scanner=new Scanner(new BufferedReader(new InputStreamReader(System.in))); String code=scanner.nextLine(); String sent=scanner.nextLine(); String decode=""; for (int i=0;i< sent.length() ;i++ ){ decode=decode+getChar(sent.charAt(i),code); } System.out.print(decode); } public static char … Continue reading
Posted in poj
Leave a comment
Poj Solution 2140
http://poj.org/problem?id=2140 import java.util.*; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); while(cin.hasNext()) { int num = cin.nextInt(); int ways = 1; int index = num/2+1; for(int i = index; i > 1; i–) … Continue reading
Posted in poj
Leave a comment
Poj Solution 2138
http://poj.org/problem?id=2138 #include <iostream> #include <string> #include <vector> #include <cstring> #include <algorithm> using namespace std; int D; string ori; string v[1005]; int l[1005]; int longgest; bool visited[1005]; vector<string> vre; void search(string &str,int z) { bool Find = false; visited[z] = true; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2137
http://poj.org/problem?id=2137 #include <iostream> #include <cmath> #include <cstdio> using namespace std; int map[2][50][202]; int len[202]; int N; int S; double calc(double x1,double y1,double x2,double y2) { return sqrt((x1 – x2) * (x1 – x2) + (y1 – y2) * (y1 – … Continue reading
Posted in poj
Leave a comment
Poj Solution 2135
http://poj.org/problem?id=2135 #include<iostream> #include"stdio.h" #include"vector" using namespace std; struct edge { int from; int to; int len; int opp; }; vector<edge> e[1010]; int from[1010],dis[1010],n,m; bool sign[1010]; edge *along[1010]; void dijstra() { int i,j,k,to; for(i=0;i<n;i++) { sign[i]=0; dis[i]=999999999; } sign[0]=0; from[0]=-1; dis[0]=0; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2133
http://poj.org/problem?id=2133 #include<iostream> using namespace std; long a[140000],s[140000]; int main() { long i,n,m,j;long result; long begin[200],st,k,ss; char c; while(1) { cin>>m>>n; if(cin.fail())break; long h; h=(1<<16); result=0; for(j=0;j<m;j++) { cin>>c; result*=2; result+=c-‘0’; } for(i=0;i<n;i++) { begin[i]=0; for(j=0;j<m;j++) { cin>>c; begin[i]*=2; begin[i]+=c-‘0’; } … Continue reading
Posted in poj
Leave a comment
Poj Solution 2132
http://poj.org/problem?id=2132 //* @author:alpc12 import java.io.*; import java.util.*; import java.math.*; public class Main { static int N = 26; int n; int M; int[][] adj = new int[26][26]; boolean[] chk = new boolean[26]; boolean DFS(int K, int m) { chk[m] = … Continue reading
Posted in poj
Leave a comment
Poj Solution 2127
http://poj.org/problem?id=2127 /* @author: */ import java.util.*; public class Main { static int ans[][], xf[][], yf[][]; static int as[][], len[]; static public void main( String [] str ) throws Exception{ Scanner cin = new Scanner(System.in); int n = cin.nextInt(), m; int … Continue reading
Posted in poj
Leave a comment
Poj Solution 2126
http://poj.org/problem?id=2126 //* @author popop0p0popo import java.util.*; import java.io.*; public class Main{ public static void main(String[] args){ Scanner scanner=new Scanner(new BufferedReader(new InputStreamReader(System.in))); int n=Integer.parseInt(scanner.nextLine()); if (n< 2){ System.out.println("YES"); } else if (n==2){ int a=scanner.nextInt(); int b=scanner.nextInt(); int c=scanner.nextInt(); if (b*b-4*a*c>=0){ System.out.println("NO"); … Continue reading
Posted in poj
Leave a comment
Poj Solution 2121
http://poj.org/problem?id=2121 //* @author: 82638882@163.com import java.io.*; import java.util.*; public class Main { static String[] Num=new String[]{ "zero","one","two","three","four","five","six","seven","eight","nine","ten", "eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen", "nineteen","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety", "hundred","thousand","million" }; public static void main(String[] args) throws IOException { InputStreamReader is=new InputStreamReader(System.in); BufferedReader in=new BufferedReader(is); String s; while(true) { s=in.readLine(); … Continue reading
Posted in poj
Leave a comment
Poj Solution 2114
http://poj.org/problem?id=2114 #include <vector> #include <stdio.h> #include <algorithm> using namespace std; typedef pair< int, int > edge; vector< edge > e[10010]; int v[10010],s[10010]; int st[10010],sn; bool sign[10010]; int n; int find_root_search( int r, int f ) { int temp,i,j; v[r] = … Continue reading
Posted in poj
Leave a comment
Poj Solution 2112
http://poj.org/problem?id=2112 #include<iostream> using namespace std; #define null 0 const int size=1010; long dis[size][size],k,m,c,up,w[size][size]; int maxmatch(int n,int m,long w[][size],int *p) { int p_n[size]; int p_m[size]; bool sign[size]; int q[size],from[size],s,t; int i,j,link,now,h; for(i=0;i<n;i++)p_n[i]=-1; for(j=0;j<m;j++)p_m[j]=-1; for(i=0;i<n;i++) if(p_n[i]==-1) { for(j=0;j<m;j++)sign[j]=0; s=1;link=-1; from[0]=-1; q[0]=size-1; p_m[size-1]=i; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2109
http://poj.org/problem?id=2109 import java.math.BigInteger; import java.util.Scanner; public class Main { static final BigInteger TWO = new BigInteger("2"); static final BigInteger ONE = BigInteger.ONE; public static void main(String[] args) { Scanner in = new Scanner(System.in); // k^n=p findK; BigInteger p; int n; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2105
http://poj.org/problem?id=2105 import java.util.*; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); int num = Integer.valueOf(cin.nextLine()).intValue(); for(int i = 0; i < num; i++) { String str, temp; int a,b,c,d = 0; StringBuffer sb … Continue reading
Posted in poj
Leave a comment
Poj Solution 2104
http://poj.org/problem?id=2104 //* @author: 82638882@163.com import java.io.*; import java.util.Arrays; class Main { public static void main(String[] args) throws IOException { InputStreamReader is=new InputStreamReader(System.in); BufferedReader in=new BufferedReader(is); String[] ss=in.readLine().split(" "); int a=Integer.parseInt(ss[0]); int k=Integer.parseInt(ss[1]); my[] p=new my[a]; ss=in.readLine().split(" "); for(int i=0;i< a;i++) … Continue reading
Posted in poj
Leave a comment
Poj Solution 2103
http://poj.org/problem?id=2103 //* @author: import java.math.BigInteger; import java.util.Scanner; public class Main { static int oneNum[] = new int[65536]; static BigInteger arr[] = new BigInteger[20]; static int n; static BigInteger list[] = new BigInteger[65536]; public static void main(String[] args) { for(int i … Continue reading
Posted in poj
Leave a comment
Poj Solution 2101
http://poj.org/problem?id=2101 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); int n = cin.nextInt(); int e = cin.nextInt(); double l1 = 0, l2 = 0; while(–n > 0) { l1 += cin.nextInt(); … Continue reading
Posted in poj
Leave a comment
Poj Solution 2092
http://poj.org/problem?id=2092 //* @author: 82638882@163.com import java.io.*; import java.util.*; import java.util.Map.Entry; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { InputStreamReader is=new InputStreamReader(System.in); BufferedReader in=new BufferedReader(is); HashMap< Integer,Integer> ts=new HashMap< Integer,Integer>(); while(true) { String[] ss=in.readLine().split(" "); int … Continue reading
Posted in poj
Leave a comment
Poj Solution 2088
http://poj.org/problem?id=2088 #include<iostream> #include"algorithm" using namespace std; int dis[21][21]; int tim[21],n; int id[21],mint[21]; int cmp(int a,int b) { return mint[a]<mint[b]; } void init() { int i,j,k; for(i=0;i<n;i++) cin>>tim[i]; for(i=0;i<n;i++) for(j=0;j<n;j++) { cin>>dis[i][j]; } for(k=0;k<n;k++) for(i=0;i<n;i++) for(j=0;j<n;j++) if(dis[i][k]+dis[k][j]<dis[i][j]) dis[i][j]=dis[i][k]+dis[k][j]; for(i=0;i<n;i++) { mint[i]=9999;id[i]=i; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2087
http://poj.org/problem?id=2087 #include<iostream> #include"stdio.h" #include"math.h" #include<algorithm> using namespace std; ///////////////////////// #define Type double /*�������*/ ///////////////////////// struct point { Type x,y; int host; }; const double pi=3.1415926535898; inline Type cheng(point a,point b,point c) {return (b.x-a.x)*(c.y-a.y)-(c.x-a.x)*(b.y-a.y);} inline Type dcheng(point a,point b,point c) {return … Continue reading
Posted in poj
Leave a comment
Poj Solution 2085
http://poj.org/problem?id=2085 import java.util.Scanner; public class Main{ public static void main(String args[]){ int n,m; int i,j,k,sum; Scanner sc=new Scanner(System.in); while(true) { n=sc.nextInt(); m=sc.nextInt(); if(n==-1&&m==-1)break; sum=0; for(i=n;i>=1;i–) { sum+=(n-i); if(sum>=m)break; } for(j=1;j< i;j++) System.out.printf("%d ",j); k=m+i-(n-i)*(n-i-1)/2; System.out.printf("%d",k); for(j=n;j>=i;j–) if(j!=k) System.out.printf(" %d",j); System.out.printf("n"); … Continue reading
Posted in poj
Leave a comment
Poj Solution 2084
http://poj.org/problem?id=2084 import java.io.*; import java.util.*; import java.math.BigInteger; public class Main { public static void main(String[]args){ Scanner sin=new Scanner(new BufferedInputStream(System.in)); int n; int i = 0; BigInteger big[] = new BigInteger[101]; for(i = 0 ; i < 101 ; i++) big[i] … Continue reading
Posted in poj
Leave a comment
Poj Solution 2083
http://poj.org/problem?id=2083 //* @author: 82638882@163.com import java.util.Scanner; class Main { static StringBuffer sb=new StringBuffer(); public static void main(String[] args) { Scanner in=new Scanner(System.in); while(true) { int a=in.nextInt(); if(a==-1) break; else if(a==1) System.out.println(‘X’); else g("",a-1); System.out.println("-"); } } static void p(int a) … Continue reading
Posted in poj
Leave a comment
Poj Solution 2082
http://poj.org/problem?id=2082 //* @author: 82638882@163.com import java.io.*; public class Main { static int[] p,b,c,w; static int a; public static void main(String[] args) throws IOException { InputStreamReader is=new InputStreamReader(System.in); BufferedReader in=new BufferedReader(is); while(true) { String[] ss=in.readLine().split(" "); a=Integer.parseInt(ss[0]); if(a==-1)break; p=new int[a+2]; b=new … Continue reading
Posted in poj
Leave a comment
Poj Solution 2080
http://poj.org/problem?id=2080 import java.util.*; import java.lang.*; import java.io.*; import java.text.*; public class Main{ public static void main(String[] args) throws IOException{ Date twoK,res,t1,t2; long twoKl,resl,t; //��EEEE������4λΪȫ�ƣ������Ϻ���ġ�Locale.US�������ڻ��������Ŷ�� SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd EEEE",Locale.US); //BufferedInputStream bin = new BufferedInputStream(new FileInputStream("in.txt")); //System.setIn(bin); Scanner cin = … Continue reading
Posted in poj
Leave a comment
Poj Solution 2079
http://poj.org/problem?id=2079 #include<iostream> #include"stdio.h" #include<algorithm> //ifstream in("triangle.in"); //#define cin in using namespace std; ///////////////////////// #define Type long /*�������*/ ///////////////////////// struct point {Type x,y; point(){x=y=0;} point(Type &x,Type &y):x(x),y(y){;} bool operator==(point &a){return x==a.x&&y==a.y;} }; int cmp_x_y(point a,point b) {return a.y<b.y||(a.y==b.y&&a.x<b.x);} void sort(point *a,int … Continue reading
Posted in poj
Leave a comment
Poj Solution 2078
http://poj.org/problem?id=2078 #include "stdio.h" int a[10][10], ans, n; int k[10],sum[10]; void doit( int s ) { int i, maxv; if( s == n ) { maxv = -1; for( i=0; i<n; i++ ) if( sum[i] > maxv ) maxv = sum[i]; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2076
http://poj.org/problem?id=2076 #include<iostream> #include"algorithm" using namespace std; int dist[101][101],n,m; void init() { int i,a,b,d,j,k; cin>>n>>m; for(i=0;i<n;i++) for(j=0;j<n;j++) dist[i][j]=9999; for(i=0;i<m;i++) { cin>>a>>b>>d; a–;b–; if(d<dist[a][b]) { dist[a][b]=dist[b][a]=d; } } for(i=0;i<n;i++) dist[i][i]=0; for(k=0;k<n;k++) for(i=0;i<n;i++) for(j=0;j<n;j++) if(dist[i][k]+dist[k][j]<dist[i][j]) dist[i][j]=dist[i][k]+dist[k][j]; return ; } int answer[101]; int c1,c2; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2075
http://poj.org/problem?id=2075 //* @author: SmilingWang import java.util.*; public class Main { public static final int BLOCK = Integer.MAX_VALUE; public static final double zero = 1e-6; public static double cl; public static void main(String[] args){ Scanner in = new Scanner(System.in); cl = … Continue reading
Posted in poj
Leave a comment
Poj Solution 2070
http://poj.org/problem?id=2070 //* @author: 82638882@163.com import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); while(in.hasNext()) { float a=in.nextFloat(); float b=in.nextFloat(); float c=in.nextFloat(); if(a==0&&b==0&&c==0) break; boolean s=true; if(a<=4.5&&b>=150&&c>=200){ System.out.print("Wide Receiver "); s=false; } if(a<=6&&b>=300&&c>=500){ System.out.print("Lineman "); … Continue reading
Posted in poj
Leave a comment
Poj Solution 2069
http://poj.org/problem?id=2069 #include<iostream> #include"stdio.h" #include"math.h" using namespace std; #define sq(a) ((a.x)*(a.x)+(a.y)*(a.y)+(a.z)*(a.z)) int n; typedef double det[3][3]; struct point { double x,y,z; }; double hls(det a) { return a[0][0]*a[1][1]*a[2][2]+a[0][1]*a[1][2]*a[2][0]+a[0][2]*a[1][0]*a[2][1] -a[0][2]*a[1][1]*a[2][0]-a[0][1]*a[1][0]*a[2][2]-a[0][0]*a[1][2]*a[2][1]; } bool qiujie(det s,double s0,double s1,double s2,point &o) { det t={{s0,s[0][1],s[0][2]},{s1,s[1][1],s[1][2]},{s2,s[2][1],s[2][2]}}; double … Continue reading
Posted in poj
Leave a comment
Poj Solution 2064
http://poj.org/problem?id=2064 //* @author:alpc12 import java.io.*; import java.util.*; class Layer { int cost; int frontier[]; int frontierCode; Layer(int f[], int c) { cost = c; frontier = new int[f.length]; frontierCode = 0; for (int i=0; i< frontier.length; i++) frontier[i] = f[i]; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2061
http://poj.org/problem?id=2061 //* @author:alpc12 /* Sample solution to D – Pseudo random numbers / Mikael Goldmann * First count backwards to recreate the seed number * The count forwards to get T:th number. Try using few columns to * save space. … Continue reading
Posted in poj
Leave a comment
Poj Solution 2060
http://poj.org/problem?id=2060 #include <memory.h> #include <stdio.h> #include <math.h> #define null 0 #define y1 yy1 const int size = 510; //size must be bigger than n and m. //nС��mʱЧ�ʸ� int maxmatch( int n, int m, bool w[][size], int *p) { int p_n[size]; … Continue reading
Posted in poj
Leave a comment