# Monthly Archives: August 2014

## Poj Solution 2864

http://poj.org/problem?id=2864 //* @author mekarlos@gmail.com import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer tokens; int din,stu; boolean[] st=new boolean[100]; boolean band; while(true){ tokens=new StringTokenizer(stdin.readLine()); … Continue reading

## Poj Solution 2861

http://poj.org/problem?id=2861 #include <stdio.h> #include <memory.h> bool e[120][120]; int s[120][120]; int n; void input( ) { int i, j, k; char c[2]; scanf( "%d", &n ); for( i=0; i<n; i++ ) { for( j=0; j<n; j++ ) { scanf( "%1s", c … Continue reading

## Poj Solution 2860

http://poj.org/problem?id=2860 //* @author ������&lt;hongxp11@163.com&gt; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int m = in.nextInt(); int k = in.nextInt(); int[] initial= new int[k]; int[] finish = … Continue reading

## Poj Solution 2859

http://poj.org/problem?id=2859 #include <vector> #include <algorithm> #include <stdio.h> using namespace std; typedef pair<int,int> point; int n, a, b; point p[500100]; void input( ) { int i; scanf( "%d", &n ); scanf( "%d%d", &a, &b ); for( i=0; i<n; i++ ) scanf( … Continue reading

## Poj Solution 2858

http://poj.org/problem?id=2858 #include <stdio.h> #include <string.h> #include <algorithm> using namespace std; char w[100100][11]; char *p[11][100100]; int pn[11]; bool cmpw( char *a, char *b ) { return strcmp( a, b ) < 0; } struct tile{ char c[2]; int v; }tiles[10]; bool … Continue reading

## Poj Solution 2857

http://poj.org/problem?id=2857 import java.util.*; /** * * @author leo */ public class Main { public static int judge(double H,double V,double h,double v,double x,double y,int state){ if((x>H*h&&y< V*v)||(x< H*h&&y>V*v)){ return state; }else{ state++; if(x< h*H&&y< v*V){ return judge(H*h,v*V,h,v,x,y,state); }else{ return judge(H*(1.0-h),V*(1.0-v),h,v,x-H*h,y-V*v,state); } … Continue reading

## Poj Solution 2853

http://poj.org/problem?id=2853 //* @author: 82638882@163.com import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); int u=in.nextInt(); while((u–)!=0) { int y=in.nextInt(); int a=in.nextInt(); int count=0; int t=1; for(int i=2;i< (Math.sqrt(2*a)+1);i++) { t+=i; if((a-t)%i==0&&a>=t) count++; } System.out.println(y+" … Continue reading

## Poj Solution 2849

http://poj.org/problem?id=2849 //2849 #include <iostream> #include <cstdio> #include <vector> #include <string> #include <cstring> using namespace std; int Array[32768]; string Program; string input; int index; int inputP; int PromP; int cc; int Programsize; inline void IncP() { index = (index + 1) … Continue reading