Im_hear

导航

文章分类 -  ACM

zoj 1027
摘要:View Code 1 #include <cstdio> 2 #include <iostream> 3 #include <algorithm> 4 using namespace std; 5 6 int lena,lenb; 7 char a[101],b[101]; 8 int d[103][103][3] = {0}; 9 int ans =0;10 int cov[5][5]={{5,-1,-2,-1,-3},11 {-1,5,-3,-2,-4},12 {-2,-3,5,-2,-2},13 ... 阅读全文

posted @ 2012-08-28 16:58 Im_hear 阅读(201) 评论(0) 推荐(0)

zoj 1010
摘要:View Code 1 #include <iostream> 2 #include <cmath> 3 using namespace std; 4 5 // 精度容差 6 const double EPS = 1e-5; 7 8 // 允许容差的浮点数相等 9 inline bool equals( double x, double y ) { 10 return fabs( x - y ) < EPS; 11 } 12 13 // 点结构 14 struct Point { 15 Point() {} 16 Point( dou... 阅读全文

posted @ 2012-05-13 16:02 Im_hear 阅读(265) 评论(0) 推荐(0)

zoj 1623
摘要:View Code 1 #include <iostream> 2 #include <fstream> 3 using namespace std; 4 #include <string> 5 #include <string.h> 6 7 int main() 8 { 9 /*ifstream cin("1.txt");//*/10 /*ofstream cout("2.txt");//*/11 int cas; 12 cin>>cas; 13 char ch[10000];14 while 阅读全文

posted @ 2012-05-10 22:29 Im_hear 阅读(247) 评论(0) 推荐(0)

zoj 1024
摘要:规律题-------------------DP 1 #include <iostream> 2 #include <fstream> 3 using namespace std; 4 5 int c = 0;// 6 int isleap; 7 const int cal[2][15]={ 8 {0,31,28,31,30,31,30,31,31,30,31,30,31}, 9 {0,31,29,31,30,31,30,31,31,30,31,30,31}//leap year10 };11 bool calendar[2002][13][32] = {0};//.. 阅读全文

posted @ 2012-05-10 08:47 Im_hear 阅读(220) 评论(0) 推荐(0)

zoj 2284
摘要:View Code 1 #include <cstdio> 2 #include <iostream> 3 #include <algorithm> 4 using namespace std; 5 6 long long yanghui[22][222] = {0}; 7 8 void init() 9 {10 int row,column;11 12 for(row = 1; row < 20; ++ row){13 yanghui[row][0] = 1;14 for(column = 0; yanghui[row][col... 阅读全文

posted @ 2012-05-04 21:36 Im_hear 阅读(134) 评论(0) 推荐(0)

zoj 1095
摘要:View Code View other humanCode 1 #include<cstdio> 2 #include<algorithm> 3 #include<iostream> 4 using namespace std; 5 int main() 6 { 7 int ham[5842]; 8 int a[4]={0,0,0,0}; 9 ham[0] = 1;10 int i;11 for(i = 1; i < 5842; i++)12 {13 ham[i] = min(min(2 * ham[a[0]],3 * ham... 阅读全文

posted @ 2012-04-26 10:44 Im_hear 阅读(155) 评论(0) 推荐(0)

zoj 1099
摘要:View Code 1 #pragma warning (disable:4786) 2 #include <cstdio> 3 #include <iostream> 4 #include <algorithm> 5 using namespace std; 6 #include <cstring> 7 8 int main() 9 { 10 //freopen("in.txt","r",stdin);11 //freopen("out.txt","w",stdou 阅读全文

posted @ 2012-04-26 09:09 Im_hear 阅读(185) 评论(0) 推荐(0)

zoj 1009
摘要:View Code 1 #include <cstdio> 2 #include <iostream> 3 #include <algorithm> 4 using namespace std; 5 #include <string> 6 #include <deque> 7 8 const int N = 30; 9 int n,m;10 string rotor[4];11 string tmp;12 deque<int> level[4];13 deque<int> a,b,c;14 15 void co 阅读全文

posted @ 2012-04-24 14:29 Im_hear 阅读(172) 评论(0) 推荐(0)

zoj 1188
摘要:View Code 1 #include <cstdio> 2 #include <iostream> 3 #include <algorithm> 4 using namespace std; 5 #include <string> 6 7 const int N = 110; 8 string str[N]; 9 struct info{10 int strid,invers;11 }inversions[N];12 13 14 void solve(int n,int m);15 int get(char c)16 {17 int ret 阅读全文

posted @ 2012-04-21 10:16 Im_hear 阅读(199) 评论(0) 推荐(0)

zoj 1008
摘要:View Code 1 #include <cstdio> 2 #include <iostream> 3 #include <algorithm> 4 using namespace std; 5 6 int n; 7 int kinds; 8 bool ok; 9 struct square{10 int top,right,bottom,left;11 int counts;12 };13 square way[30];14 square record[30];15 16 void dfs(int pos);17 18 int main()19 { 2 阅读全文

posted @ 2012-04-20 20:32 Im_hear 阅读(214) 评论(0) 推荐(0)

zoj 3607
摘要:View Code 1 #include <cstdio> 2 #include <iostream> 3 #include <algorithm> 4 #include <iomanip> 5 using namespace std; 6 7 const int N = 1003; 8 9 int main()10 { 11 cout << setiosflags(ios::fixed) << setiosflags(ios::right) << setprecision(6);12 int cas,n;13 阅读全文

posted @ 2012-04-19 20:33 Im_hear 阅读(245) 评论(0) 推荐(0)