Meta
-
Recent Posts
Recent Comments
- MorrissMar on 隆宪叁年-五一
- MorrissMar on 隆宪叁年-五一
- MorrissMar on 隆宪叁年-五一
- bngvlttwnj on 隆宪叁年-五一
- bngvlttwnj 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: June 2015
Poj Solution 3173
http://poj.org/problem?id=3173 import java.util.*; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); String[] str = cin.nextLine().split(" "); int N = Integer.valueOf(str[0]).intValue(); int S = Integer.valueOf(str[1]).intValue(); int[][] Tri = new int[N][N]; for(int j = 0; … Continue reading
Posted in poj
Leave a comment
Poj Solution 3171
http://poj.org/problem?id=3171 #include <stdio.h> #include <algorithm> using namespace std; int t1[10000], t2[10000], f[10000], t[10000], fee[10000]; int id[10000]; bool cmp( int a, int b ) { return t2[a] < t2[b]; } int main( ) { int i, n, m, e, tn, x, … Continue reading
Posted in poj
Leave a comment
Poj Solution 3168
http://poj.org/problem?id=3168 #include <stdio.h> #include <memory.h> #include <algorithm> using namespace std; bool sign[25000]; struct corner { int x, y; int id; int key; }c[100010]; int key; bool cmp( const corner &a, const corner &b ) { return a.x<b.x || a.x==b.x && … Continue reading
Posted in poj
Leave a comment
Poj Solution 3167
http://poj.org/problem?id=3167 #include <stdio.h> #include <memory.h> #include <algorithm> using namespace std; int ss[26][25010], sn[27], last[26]; int aa[26][100010], an[27], S, N, K; int pos[26][100010]; int next[25010]; int sign[130000]; int flag[130000]; void clac_next( int a[], int n ) { int i=1, j=0; next[1] … Continue reading
Posted in poj
Leave a comment
Poj Solution 3159
http://poj.org/problem?id=3159 //* @author: ccQ.SuperSupper import java.io.*; import java.util.*; class node implements Comparable{ int v,next,disten; node(){ v = next = disten = -1; } node(int v,int next,int disten){ this.v = v; this.next = next; this.disten = disten; } void set_node(int v,int … Continue reading
Posted in poj
Leave a comment
Poj Solution 3158
http://poj.org/problem?id=3158 //* @author mekarlos@gmail.com import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan=new Scanner(System.in); String s1,s2,s; int[] m; int k,v1,v2; boolean band; while(scan.hasNext()){ s1=scan.next(); s2=scan.next(); s=s1; for(int i=0;i< s2.length();i++)s+="1"; k=-1; for(int i=0;i<=s.length();i++){ band=true; for(int j=0;j< … Continue reading
Posted in poj
Leave a comment
Poj Solution 3157
http://poj.org/problem?id=3157 import java.util.*; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); while(cin.hasNext()) { String str = cin.nextLine(); int type = checkType(str); if(type == -1) System.out.println("Error!"); else if(type == 1) { StringBuffer sb = … Continue reading
Posted in poj
Leave a comment
Poj Solution 3146
http://poj.org/problem?id=3146 /* @author: */ import java.util.Scanner; public class Main { static int clac( int s, int p, int n ) { if( s < p ) return 0; return (s-n%s-1)*(n/s) + clac( s/p, p, n%s )*((n+s-1)/s); } public static void … Continue reading
Posted in poj
Leave a comment
Poj Solution 3141
http://poj.org/problem?id=3141 #include <stdio.h> #include <math.h> #include <algorithm> using namespace std; pair<int,int> p[100], q[100]; int n; bool input( ) { int i; scanf( "%d", &n ); if( n == 0 ) return false; for( i=0; i<n; i++ ) scanf( "%d%d", &p[i].first, … Continue reading
Posted in poj
Leave a comment
Poj Solution 3140
http://poj.org/problem?id=3140 #include <stdio.h> #include <math.h> #include <vector> using namespace std; double ans, total; vector<int> e[100100]; int s[100100]; double dfs( int k, int f ) { double sum = 0, t; for( int i=0; i<e[k].size(); i++ ) { if( e[k][i] != … Continue reading
Posted in poj
Leave a comment
Poj Solution 3139
http://poj.org/problem?id=3139 #include <stdio.h> #include <algorithm> using namespace std; int has_one[1<<16]; int ans[1<<16]; int result[1<<16][24]; int a[16]; void clac_has_one( ) { int i; has_one[0] = 0; for( i=1; i<(1<<16); i++ ) has_one[i] = has_one[ i&(i-1) ] + 1; } void clac_result( … Continue reading
Posted in poj
Leave a comment
Poj Solution 3138
http://poj.org/problem?id=3138 //* @author: import java.util.Scanner; import java.util.Arrays; public class Main{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); int p[]=new int[101]; int i,j,n,s,t,m,id,t1,t2,sum,sid,tot,cas=0;; while (true) { s=sc.nextInt();t=sc.nextInt();m=sc.nextInt(); if (s==0&&t==0&&m==0) break; for (i=1;i<=100;i++) p[i]=0;sum=0;cas++; for (i=1;i<=s;i++) { id=sc.nextInt(); t1=sc.nextInt(); t2=sc.nextInt(); if … Continue reading
Posted in poj
Leave a comment
Poj Solution 3134
http://poj.org/problem?id=3134 #include <stdio.h> bool sign[1010]; int a[20]; int ans, best; int search( int k, int big ) { int b = 1000, t, temp, sb; if( a[k] == ans ) { best = k; return 0; } if( k >= … Continue reading
Posted in poj
Leave a comment