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: September 2013
Poj Solution 2564
http://poj.org/problem?id=2564 #include "stdio.h" #include "string.h" #include "vector" using namespace std; const int size = 25000; vector< char* > s1[18][26]; vector< char* > s2[18][26]; char w[size][17]; int ans[size],len[size]; bool check( char *a, char *b ) { int la = len[ ( … Continue reading
Posted in poj
Leave a comment
Poj Solution 2563
http://poj.org/problem?id=2563 #include<iostream> using namespace std; int d=0,m=0; inline void data(long g) {cout<<g/10000<<"-"; g%=10000;if(g/1000==0)cout<<‘0’; cout<<g/100<<"-"; g%=100;if(g/10==0)cout<<‘0’; cout<<g<<‘ ‘; } inline void demerit() {cout<<d<<" demerit point(s)."<<endl;} inline void merit() {cout<<m<<" merit point(s)."<<endl;} inline void none() {cout<<"No merit or demerit points."<<endl;} int main() … Continue reading
Posted in poj
Leave a comment
Poj Solution 2562
http://poj.org/problem?id=2562 //* @author ������<hongxp11@163.com> import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); while(true) { String first = in.next(); String second = in.next(); //System.out.println(first.length()+" "+second.length()); if(first.equals("0") && second.equals("0")) { break; } int … Continue reading
Posted in poj
Leave a comment
Poj Solution 2560
http://poj.org/problem?id=2560 /* @author: */ import java.util.Scanner; import java.util.Arrays; public class Main{ static double INF=99999999.0; public static void main(String args[]) { Scanner sc=new Scanner(System.in); double p[][]=new double[101][101]; double ax[]=new double[101]; double ay[]=new double[101]; double dis[]=new double[101]; boolean used[]=new boolean[101]; int n,i,j; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2559
http://poj.org/problem?id=2559 //* @author: 82638882@163.com import java.io.*; public class Main { static int[] p,b,c; 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==0) break; p=new int[a+2]; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2557
http://poj.org/problem?id=2557 #include<iostream> #include"string.h" using namespace std; int width[210],n; int ans[210][210]; char fold[210]; bool init() { int i,j; cin>>fold; if(cin.fail())return 0; n=strlen(fold); for(i=0;i<n;i++) { for(j=1;i+j<n&&i-j>=0&&fold[i+j]+fold[i-j]==’A’+’V’;j++) ; width[i]=j; } return 1; } inline int get_ans(int a,int b) { return (a>b)?0:ans[a][b]; } void … Continue reading
Posted in poj
Leave a comment
Poj Solution 2556
http://poj.org/problem?id=2556 //* @author: 82638882@163.com import java.util.*; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); while(in.hasNext()) { String s=in.next(); System.out.println("300 420 moveto"); System.out.println("310 420 lineto"); int b=0; int x=310; int y=420; for(int i=0;i< s.length();i++) { char … Continue reading
Posted in poj
Leave a comment
Poj Solution 2555
http://poj.org/problem?id=2555 /* @author:zeropinzuo */ import java.io.*; import java.util.*; import java.text.DecimalFormat; public class Main{ static Scanner cin; static double ci = 2.09, cw = 4.19; static double em = 335; public static void main(String args[]){ cin = new Scanner(System.in); while(run()) ; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2553
http://poj.org/problem?id=2553 #include"stdio.h" #include"memory.h" #include"list" using namespace std; long sign[5010]; long st[5010],s; long ok[5010]; long v; list<int> out[5000],in[5000]; void find(int a) {list<int>::iterator iter; sign[a]=1; for(iter=out[a].begin();iter!=out[a].end();iter++) { if(sign[*iter]==0)find(*iter); } st[s++]=a; } int sink; void find_too(int a) {list<int>::iterator iter; sign[a]=sink; for(iter=in[a].begin();iter!=in[a].end();iter++) { if(sign[*iter]!=0&&sign[*iter]!=sink)ok[sign[*iter]]=1; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2552
http://poj.org/problem?id=2552 //* @author: 82638882@163.com import java.util.*; public class Main { public static void main(String[] args) { ArrayList< Integer> a=new ArrayList< Integer>(); for(int i=2;i< 35000;i++) a.add(i); int count=0; while(count< a.size()) { for(int i=count+a.get(count);i< a.size();i+=a.get(count)) a.set(i, 0); for(int i=0;i< a.size();i++) if(a.get(i)==0){ a.remove(i); … Continue reading
Posted in poj
Leave a comment
Poj Solution 2551
http://poj.org/problem?id=2551 //* @author ������<hongxp11@163.com> import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); while(in.hasNext()) { int input = in.nextInt(); int result = 1; int begin = 1; while(true) { if(begin % input … Continue reading
Posted in poj
Leave a comment
Poj Solution 2549
http://poj.org/problem?id=2549 import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Scanner; import java.util.Set; /** * Accepted. * * @author Administrator * */ public class Main { private static Set< Long> set = new HashSet< Long>(); private … Continue reading
Posted in poj
Leave a comment
Poj Solution 2546
http://poj.org/problem?id=2546 //* @author: ccQ.SuperSupper import java.io.*; import java.text.DecimalFormat; import java.util.*; import java.math.*; public class Main { /** * @param args */ static double min(double a,double b) { if(a>b) return b; return a; } static double max(double a,double b) { if(a>b) … Continue reading
Posted in poj
Leave a comment