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
Monthly Archives: August 2012
Poj Solution 2255
http://poj.org/problem?id=2255 import java.util.Scanner; public class Main { private static char[] seq = new char[100]; private static int s = -1; public static void getPostOrder(String pre, String in) { if (pre.length() == 1 && in.length() == 1) { seq[++s] = in.charAt(0); … Continue reading
Posted in poj
Leave a comment
Poj Solution 2253
http://poj.org/problem?id=2253 //* @author //import java.io.File; //import java.io.FileNotFoundException; //import java.util.Arrays; import java.util.Scanner; public class Main{ Scanner cin = new Scanner(System.in); int n; int cases; int stone[][]; double map[][]; public void inPut() { //File f = new File("D:\ACM\POJ����\2253\test.txt"); // cin = new … Continue reading
Posted in poj
Leave a comment
Poj Solution 2251
http://poj.org/problem?id=2251 //* @author: import java.util.*; class point { int x; int y; int z; int step; public point(int x,int y,int z,int step){ this.x=x; this.y=y; this.z=z; this.step=step; } public int getX(){ return this.x; } public int getY(){ return this.y; } public … Continue reading
Posted in poj
Leave a comment
Poj Solution 2250
http://poj.org/problem?id=2250 import java.io.BufferedInputStream; import java.util.Scanner; public class Main{ private static final int MAXLEN = 101; private static int[][] c = new int[MAXLEN][MAXLEN]; private static int[][] b = new int[MAXLEN][MAXLEN]; public static void main(String[] args) { Scanner scan = new Scanner(new … Continue reading
Posted in poj
Leave a comment
Poj Solution 2249
http://poj.org/problem?id=2249 //* @author mekarlos@gmail.com import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { static long[][] M=new long[2000][2000]; public static long comb(int n,int k){ if(k>(n/2))k=n-k; if(n< 2000&&k< 2000) return M[n][k]; else if(k==n||k==0) return 1; else if(k==1) return n; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2248
http://poj.org/problem?id=2248 /* @author: */ import java.util.Scanner; public class Main{ static int arr[]=new int[20]; static int n,minn; static int save[]=new int[20]; static void bfs(int a) { int i,j; if(a>=minn)return; if(arr[a-1]==n) { if(a< minn){ minn=a; for(i=0;i< a;i++) save[i]=arr[i]; } return; } for(i=a-1;i>=0;i–) … Continue reading
Posted in poj
Leave a comment
Poj Solution 2247
http://poj.org/problem?id=2247 //* @author: 82638882@163.com import java.util.*; public class Main { public static void main(String[] args) { TreeSet< Integer> t=new TreeSet< Integer>(); for(int i=0;i< 50;i++) { if(Math.pow(2, i)>2000000000) break; for(int j=0;;j++) { int ans2=(int)(Math.pow(2, i)*Math.pow(3, j)); if(ans2>2000000000) break; for(int k=0;;k++) { … Continue reading
Posted in poj
Leave a comment
Poj Solution 2245
http://poj.org/problem?id=2245 //* @author: 82638882@163.com import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); int count=0; while(true) { count++; if(count!=1) System.out.println(); int a=in.nextInt(); if(a==0) break; int[] b=new int[a]; for(int i=0;i< a;i++) b[i]=in.nextInt(); for(int a1=0;a1< a-5;a1++) … Continue reading
Posted in poj
Leave a comment
Poj Solution 2244
http://poj.org/problem?id=2244 //* @author: 82638882@163.com import java.util.*; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); while(true) { int n=in.nextInt(); if(n==0)break; int i,j,m=1; while(true) { i=0; j=n-1; while(j!=0) { i=(i+m-1)%j; j–; if(i==0) break; } if(j==0) { System.out.println(m); … Continue reading
Posted in poj
Leave a comment
Poj Solution 2243
http://poj.org/problem?id=2243 import java.util.*; public class Main { private static int[][] position = new int[8][2]; private static int[][] chessboard = new int[8][8]; public Main() { initPosition(); } /** * ��ʼ��������ߵķ��� */ private static void initPosition() { position[0][0] = -2; position[0][1] = … Continue reading
Posted in poj
Leave a comment
Poj Solution 2242
http://poj.org/problem?id=2242 //* @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))); double[] x,y; double k1,k2,b1,b2,ox,oy; double r; while (scanner.hasNext()){ x=new double[3]; y=new double[3]; for (int i=0;i< 3 ;i++ ){ x[i]=scanner.nextDouble(); … Continue reading
Posted in poj
Leave a comment
Poj Solution 2241
http://poj.org/problem?id=2241 import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Scanner; public class Main { /** * @param args */ public static void main(String[] args) { Scanner cin = new Scanner(System.in); int kase = 0; while (true) { int n … Continue reading
Posted in poj
Leave a comment
Poj Solution 2240
http://poj.org/problem?id=2240 import java.util.*; public class Main { static int c=0; static String[] str; static double[][] map; static double[] v; static int n,m; static boolean[] visited; public static void main(String[] args){ Main p=new Main(); Scanner cin=new Scanner(System.in); while(true){ c++; n=cin.nextInt(); if(n==0) … Continue reading
Posted in poj
Leave a comment