Meta
-
Recent Posts
Recent Comments
- MorrissMar on 隆宪叁年-五一
- tEVFSJtRNq on A man in his twenties (in hex)
- MorrissMar on 隆宪叁年-五一
- ZEzPRbkFJG on A man in his twenties (in hex)
- MorrissMar on 隆宪叁年-五一
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: March 2014
Poj Solution 2680
http://poj.org/problem?id=2680 import java.io.*; import java.util.*; import java.math.*; public class Main { public static void main(String[] args) { int n; BigInteger two,ans; Scanner cin = new Scanner (System.in); while(cin.hasNext()) { n = cin.nextInt(); two = BigInteger.valueOf(2); ans = two; if(n%2==0) { … Continue reading
Posted in poj
Leave a comment
Poj Solution 2679
http://poj.org/problem?id=2679 #include <stdio.h> #include <vector> #include <memory.h> using namespace std; const int size = 1110; struct edge { int len; int fee; edge *next; }; edge e[size][size]; edge *link[size]; bool sign[size]; int m, n, begin, end; int fee[size]; void search( … Continue reading
Posted in poj
Leave a comment
Poj Solution 2678
http://poj.org/problem?id=2678 #include<iostream> #include"stdio.h" #include"math.h" #include<vector> #include<algorithm> using namespace std; const double eps=1e-8; const int size = 1010; //////////////////////////////// typedef double 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 … Continue reading
Posted in poj
Leave a comment
Poj Solution 2677
http://poj.org/problem?id=2677 #include <stdio.h> #include <memory.h> #include <math.h> struct point { double x, y; }; double dis( point &a, point &b ) { return sqrt( (a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y) ); } double s[1010][1010]; point p[1010]; int main( ) { int n, i, … Continue reading
Posted in poj
Leave a comment
Poj Solution 2676
http://poj.org/problem?id=2676 //* @author: 82638882@163.com import java.io.*; class Main { public static void main(String[] args) throws IOException { InputStreamReader is=new InputStreamReader(System.in); BufferedReader in=new BufferedReader(is); int cnt=Integer.parseInt(in.readLine()); while((cnt–)!=0) { int[][] p=new int[9][9]; for(int i=0;i< 9;i++) { for(int j=0;j< 9;j++) p[i][j]=in.read()-‘0’; in.readLine(); } … Continue reading
Posted in poj
Leave a comment
Poj Solution 2675
http://poj.org/problem?id=2675 #include <stdio.h> #include <algorithm> #include <string.h> #include <math.h> const double eps = 1e-6; using namespace std; double v[70000]; int id[70000], s[70000], l[70000]; bool cmp( int a, int b ) { return v[a]*l[b] < v[b]*l[a]; } int main( ) { … Continue reading
Posted in poj
Leave a comment
Poj Solution 2673
http://poj.org/problem?id=2673 /* @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 total,per,t,max; total=sc.nextInt(); per=sc.nextInt(); t=sc.nextInt(); max=total; while((t–)!=0) { int dis,speed,fir,sum; dis=sc.nextInt(); speed=sc.nextInt(); if(speed==0) continue; if(speed>=dis) max=0; fir=dis/speed; if(dis%speed==0) fir–; sum=fir+(total-fir)/2; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2672
http://poj.org/problem?id=2672 #include <stdio.h> #include <string.h> #include <memory.h> //�����ͼ���ƥ�䣬 //����ƥ�����wΪn*m�ڽӾ���,p������X( |X|=n )ƥ��Ķ����� #define null 0 const int size=30; bool 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) { for(j=0;j<m;j++)sign[j]=0; … Continue reading
Posted in poj
Leave a comment
Poj Solution 2669
http://poj.org/problem?id=2669 #include <stdio.h> #include <memory.h> #include <vector> #include <algorithm> using namespace std; double dis[100][100]; int n, m; bool e[100][100]; int son[100]; double len[100]; bool sign [100]; int v2[100], v[100], vn2, vn; int calc2( int a, int f ) { int … Continue reading
Posted in poj
Leave a comment
Poj Solution 2665
http://poj.org/problem?id=2665 //* @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 s,n,tn; while (true){ s=scanner.nextInt(); n=scanner.nextInt(); if (s==0&&n==0){ break; } tn=s+1; for (int i=0;i< n ;i++ ){ tn=tn+scanner.nextInt()-scanner.nextInt()-1; } … Continue reading
Posted in poj
Leave a comment
Poj Solution 2664
http://poj.org/problem?id=2664 //* @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 a=in.nextInt(); if(a==0) break; boolean bb=true; int b=in.nextInt(); HashSet< Integer> hs=new HashSet< Integer>(); while((a–)!=0) hs.add(in.nextInt()); while((b–)!=0) { int c=in.nextInt(); … Continue reading
Posted in poj
Leave a comment
Poj Solution 2663
http://poj.org/problem?id=2663 import java.util.Scanner; import java.util.Arrays; public class Main{ static long S(int n) //S(n)=3*S(n-2)+2*(S(n-4)+S(n-6)+…+S(2)+S(0)) { long s; int i; if(n==0)return 1; else { s=3*S(n-2); for(i=n-4;i>=0;i-=2) { s+=2*S(i); } return s; } } public static void main(String args[]){ Scanner sc=new Scanner(System.in); int … Continue reading
Posted in poj
Leave a comment
Poj Solution 2661
http://poj.org/problem?id=2661 //* @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 a=in.nextInt(); if(a==0) break; a-=1960; a/=10; a=(int)Math.pow(2, a+2); double k=0; int n=2; while(k< a) { k+=Math.log(n)/Math.log(2); n++; } System.out.println(n-2); … Continue reading
Posted in poj
Leave a comment