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: December 2011
Poj Solution 2011
http://poj.org/problem?id=2011 #include <stdio.h> #include <math.h> #include <algorithm> using namespace std; int ans[20], an; int temp[20]; int get( int num, int s, int &r ) { int g = 0, tg=1, tr=1; bool key = true; r = 0; while( num … Continue reading
Posted in poj
Leave a comment
Poj Solution 2010
http://poj.org/problem?id=2010 #include<stdio.h> #include<vector> #include<queue> #include<algorithm> using namespace std; priority_queue< int ,vector<int> > q; typedef pair< int, int > cow; cow c[1000000]; int money[100000]; int n, m, f; int main() { int i, v; scanf( "%d %d %d", &n, &m, &f … Continue reading
Posted in poj
Leave a comment
Poj Solution 2008
http://poj.org/problem?id=2008 #include <stdio.h> #include <algorithm> #include <queue> using namespace std; pair<int,int> p[1000]; pair<int,int> q[1000]; bool cmp( const pair<int,int> &a, const pair<int,int> &b ) { return a.second < b.second; } int main( ) { int a, b, c, n, i, j, … Continue reading
Posted in poj
Leave a comment
Poj Solution 2007
http://poj.org/problem?id=2007 #include<stdio.h> #include<stdlib.h> #include<math.h> #define debug 0 #define INF 1000 #if debug #define NMAX 10 #else #define NMAX 52 #endif int point[NMAX][2]; int base[2]; int m[5]; int qu(int p[]) { if(p[0]>0&&p[1]>0) return 1; if(p[0]<0&&p[1]>0) return 2; if(p[0]<0&&p[1]<0) return 3; if(p[0]>0&&p[1]<0) … Continue reading
Posted in poj
Leave a comment
Poj Solution 2005
http://poj.org/problem?id=2005 //* @author: <strong> import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int tot[]=new int[12],t[]=new int[4]; char ts[]=new char[5]; int sum,s1,s2,win,tem; while (sc.hasNext()) { int n=sc.nextInt(); if(n==0) break; for (int i=2;i< 10;i++) … Continue reading
Posted in poj
Leave a comment
Poj Solution 2004
http://poj.org/problem?id=2004 //* @author: 82638882@163.com import java.io.*; import java.util.Arrays; import java.util.Comparator; public class Main { static my[] s=new my[10001]; public static void main(String[] args) throws IOException { InputStreamReader is=new InputStreamReader(System.in); BufferedReader in=new BufferedReader(is); int l=0,max=-1,rr=-1; while(in.ready()) { String t=in.readLine(); s[l++]=new my(t); … Continue reading
Posted in poj
Leave a comment
Poj Solution 2002
http://poj.org/problem?id=2002 #include <stdio.h> #include <math.h> #include <string.h> #include <algorithm> using namespace std; #define DIFF 20000 #define MAX 1005 #define NUM 40005 #define EP 1e-8 #define LIM 1e-6 #define PI acos(-1.0) struct pt{ int x,y; }; pt p[MAX]; int s[NUM],e[NUM]; int … Continue reading
Posted in poj
Leave a comment
Poj Solution 2001
http://poj.org/problem?id=2001 import java.util.*; public class Main { static int MAX = 1010; static TrieNode root = new TrieNode(); static char[][] result = new char[MAX][22]; static char[][] s = new char[MAX][22]; public static void main(String[] args) { Scanner cin = new … Continue reading
Posted in poj
Leave a comment
Poj Solution 2000
http://poj.org/problem?id=2000 import java.util.*; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); while(true) { int day = Integer.valueOf(cin.nextLine()).intValue(); if(day == 0) break; System.out.println(day + " " + getTotalCoin(day)); } } private static int getTotalCoin(int … Continue reading
Posted in poj
Leave a comment
Poj Solution 1995
http://poj.org/problem?id=1995 //* @author: import java.util.*; public class Main{ //��a^b%n private static int modexp(int a,int b,int n) { int ret=1; int tmp=a; while(b!=0) { if((b&0x1)==1) ret=ret*tmp%n; tmp=tmp*tmp%n; b>>=1; } return ret; } public static void main(String[] args){ Scanner sc=new Scanner(System.in); int … Continue reading
Posted in poj
Leave a comment
Poj Solution 1990
http://poj.org/problem?id=1990 //* @author: import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Comparator; import java.util.StringTokenizer; /* *�ο���ţ�ij���,��һ��д��״����… *�Ƚ�cows��volumeΪ�ؼ�������.. *}����״����,һ��ά�������,һ��ά��ǰ����С�ڵ�ǰ������֮�� */ class cin { static BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; static int leave=0; static int nextInt() throws IOException { … Continue reading
Posted in poj
Leave a comment
Poj Solution 1989
http://poj.org/problem?id=1989 //* @author: ccQ.SuperSupper import java.util.*; import java.math.*; public class Main { public static void main(String []args) throws Exception{ int i,j,k,n,ans; int way[] = new int[100100]; int flag[] = new int[10100]; Scanner cin = new Scanner(System.in); n = cin.nextInt(); k … Continue reading
Posted in poj
Leave a comment
Poj Solution 1988
http://poj.org/problem?id=1988 /* @author: */ import java.util.Scanner; import java.util.Arrays; public class Main{ static int p[]=new int[30010]; static int d[]=new int[30010]; static int num[]=new int[30010]; static int i=0; static char c[]=new char[5]; static int getup(int a) { int b=a; while(p[b]!=b) b=p[b]; return … Continue reading
Posted in poj
Leave a comment
Poj Solution 1987
http://poj.org/problem?id=1987 #include"stdio.h" #include"algorithm" using namespace std; long use[16]; long father[40010]; long queue[40010]; long lchild[40010][16]; long rchild[40010][16]; long sum[40010][16]; long depth[40010][16]; long value[40010],dist[40010]; long m,n,k,kind,answer; long findit(long key,long s1,long deep) { long &lc=lchild[s1][deep],&rc=rchild[s1][deep],sumnow=sum[s1][deep]; long now=depth[s1][deep]; if(now==key) { if(rc>=0)return sumnow-sum[rc][deep+1]; else return … Continue reading
Posted in poj
Leave a comment
Poj Solution 1981
http://poj.org/problem?id=1981 #include<iostream> #include"math.h" #include"algorithm" using namespace std; struct point { double x,y; }p[310]; double jl(point i,point j) { return sqrt((i.x-j.x)*(i.x-j.x)+(i.y-j.y)*(i.y-j.y)); } bool fzk(point a,point b,double &in,double &out) { double jiao,l,x; if((l=jl(a,b))>2)return 0; jiao=atan2(b.y-a.y,b.x-a.x); x=acos(l/2); in=jiao-x; out=jiao+x; return 1; } int … Continue reading
Posted in poj
Leave a comment