上一页 1 2 3 4 5 6 7 ··· 9 下一页
摘要: #include <iostream>#include <fstream>using namespace std;unsigned short counter_3D[26][26][26] = { 0 };unsigned short counter_2D[26][26] = { 0 };unsigned short counter_1D[26] = { 0 };char ret[1000001] = { '\0' };char seq[3] = { 0 };int cnt=0,check[26] = { 0 }, check2D[26][26] = { 阅读全文
posted @ 2011-08-06 16:11 DOF_KL 阅读(179) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;char c1,c2,c3,c4,blank;double d1,d2,d3,d4;bool check(char c) { if(c1 != c && c2 != c && c3 != c) return true; return false;}int main() { double val[300] = { 0.0 }, R = 8.314; cin>>c1>>blank; cin>>val[c1]; cin>>c2> 阅读全文
posted @ 2011-08-06 12:29 DOF_KL 阅读(168) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;#define MAX 10000int origin[101] = {0};typedef struct range_st { int l,r;} range_st, *range_t;int ranges_len = 0;range_st ranges[MAX];range_st temp[MAX];void union_range(range_st rg) { int i,j,union_count; for(i=0;i<ranges_len && ranges[i].r + 阅读全文
posted @ 2011-08-05 14:15 DOF_KL 阅读(223) 评论(0) 推荐(0) 编辑
摘要: int merge(int *p1, int l1, int *p2, int l2, int *p3) { int l3 = 0, i,j,k; for(i=0,j=0;i<l1 && j<l2;) { if(p1[i] < p2[j]) p3[l3++] = p1[i++]; else if(p1[i] > p2[j]) p3[l3++] = p2[j++]; else // equal i++; } while(i<l1) p3[l3++] = p1[i++]; while(j<l2) p3[l3++] = p2[j++]; retur 阅读全文
posted @ 2011-08-05 13:16 DOF_KL 阅读(170) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <vector>#include <algorithm>using namespace std;int main() { vector<int> times; int n, min = 0, t, t1, t2; cin>>n; for(int i=0;i<n;i++) { cin>>t; times.push_back(t); } sort(times.begin(), times.end()); for(int i=times.size()-1; i > 阅读全文
posted @ 2011-08-02 22:25 DOF_KL 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 来公司都大半个月了,之前在这里也实习过两个月,发现跟同事没什么共鸣,我想学的,跟他们聊也没什么反应,真是纳闷。刚找到了Google的论文站点地址,记录一下http://research.google.com/pubs/papers.html 阅读全文
posted @ 2011-08-01 12:53 DOF_KL 阅读(142) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;#define MAXN 100typedef struct point_st { double x,y;} *point_t;point_st points[MAXN] = { 0 };int main() { int N,i,j; double d,max_d_sqt = -1,x,y; point_st pointA, pointB; cin>>N; for(i=0;i<N;i++) cin>>points[i].x>>points[i].y; for(i= 阅读全文
posted @ 2011-07-31 20:45 DOF_KL 阅读(118) 评论(0) 推荐(0) 编辑
摘要: type_t reverse_bit(type_t x) { type_t val = 0; int i ; for(i=0; i<32; i++) { val = (val << 1) | (x & 1); x >>= 1; } return val;}val是x的位倒转值。 阅读全文
posted @ 2011-07-31 19:25 DOF_KL 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 计算位段里面1的个数是奇数还是偶数:size_t odd_or_even(size_t x) { size_t ret = 0; while(x) { ret ^= x; x >>= 1; } return ret & 1;}返回1表示奇数个"1”,0表示偶数个"1" 阅读全文
posted @ 2011-07-31 19:03 DOF_KL 阅读(143) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <string>#include <map>#include <deque>using namespace std;struct husband_st { string buy_name; int buy_amount;} *husband_t;husband_st mem[1001];int main() { int M, N, amount, count=0, remain, temp_remain, first_guy, second_guy; map<string, int&g 阅读全文
posted @ 2011-07-28 20:58 DOF_KL 阅读(159) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 9 下一页