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
Author Archives: toad, die
Poj Solution 2594
http://poj.org/problem?id=2594 #include <stdio.h> #include <memory.h> #include <vector> using namespace std; #define null 0 const int size=510; bool w[size][size]; int maxmatch(int n,int m,bool 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) { … Continue reading
Posted in poj
Leave a comment
Poj Solution 2593
http://poj.org/problem?id=2593 //* @author import java.util.Scanner; public class Main{ public static void main(String args[]){ int data[]=new int[100000]; int dp[]=new int[100000]; int n; Scanner in=new Scanner(System.in); while((n=in.nextInt())!=0){ int sum = 0, tmp = -999999999; for(int i = 0; i < n; i++){ … Continue reading
Posted in poj
Leave a comment
Poj Solution 2591
http://poj.org/problem?id=2591 //* @author: 82638882@163.com import java.util.*; public class Main { public static void main(String[] args) { TreeSet< Long> t=new TreeSet< Long>(); Scanner in=new Scanner(System.in); int[] arr=new int[10000001]; arr[0]=1; int k1=0,k2=0; for(int i=1;i< 10000001;i++) { int y1=arr[k1]*2+1; int y2=arr[k2]*3+1; arr[i]=Math.min(y1, y2); … Continue reading
Posted in poj
Leave a comment
Poj Solution 2590
http://poj.org/problem?id=2590 //* @author: 82638882@163.com import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); int a=in.nextInt(); for(int i=0;i< a;i++) { long x=in.nextLong(); x=in.nextLong()-x; long b=(long)Math.sqrt(x); long ans=-1; if(b==0) ans=0; else if(b*b==x)ans=2*b-1; else if(x<=b*b+b)ans=2*b; else ans=2*b+1; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2589
http://poj.org/problem?id=2589 #include<iostream> #include"string.h" #include"stdlib.h" using namespace std; int main() { char a[110],b[110],ar[110],br[110]; int n1,r1,n2,r2,k=0,i,g1,g2,r; cin>>a>>b; n1=n2=strlen(a); r1=0;r2=0; g1=0;g2=0; while(k<1000) {if(g1==n1){if(r1==0){cout<<"John wins."<<endl;break;}for(i=r1-1;i>=0;i–)a[i]=ar[i];n1=r1;r1=0;g1=0;} if(g2==n2){if(r2==0){cout<<"Jane wins."<<endl;break;}for(i=r2-1;i>=0;i–)b[i]=br[i];n2=r2;r2=0;g2=0;} ar[r1++]=a[g1++];br[r2++]=b[g2++]; if(ar[r1-1]==br[r2-1]) {r=rand()/99%2; if(r==0){for(i=0;i<r2;i++)ar[r1+i]=br[i];r1+=r2;r2=0; cout<<"Snap! for Jane: ";for(i=r1-1;i>=0;i–)cout<<ar[i];cout<<endl; } else {for(i=0;i<r1;i++)br[r2+i]=ar[i];r2+=r1;r1=0; cout<<"Snap! for John: ";for(i=r2-1;i>=0;i–)cout<<br[i];cout<<endl;} } k++;} … Continue reading
Posted in poj
Leave a comment
Poj Solution 2588
http://poj.org/problem?id=2588 #include"stdio.h" #include"math.h" const double eps=1e-7; struct cir { double x,y,r; }c[1000]; inline bool edge(cir &a,cir &b) { return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y))<=a.r+b.r; } int n; bool init() { int i; if(scanf("%d",&n)!=1)return false; for(i=0;i<n;i++) scanf("%lf %lf %lf",&c[i].x,&c[i].y,&c[i].r); return true; } inline bool touch_up(cir … Continue reading
Posted in poj
Leave a comment
Poj Solution 2586
http://poj.org/problem?id=2586 import java.io.PrintWriter; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int s,d,result; while(scn.hasNext()){ result = 0; s = scn.nextInt(); d = scn.nextInt(); if(d > 4 … Continue reading
Posted in poj
Leave a comment
Poj Solution 2585
http://poj.org/problem?id=2585 //* @author: 82638882@163.com import java.io.*; public class Main { static int[][] map=new int[10][10]; static int[][] p=new int[4][4]; public static void main(String[] args)throws IOException { InputStreamReader is=new InputStreamReader(System.in); BufferedReader in=new BufferedReader(is); while(true) { String s=in.readLine(); if(s.equals("ENDOFINPUT"))break; String[] ss; for(int i=0;i< … Continue reading
Posted in poj
Leave a comment
Poj Solution 2584
http://poj.org/problem?id=2584 #include"iostream" #include"algorithm" using namespace std; char *size="SMLXT"; int find( char c ) { char *q = size; while( *q != c ) q++; return q – size; } struct person { int b,e; }p[20]; bool cmp( person p1, person … Continue reading
Posted in poj
Leave a comment
Poj Solution 2583
http://poj.org/problem?id=2583 import java.io.BufferedInputStream; import java.util.Scanner; /** *poj2583 easy * @author NC */ public class Main { public static void main(String[] args) { Scanner scan = new Scanner(new BufferedInputStream(System.in)); while (scan.hasNext()) { int f0 = scan.nextInt(); int f1 = scan.nextInt(); int … Continue reading
Posted in poj
Leave a comment
Poj Solution 2582
http://poj.org/problem?id=2582 #include<iostream> #include"math.h" using namespace std; struct point { int x,y,z; }b[20],f[20]; inline int sq_dis( point a, point b ) { return (a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y) + (a.z-b.z)*(a.z-b.z); } int main() { int l,w,d,n,m,ans,i,j; char t[100],c; cin>>t; while( cin>>l>>w>>d ) { … Continue reading
Posted in poj
Leave a comment
Poj Solution 2581
http://poj.org/problem?id=2581 //* @author: import java.util.*; public class Main { static public void main( String [] str ){ Scanner sc = new Scanner(System.in); while(sc.hasNext()) { int a,b,c,d,e,i,j,k,total,s,value; int as=0,bs=0,cs=0,ds=0; double t; t=sc.nextDouble(); b=sc.nextInt(); c=sc.nextInt(); d=sc.nextInt(); e=sc.nextInt(); a = (int)(t*100); total = … Continue reading
Posted in poj
Leave a comment
Poj Solution 2580
http://poj.org/problem?id=2580 #include "stdio.h" #include "string.h" #include "stdlib.h" int k[20],keys[20][200],to[20][200]; int key[20]; int n,begin; bool init() { char w[100],num[100],t; int i,j,h; scanf( "%s", w ); if( strcmp( "ENDOFINPUT", w ) == 0 ) return false; scanf( "%d %d", &begin, &n ); … Continue reading
Posted in poj
Leave a comment
Poj Solution 2579
http://poj.org/problem?id=2579 #include"stdio.h" char map[10][10]; int main() { int i, j, m, n; scanf( "%*s" ); while( scanf( "%d %d", &n, &m ) == 2 ) { for( i=0; i<n; i++ ) scanf( "%s", &map[i] ); for( i=0; i<n-1; i++ ) … Continue reading
Posted in poj
Leave a comment
Poj Solution 2578
http://poj.org/problem?id=2578 //* @author ������<hongxp11@163.com> 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 height = 168; int crash = 0; for(int … Continue reading
Posted in poj
Leave a comment
Poj Solution 2577
http://poj.org/problem?id=2577 //* @author mekarlos@gmail.com import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in)); int[] ram=new int[1000]; int[] reg=new int[10]; int pos=0; int num=1; while(stdin.ready()){ ram[pos++]=new Integer(stdin.readLine()); } … Continue reading
Posted in poj
Leave a comment
Poj Solution 2576
http://poj.org/problem?id=2576 //* @author: 82638882@163.com import java.io.*; import java.util.Arrays; public class Main { public static void main(String[] args) throws IOException { InputStreamReader is=new InputStreamReader(System.in); BufferedReader in=new BufferedReader(is); int a=Integer.parseInt(in.readLine()); int total=0,l1=0,l2=0,i; int[] arr=new int[a]; for(i=0;i< a;i++) { arr[i]=Integer.parseInt(in.readLine()); total+=arr[i]; } int … Continue reading
Posted in poj
Leave a comment
Poj Solution 2575
http://poj.org/problem?id=2575 //* @author: 82638882@163.com import java.util.HashSet; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); while(in.hasNext()) { int a=in.nextInt(); int[] b=new int[a]; for(int i=0;i< a;i++) b[i]=in.nextInt(); HashSet< Integer> h=new HashSet< Integer>(); for(int i=1;i< a;i++) … Continue reading
Posted in poj
Leave a comment
Poj Solution 2574
http://poj.org/problem?id=2574 #include<iostream> #include"stdio.h" #include"math.h" #include"algorithm" using namespace std; ////////////////////////////// #define Type double /*????????*/ ////////////////////////////// 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);} struct line {point a,b; line(){;} … Continue reading
Posted in poj
Leave a comment
Poj Solution 2573
http://poj.org/problem?id=2573 //* @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(); ArrayList< Integer> t=new ArrayList< Integer>(); for(int i=0;i< a;i++) t.add(in.nextInt()); if(a==1){ System.out.println(t.get(0)); System.out.println(t.get(0)); } else{ int total=0; Collections.sort(t); ArrayList< Integer> … Continue reading
Posted in poj
Leave a comment
Poj Solution 2572
http://poj.org/problem?id=2572 //* @author: 82638882@163.com import java.util.*; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); while(true) { String s=in.next(); String[] s1=s.split("\+"); String[] s2=s1[1].split("\="); StringBuffer b1=new StringBuffer(s1[0]); StringBuffer b2=new StringBuffer(s2[0]); StringBuffer b3=new StringBuffer(s2[1]); b1=b1.reverse(); b2=b2.reverse(); b3=b3.reverse(); int … Continue reading
Posted in poj
Leave a comment
Poj Solution 2571
http://poj.org/problem?id=2571 //* @author: import java.util.*; import static java.lang.Math.*; public class Main { static double a, b, c; static double[] change( double th,double fi, double l) { double z = l * sin( th/180*PI ); double y = l * cos( … Continue reading
Posted in poj
Leave a comment
Poj Solution 2570
http://poj.org/problem?id=2570 //* @author: 82638882@163.com import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { static int[][] m=new int[201][201]; public static void main(String[] args) throws NumberFormatException, IOException { InputStreamReader is=new InputStreamReader(System.in); BufferedReader in=new BufferedReader(is); while(true) { int n=Integer.parseInt(in.readLine()); if(n==0)break; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2569
http://poj.org/problem?id=2569 //* @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< String,Integer> ts=new HashMap< String,Integer>(); while(true) { int a=Integer.parseInt(in.readLine()); if(a==0)break; String … Continue reading
Posted in poj
Leave a comment
Poj Solution 2568
http://poj.org/problem?id=2568 #include<iostream> #include"stdio.h" #include"stdlib.h" #include"memory.h" using namespace std; bool e[51][51]; bool s[51]; int a[51],n; void print( int f ) { int i; printf( "(%d", f ); for( i=1; i<=n; i++ ) if( e[f][i] ) { printf( " " ); print( … Continue reading
Posted in poj
Leave a comment
Poj Solution 2567
http://poj.org/problem?id=2567 #include"stdio.h" #include"stdlib.h" #include"memory.h" int d[51],n; bool e[51][51]; void creat( int f ) { int s; char t[10]; scanf( "%[ ,0-9]", t ); s = atoi( t ); if( s > n ) n = s; if( f ) e[f][s] … Continue reading
Posted in poj
Leave a comment
Poj Solution 2566
http://poj.org/problem?id=2566 #include"stdio.h" #include"algorithm" #include"math.h" using namespace std; int sum[100010]; int *id[100010]; const bool cmp( int *a, int *b ) { return *a<*b; } int main() { int n,m,i,t,j,a,b,ans,temp,k; while( 1 ) { scanf( "%d %d", &n, &m ); if( n … Continue reading
Posted in poj
Leave a comment
Poj Solution 2565
http://poj.org/problem?id=2565 //* @author mekarlos@gmail.com import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException{ // TODO Auto-generated method stub Scanner scan=new Scanner(System.in); BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer tokens; tokens=new … Continue reading
Posted in poj
Leave a comment
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
Poj Solution 2545
http://poj.org/problem?id=2545 //* @author: 82638882@163.com import java.util.*; public class Main { public static void main(String[] args) { TreeSet< Long> t=new TreeSet< Long>(); Scanner in=new Scanner(System.in); long a=in.nextInt(); long b=in.nextInt(); long c=in.nextInt(); int d=in.nextInt(); long[] arr=new long[d+1]; arr[0]=1; int x1=0,x2=0,x3=0; for(int i=1;i<=d;i++) … Continue reading
Posted in poj
Leave a comment
Poj Solution 2539
http://poj.org/problem?id=2539 //* @author: ccQ.SuperSupper import java.io.*; import java.util.*; import java.math.*; public class Main { static BigInteger digit100=new BigInteger("1"); static int t,a,b; static void start(){ for(int i=0;i< 100;++i) digit100 = digit100.multiply(BigInteger.valueOf(10)); } public static void main(String[]args) throws Exception{ BigInteger num1,num2,temp,ans; start(); … Continue reading
Posted in poj
Leave a comment
Poj Solution 2538
http://poj.org/problem?id=2538 //* @author mekarlos@gmail.com import java.util.Hashtable; import java.util.Scanner; public class Main { public static void main(String[] args) { String[] s={"`1234567890-=","QWERTYUIOP[]","ASDFGHJKL;’","ZXCVBNM,./"}; Scanner scan=new Scanner(System.in); s[1]+=(char)(92); String cad="",out=""; Hashtable< String,String> table=new Hashtable< String,String>(); for(int i=0;i< 4;i++){ for(int j=1;j< s[i].length();j++){ table.put(s[i].charAt(j)+"", s[i].charAt(j-1)+""); } … Continue reading
Posted in poj
Leave a comment
Poj Solution 2537
http://poj.org/problem?id=2537 //* @author: import java.util.*; public class Main { static public void main( String [] str ){ Scanner sc = new Scanner(System.in); while( sc.hasNext()) { double s=1,answer; int k=sc.nextInt(); int n=sc.nextInt(); double ans[][]=new double[n][k+1]; for( int i=0; i< n; i++ … Continue reading
Posted in poj
Leave a comment
Poj Solution 2535
http://poj.org/problem?id=2535 /* @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 cnt[]=new int[101]; int temp[]=new int[101]; boolean arr[]=new boolean[101]; int n,p,i,j; n=sc.nextInt(); p=sc.nextInt(); Arrays.fill(cnt,0); Arrays.fill(arr,false); for(i=0;i< n;i++) { int max=0,min=999999; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2533
http://poj.org/problem?id=2533 import java.io.BufferedInputStream; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(new BufferedInputStream(System.in)); if (scan.hasNext()) { int n = scan.nextInt(); int[] data = new int[n]; int[] count = new int[n]; for (int … Continue reading
Posted in poj
Leave a comment
Poj Solution 2531
http://poj.org/problem?id=2531 /* @author: */ import java.util.Scanner; public class Main{ int c[][]=new int[22][22]; int result=0; int n; boolean sign[]=new boolean[22]; int v[]=new int[22]; int find(int k,int a,int r){ int temp=0; if(a+r<=result) return result; if(k==n+1){ if(a>result) result=a; return result; } sign[k]=false; for(int … Continue reading
Posted in poj
Leave a comment
Poj Solution 2528
http://poj.org/problem?id=2528 //* @author: <strong>Yeming Hu</strong>"cslittleye@gmail.com" import java.util.*; import java.io.*; public class Main { public static int N = 10000; public static Node head; public static void main(String[] args) { Scanner sc = new Scanner(new BufferedInputStream(System.in)); Set< Integer> endpoints = new TreeSet< … Continue reading
Posted in poj
Leave a comment
Poj Solution 2526
http://poj.org/problem?id=2526 #include "stdio.h" #include "algorithm" using namespace std; struct point { int x,y; }p[10000]; inline bool cmp( point a, point b ) { return a.x < b.x || ( a.x == b.x && a.y < b.y ); } int n; … Continue reading
Posted in poj
Leave a comment