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: July 2011
Poj Solution 1861
http://poj.org/problem?id=1861 //* @author: ccQ.SuperSupper import java.io.*; import java.util.*; class Edge implements Comparable{ int u,v,disten; Edge(){}; void set(int u,int v,int disten){ this.u = u; this.v = v; this.disten = disten; } public int compareTo(Object obj){ Edge temp = (Edge)obj; if(this.disten>temp.disten) return … Continue reading
Posted in poj
Leave a comment
Poj Solution 1860
http://poj.org/problem?id=1860 //* @author import java.io.File; import java.io.FileNotFoundException; import java.util.Arrays; import java.util.Scanner; //���·��bellman_ford public class Main { Scanner cin = new Scanner(System.in); int n; int m; int s; double v; Edge[] rate; Edge[] commission; double[] value; public static final double EPS … Continue reading
Posted in poj
Leave a comment
Poj Solution 1859
http://poj.org/problem?id=1859 #include <stdio.h> #include <algorithm> using namespace std; struct pairs { int first, second; }p[20100]; bool cmp( const pairs& a, const pairs& b ) { return a.first<b.first || a.first==b.first&&a.second<b.second; } int main( ) { int n, i, sx, sy; while( … Continue reading
Posted in poj
Leave a comment
Poj Solution 1852
http://poj.org/problem?id=1852 //* @author: ccQ.SuperSupper import java.io.*; import java.util.*; public class Main { /** * @param args */ static int max(int a,int b) { if(a>b) return a; return b; } static int min(int a,int b) { if(a>b) return b; return a; … Continue reading
Posted in poj
Leave a comment
Poj Solution 1850
http://poj.org/problem?id=1850 //* @author: 82638882@163.com import java.util.*; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); String s=in.next(); boolean bb=false; for(int i=0;i< s.length()-1;i++) { if(s.charAt(i)-s.charAt(i+1)>=0) { System.out.println(0); bb=true; break; } } if(bb) System.exit(0); int l=s.length(); long ans=0; … Continue reading
Posted in poj
Leave a comment
Poj Solution 1845
http://poj.org/problem?id=1845 import java.util.*; public class Main { static long modPow(long a,long n) { long MOD=9901; if (n==1) return a%MOD; long tmp=modPow(a,n>>1); tmp=tmp*tmp%MOD; if ((n&1)==1) tmp=tmp*a%MOD; return tmp; } static long myPow(long a,long n) { if (n==0) return 1; long ans=modPow(a,(n>>1)+1); … Continue reading
Posted in poj
Leave a comment
Poj Solution 1844
http://poj.org/problem?id=1844 //* @author: 82638882@163.com import java.util.*; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); int sun=in.nextInt(); int sum=0; int i; for(i=1;i< 9999;i++) { sum+=i; if (sum>=sun)break; } if((sum-sun)%2==0) System.out.println(i); else if((sum-sun)%2==1&&i%2==1) System.out.println(i+2); else if((sum-sun)%2==1&&i%2==0) System.out.println(i+1); … Continue reading
Posted in poj
Leave a comment
Poj Solution 1840
http://poj.org/problem?id=1840 //* @author: import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int a1=sc.nextInt(); int a2=sc.nextInt(); int a3=sc.nextInt(); int a4=sc.nextInt(); int a5=sc.nextInt(); System.out.println( hashQuestions(a1,a2, a3,a4,a5)); } /** * @param a1 * @param a2 * @param … Continue reading
Posted in poj
Leave a comment
Poj Solution 1837
http://poj.org/problem?id=1837 //PKU_1837_Balance_DP(û˼·) #include <iostream> #include <cstring> using namespace std; int C,G; int Pos[22]; int Weight[22]; int Value[22][7505];//������ȫΪ��25���������һͷ�����ʮ��Ϊ25*10*15(�۳�) = 3750 //Ȼ���״̬ƽ��ȫΪ��Ϊ7500��״̬��ȡ7505 int main() { while(cin>>C>>G) { for(int i = 1;i <= C;i++) cin>>Pos[i]; for(int i = 1;i <= G;i++) cin>>Weight[i]; memset(Value,0,sizeof(Value)); … Continue reading
Posted in poj
Leave a comment
Poj Solution 1836
http://poj.org/problem?id=1836 //* @author: import java.util.Scanner; public class Main{ private int n; private double a[]; int b[],c[],sum[]; public Main(int n,double a[]){ this.n=n; this.a=a; b=new int[n+1]; c=new int[n+1]; sum=new int[n+1]; } public static void main(String args[]){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); double … Continue reading
Posted in poj
Leave a comment
Poj Solution 1835
http://poj.org/problem?id=1835 //* @author popop0p0popo import java.util.*; import java.io.*; public class Main{ public static int x,y,z,p,h; public static void main(String[] args){ Scanner scanner=new Scanner(new BufferedReader(new InputStreamReader(System.in))); int n=scanner.nextInt(); int m,s; String f; for (int i=0;i< n ;i++ ){ m=scanner.nextInt(); x=y=z=p=0; h=2; … Continue reading
Posted in poj
Leave a comment
Poj Solution 1833
http://poj.org/problem?id=1833 //* @author: 82638882@163.com import java.io.*; import java.util.*; public class Main{ public static void main(String[] args) throws NumberFormatException, IOException { InputStreamReader is=new InputStreamReader(System.in); BufferedReader in=new BufferedReader(is); int a=Integer.parseInt(in.readLine()); while((a–)!=0) { String[] ss=in.readLine().split(" "); int l=Integer.parseInt(ss[0]); int cnt=Integer.parseInt(ss[1]); int[] arr=new int[l]; … Continue reading
Posted in poj
Leave a comment
Poj Solution 1832
http://poj.org/problem?id=1832 import java.math.*; import java.util.*; public class Main { static BigInteger[] base = new BigInteger[128]; static void init(){ base[0] = BigInteger.ONE; for (int i=1; i< 128; i++){ base[i] = base[i-1].multiply(BigInteger.valueOf(2)); } } public static void main(String args[]){ init(); Scanner cin … Continue reading
Posted in poj
Leave a comment