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: January 2011
Poj Solution 1689
http://poj.org/problem?id=1689 #include<iostream> #include"vector" #include"algorithm" #define max(x,y) (((x)>(y))?(x):(y)) #define min(x,y) (((x)<(y))?(x):(y)) using namespace std; struct point {long x,y;}; struct type_dbx {int n; point d[50]; }; type_dbx dbx[50]; vector <long> x,y; long mx,my; int n; char sign[50*50*2]; inline long cheng(point a,point b,point … Continue reading
Posted in poj
Leave a comment
Poj Solution 1687
http://poj.org/problem?id=1687 #include<iostream> #include"math.h" using namespace std; long x[50],y[50]; inline long cheng(int a,int b,int c) {return (x[a]-x[b])*(y[a]-y[c])-(x[a]-x[c])*(y[a]-y[b]);} int main() {int t,n,m,p[50],h,key,i,j,l;char s[50];long an,anb; cin>>t; for(;t>0;t–) {cin>>n; for(i=0;i<n;i++) cin>>x[i]>>y[i]; cin>>m;key=0;anb=0; for(l=0;l<m;l++) {cin>>h; for(i=0;i<h;i++){cin>>p[i];p[i]–;} an=0; for(i=1;i<h-1;i++) { an+=cheng(p[0],p[i],p[i+1]); } // cout<<":::"<<an<<endl; if(abs(an)>anb){anb=abs(an);key=l+1; } … Continue reading
Posted in poj
Leave a comment
Poj Solution 1686
http://poj.org/problem?id=1686 //* @author: import java.util.Scanner; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; public class Main{ ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("JavaScript"); Scanner cin=new Scanner(System.in); int[] num=new int[60]; void init() { for(int i=1;i< 59;i++) num[i]=i+9997; } void solve() throws … Continue reading
Posted in poj
Leave a comment
Poj Solution 1685
http://poj.org/problem?id=1685 #include<iostream> #include"math.h" #include"stdio.h" using namespace std; double x[60][2],y[60][2],xs,ys,xt,yt; double best1[62][2],best2[62][2],len[62]; int color[60],cl,c[62]; inline double jl(double a,double c,double b,double d) {return sqrt((a-b)*(a-b)+(c-d)*(c-d));} int main() {int t,i,j,k,n;double ss,tt; cin>>t; for(;t>0;t–) {cin>>xs>>ys>>xt>>yt; cin>>cl; for(i=0;i<cl;i++)cin>>color[i]; cin>>n; for(i=0;i<n;i++){cin>>x[i][0]>>y[i][0]>>x[i][1]>>y[i][1]>>c[i]; len[i]=jl(x[i][0],y[i][0],x[i][1],y[i][1]);} for(i=0;i<n;i++) if(c[i]==color[0]){best1[i][0]=jl(xs,ys,x[i][0],y[i][0])+len[i]; best1[i][1]=jl(xs,ys,x[i][1],y[i][1])+len[i];} else best1[i][0]=best1[i][1]=999999999999; … Continue reading
Posted in poj
Leave a comment
Poj Solution 1683
http://poj.org/problem?id=1683 #include<iostream> using namespace std; int h[50][8],n,m; char obj[8][8]; int sign[50][50]; int alive[50]; int can(int i,int j) {int k; for(k=0;k<n;k++) if(h[i][k]*h[j][k]>0)break; if(k==n)return 1; else return 0; } void merage(int a,int b) {int i; for(i=0;i<n;i++)h[a][i]+=h[b][i]; for(i=0;i<n*m;i++){sign[a][i]+=sign[b][i];sign[i][a]+=sign[i][b];} alive[b]=-a; } int main() {int … Continue reading
Posted in poj
Leave a comment
Poj Solution 1681
http://poj.org/problem?id=1681 //* @author: import java.util.*; public class Main { static Scanner in = new Scanner(System.in); static char[][] board;//���ڱ����ʼ״̬ static boolean[][] map;//ǽ�ڵ�״̬ static int cnt;//Ϳ��Ĵ��� static void click(int x, int y) {//Ϳ��x,y)���ĸ��� ++cnt; map[x][y] = !map[x][y]; if(x-1>=0) map[x-1][y] = !map[x-1][y];//����ĸ��� if(y-1>=0) … Continue reading
Posted in poj
Leave a comment
Poj Solution 1679
http://poj.org/problem?id=1679 //* @author: ccQ.SuperSupper import java.io.*; import java.util.*; class Edge{ int u,v,disten; void set(int u,int v,int disten){ this.u = u; this.v = v; this.disten = disten; } } interface MST{ int N = 100+2,BIG = 1000000000; int getMST(int op); } … Continue reading
Posted in poj
Leave a comment
Poj Solution 1677
http://poj.org/problem?id=1677 //* @author /** * pku 1677 Girls’ Day * Memory: 3524K Time: 172MS * Language: Java Result: Accepted * @Author conanhjj */ import java.util.*; public class Main { static Scanner in = new Scanner(System.in); static int g,w; static String[] … Continue reading
Posted in poj
Leave a comment
Poj Solution 1676
http://poj.org/problem?id=1676 //* @author: 82638882@163.com import java.io.*; 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[] N=new int[]{ 119,36,93,109,46,107,123,37,127,111}; while((a–)!=0) { int[] Num1=new int[4]; int[] Num2=new int[4]; String line=in.readLine(); … Continue reading
Posted in poj
Leave a comment
Poj Solution 1675
http://poj.org/problem?id=1675 /* @author:����acmilan_fan@yahoo.cn */ import java.io.*; public class Main { static double A = Math.PI*2/3; public static void main(String[] args)throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); String[] ss; int num = Integer.parseInt(s); int x1, y1, … Continue reading
Posted in poj
Leave a comment