摘要: 这个题的突破点就在于蚂蚁不能够穿过对方,故相对位置不变;另外,又可以把蚂蚁看成运动方向不变;代码: 1 #include 2 #include 3 using namespace std; 4 #define maxn 10005 5 6 char dir[][10]={"L","Turning","R"}; 7 8 int order[maxn]; 9 10 struct ant11 {12 int id,p,d;13 bool operatorl)puts("Fell off");46 else printf( 阅读全文
posted @ 2013-10-25 23:47 Yours1103 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 这个题的方法很巧妙,首先将整个圆分成(m+n)份,这样移动后的点都是在整数值上;所以只要计算在这样的分法下原来的坐标就行了;代码: 1 #include 2 #include 3 using namespace std; 4 5 int main() 6 { 7 int m,n; 8 { 9 while(scanf("%d%d",&n,&m)!=EOF)10 {11 double ans=0;12 for(int i=1;i<n;i++)13 {14 ... 阅读全文
posted @ 2013-10-25 22:49 Yours1103 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 这个题目的证明挺美的;把分金币问题变成了一个数轴上点的距离问题;代码: 1 #include 2 #include 3 #define ll long long 4 #define maxn 1000009 5 using namespace std; 6 7 ll a[maxn],b[maxn],sum,m; 8 9 int main()10 {11 int n;12 while(scanf("%d",&n)!=EOF)13 {14 sum=0;15 for(int i=0;i<n;i++){scanf("%lld",&a[i]) 阅读全文
posted @ 2013-10-25 13:12 Yours1103 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 水题怡情 1 #include 2 #include 3 #define maxn 1005 4 using namespace std; 5 struct war 6 { 7 int a,b; 8 bool operatort.b;11 }12 }wa[maxn];13 14 int main()15 {16 int n,ca=1;17 while(scanf("%d",&n)&&n)18 {19 for(int i=0;i<n;i++)scanf("%d%d",&wa[i].a,&wa[i].b);20 阅读全文
posted @ 2013-10-25 13:00 Yours1103 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 做一两个水题怡情一下! 1 #include 2 #include 3 #define maxn 20009 4 using namespace std; 5 int a[maxn],b[maxn]; 6 7 int main() 8 { 9 int n,m;10 while(scanf("%d%d",&n,&m)&&(n+m))11 {12 for(int i=0;im){puts("Loowater is doomed!");continue;}15 sort(a,a+n);16 sort(b,b+m);17 ... 阅读全文
posted @ 2013-10-25 12:47 Yours1103 阅读(113) 评论(0) 推荐(0) 编辑