上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 52 下一页
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1090 1 #include 2 #include 3 #include 4 #define maxn 20000 5 using namespace std; 6 7 int c[maxn],n,a[maxn]; 8 int lowbit(int x) 9 {10 return x&(-x);11 }12 13 void add(int pos)14 {15 while(pos0)26 {27 sum+=c[pos];28 pos-=lo... 阅读全文
posted @ 2014-03-21 17:17 null1019 阅读(112) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3435 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define inf 0x3f3f3f3f 7 #define maxn 54444 8 using namespace std; 9 10 queueq; 11 struct node 12 { 13 int u,v,next,val,f; 14 } p[maxn]; 15 int head[maxn]; 16 bool vis[maxn]; 17... 阅读全文
posted @ 2014-03-20 21:32 null1019 阅读(127) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1180 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main() 7 { 8 char s1[300]; 9 scanf("%s",s1);10 int k=strlen(s1);11 int sum=0;12 for(int i=0; i<k; i++)13 {14 sum+=(s1[i]-'0');15 }16 if(sum%3=... 阅读全文
posted @ 2014-03-19 20:41 null1019 阅读(84) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1106 1 #include 2 #include 3 #include 4 using namespace std; 5 6 bool g[200][200]; 7 int vis[200]; 8 int main() 9 {10 int n;11 scanf("%d",&n);12 int a;13 memset(g,false,sizeof(g));14 for(int i=1; i<=n; i++)15 {16 scanf(... 阅读全文
posted @ 2014-03-19 20:22 null1019 阅读(119) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1723 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 int main() 8 { 9 char s1[1000];10 cin>>s1;11 int k=strlen(s1);12 int b[1000];13 memset(b,0,sizeof(b));14 for(int i=0; imax1)23 {24 ... 阅读全文
posted @ 2014-03-19 19:47 null1019 阅读(144) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1104 1 #include 2 #include 3 #include 4 #define maxn 2000000 5 using namespace std; 6 7 char s1[maxn]; 8 9 int main()10 {11 scanf("%s",s1);12 int k=strlen(s1);13 char ch='+';14 int sum=0;15 for(int i=0; ich) ch=s1[i];18 if... 阅读全文
posted @ 2014-03-19 19:16 null1019 阅读(290) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1052 1 #include 2 #include 3 #include 4 using namespace std; 5 6 struct node 7 { 8 double x,y; 9 }p[500];10 11 double cross(node a,node b,node c)12 {13 return ((c.x-a.x)*(b.y-a.y)-(c.y-a.y)*(b.x-a.x));14 }15 int main()16 {17 int n;18 s... 阅读全文
posted @ 2014-03-19 18:34 null1019 阅读(150) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1837 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 vectorq[500]; 10 11 struct node 12 { 13 string s; 14 int num; 15 bool operator qq; 35 bool vis[50000]; 36 memse... 阅读全文
posted @ 2014-03-18 21:09 null1019 阅读(165) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1348 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const double eps=1e-10; 7 8 double dcmp(double x){ 9 if(fabs(x)0) return dis(p.x,p.y,b.x,b.y);43 else return (fabs(cross(p1,p2))/dis(a.x,a.y,b.x,b.y));44 }45 46 int mai... 阅读全文
posted @ 2014-03-18 19:39 null1019 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 极角排序 1 #include 2 #include 3 #include 4 #include 5 #define maxn 30000 6 using namespace std; 7 8 struct point 9 {10 double x,y;11 int num;12 }p[maxn];13 point pp;14 double cross(const point &a,const point &b,const point &c)15 {16 return (b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x);17 }18... 阅读全文
posted @ 2014-03-17 21:28 null1019 阅读(273) 评论(0) 推荐(0) 编辑
上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 52 下一页