# Monthly Archives: February 2012

## Poj Solution 2075

http://poj.org/problem?id=2075 //* @author: SmilingWang import java.util.*; public class Main { public static final int BLOCK = Integer.MAX_VALUE; public static final double zero = 1e-6; public static double cl; public static void main(String[] args){ Scanner in = new Scanner(System.in); cl = … Continue reading

Posted in poj | Comments Off on Poj Solution 2075

## Poj Solution 2070

http://poj.org/problem?id=2070 //* @author: 82638882@163.com import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); while(in.hasNext()) { float a=in.nextFloat(); float b=in.nextFloat(); float c=in.nextFloat(); if(a==0&&b==0&&c==0) break; boolean s=true; if(a<=4.5&&b>=150&&c>=200){ System.out.print("Wide Receiver "); s=false; } if(a<=6&&b>=300&&c>=500){ System.out.print("Lineman "); … Continue reading

Posted in poj | Comments Off on Poj Solution 2070

## Poj Solution 2069

http://poj.org/problem?id=2069 #include<iostream> #include"stdio.h" #include"math.h" using namespace std; #define sq(a) ((a.x)*(a.x)+(a.y)*(a.y)+(a.z)*(a.z)) int n; typedef double det; struct point { double x,y,z; }; double hls(det a) { return a*a*a+a*a*a+a*a*a -a*a*a-a*a*a-a*a*a; } bool qiujie(det s,double s0,double s1,double s2,point &o) { det t={{s0,s,s},{s1,s,s},{s2,s,s}}; double … Continue reading

Posted in poj | Comments Off on Poj Solution 2069

## Poj Solution 2064

http://poj.org/problem?id=2064 //* @author:alpc12 import java.io.*; import java.util.*; class Layer { int cost; int frontier[]; int frontierCode; Layer(int f[], int c) { cost = c; frontier = new int[f.length]; frontierCode = 0; for (int i=0; i< frontier.length; i++) frontier[i] = f[i]; … Continue reading

Posted in poj | Comments Off on Poj Solution 2064

## Poj Solution 2061

http://poj.org/problem?id=2061 //* @author:alpc12 /* Sample solution to D – Pseudo random numbers / Mikael Goldmann * First count backwards to recreate the seed number * The count forwards to get T:th number. Try using few columns to * save space. … Continue reading

Posted in poj | Comments Off on Poj Solution 2061

## Poj Solution 2060

http://poj.org/problem?id=2060 #include <memory.h> #include <stdio.h> #include <math.h> #define null 0 #define y1 yy1 const int size = 510; //size must be bigger than n and m. //nС��mʱЧ�ʸ� int maxmatch( int n, int m, bool w[][size], int *p) { int p_n[size]; … Continue reading

Posted in poj | Comments Off on Poj Solution 2060

## Poj Solution 2054

http://poj.org/problem?id=2054 #include <stdio.h> #include <vector> #include <set> using namespace std; struct node { int id; int num; int cost; int sigma_c; node *father; vector <node *> child; bool colored; }t; struct cmp { bool operator()( node *a, node *b )const … Continue reading

Posted in poj | Comments Off on Poj Solution 2054

## Poj Solution 2051

http://poj.org/problem?id=2051 import java.util.Scanner; public class Main { private static Query[] query = new Query; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i = 0; while (sc.hasNext()) { String s = sc.nextLine(); if (s.equals("#")) { int … Continue reading

Posted in poj | Comments Off on Poj Solution 2051

## Poj Solution 2049

http://poj.org/problem?id=2049 #include<stdio.h> #include<string.h> #include<stdlib.h> #include<string.h> #include<math.h> #define INF 30000 #define NMAX 201 int a[NMAX][NMAX]; int map[NMAX][NMAX]; int yp={1,0,-1,0},xp={0,1,0,-1}; int M,N; int x,y,d,t; void init() { for(int i=0;i<=200;i++) { map[i]=-1; map[i]=-1; map[i]=-1; map[i]=-1; } } typedef struct { int y,x; }DATA; … Continue reading

Posted in poj | Comments Off on Poj Solution 2049

## Poj Solution 2042

http://poj.org/problem?id=2042 /* @author: */ import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n, s, t1, t2, t; while( sc.hasNext() ) { n=sc.nextInt(); if( n == 0 ) break; s = … Continue reading

Posted in poj | Comments Off on Poj Solution 2042

## Poj Solution 2039

http://poj.org/problem?id=2039 import java.util.*; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); int num = 0; String str; char[][] array; while(true) { num = Integer.valueOf(cin.nextLine()).intValue(); if(num == 0) break; else { str = cin.nextLine(); … Continue reading

Posted in poj | Comments Off on Poj Solution 2039