# 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; boolean band; while(true){ tokens=new StringTokenizer(stdin.readLine()); … Continue reading

Posted in poj | Comments Off on Poj Solution 2864

## Poj Solution 2861

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

Posted in poj | Comments Off on Poj Solution 2861

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

Posted in poj | Comments Off on Poj Solution 2860

## 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; void input( ) { int i; scanf( "%d", &n ); scanf( "%d%d", &a, &b ); for( i=0; i<n; i++ ) scanf( … Continue reading

Posted in poj | Comments Off on Poj Solution 2859

## Poj Solution 2858

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

Posted in poj | Comments Off on Poj Solution 2858

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

Posted in poj | Comments Off on Poj Solution 2857

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

Posted in poj | Comments Off on Poj Solution 2853

## 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; string Program; string input; int index; int inputP; int PromP; int cc; int Programsize; inline void IncP() { index = (index + 1) … Continue reading

Posted in poj | Comments Off on Poj Solution 2849

## Poj Solution 2847

http://poj.org/problem?id=2847 //* @author:alpc12 import java.io.*; import java.util.*; import java.math.*; public class Main { String num; boolean ok; void DFS(int dep, String b) { if(b.length() == num.length()) return; int i, j; for(i = 0; i <= 9; ++i) { BigInteger now … Continue reading

Posted in poj | Comments Off on Poj Solution 2847

## Poj Solution 2845

http://poj.org/problem?id=2845 import java.util.*; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); int pnum = Integer.valueOf(cin.nextLine()).intValue(); for(int i = 1; i <= pnum; i++) { String[] str = cin.nextLine().split(" "); String a = removePreZero(str); … Continue reading

Posted in poj | Comments Off on Poj Solution 2845