# 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

## 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

## 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[3][3]; struct point { double x,y,z; }; double hls(det a) { return a[0][0]*a[1][1]*a[2][2]+a[0][1]*a[1][2]*a[2][0]+a[0][2]*a[1][0]*a[2][1] -a[0][2]*a[1][1]*a[2][0]-a[0][1]*a[1][0]*a[2][2]-a[0][0]*a[1][2]*a[2][1]; } bool qiujie(det s,double s0,double s1,double s2,point &o) { det t={{s0,s[0][1],s[0][2]},{s1,s[1][1],s[1][2]},{s2,s[2][1],s[2][2]}}; double … Continue reading

## 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

## 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

## 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

## 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[1000]; struct cmp { bool operator()( node *a, node *b )const … Continue reading

## Poj Solution 2051

http://poj.org/problem?id=2051 import java.util.Scanner; public class Main { private static Query[] query = new Query[1002]; 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

## 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][4]; int yp[4]={1,0,-1,0},xp[4]={0,1,0,-1}; int M,N; int x,y,d,t; void init() { for(int i=0;i<=200;i++) { map[0][i][2]=-1; map[200][i][0]=-1; map[i][0][3]=-1; map[i][200][1]=-1; } } typedef struct { int y,x; }DATA; … Continue reading