原创 算法之路三:HDU OJ:2013

#include<cstdio> #include<iostream> using namespace std; const int maxn=40; int main() { int a[maxn]={0};

原创 算法之路二:劉汝佳算法競賽入門經典:STL不定長數組 木塊問題 UVA101

#include<cstdio> #include<string> #include<vector> #include<iostream> using namespace std; const int maxn=30; int

原创 算法之路三:HDU OJ:2014

#include<cstdio> #include<iostream> #include<algorithm> using namespace std; const int maxn=105; int main() {

原创 算法之路三:HUD OJ:2007

#include<stdio.h> #define maxn 100000 int square(int a); int cube(int a); void swap(int *a,int*b); int main() {

原创 算法之路二:劉汝佳算法競賽入門經典:STL集合 安迪的第一個字典 UVA10851

#include<iostream> #include<string> #include<set> #include<sstream> using namespace std; set<string> dict;//string

原创 算法之路二:劉汝佳算法競賽入門經典:STL排序與檢索 大理石在哪 UVA10474

#include<cstdio> #include<algorithm> using namespace std; const int maxn =10000; int main() { int n,q,x,a[maxn

原创 算法之路二:劉汝佳算法競賽入門經典:c++結構體

#include<iostream> using namespace std; struct Point { int x,y; Point(int x=0,int y=0):x(x),y(y){} //Point

原创 算法之路二:劉汝佳算法競賽入門經典 信息解碼 UVA213

#include<stdio.h> #include<string.h> int readchar(); int readint(int c); int code[8][1<<8]; int readcodes(); int

原创 算法之路三:HDU OJ:2004

#include<stdio.h> #define PI 3.1415927 int main() { double R; while(scanf("%lf",&R)!=EOF) { p

原创 算法之路三:HDU OJ:2009

#include<stdio.h> #include<math.h> #define maxn 1005 int main() { int m,n; double a[maxn]; while(scanf

原创 算法之路三:HDU OJ:2012

#include<cstdio> #include<cmath> const int maxn=105; int is_sushu(int x); int main() { int a[maxn]={0};

原创 算法之路三:HDU OJ:2006

#include<stdio.h> #define maxn 100000 int main() { int a[maxn]; int n; while(scanf("%d",&n)!=EOF&&n)

原创 算法之路三:HDU OJ:2008

#include<stdio.h> #define maxn 105 int main() { double a[maxn]; int n; while(scanf("%d",&n)==1&&n>0)

原创 算法之路二:劉汝佳算法競賽入門經典 救濟金髮放 UVa133

#include<stdio.h> #define maxn 25 int n,k ,m,a[maxn]; int go(int p,int d,int t); int main() { while(scanf("%d

原创 算法之路二:劉汝佳算法競賽入門經典:c++模板

#include<iostream> using namespace std; template <typename T> T sum(T*begin,T*end) { T*p=begin; T ans=0;