2013年8月6日
摘要: http://poj.org/problem?id=1068这个题的话就是先把给出来的一串数字转化成括号,再把括号转化成要求的,最后输出就行了#include#include#include#include#include#includeusing namespace std ;int main(){ stackQ; queuep,q; int n; cin>>n; for(int i = 1 ; i >m; int a[66]; for(int j = 1 ; j >a[j] ; if(j == 1) ... 阅读全文
posted @ 2013-08-06 20:49 枫、 阅读(195) 评论(0) 推荐(0) 编辑
摘要: Alice and BobTime Limit: 1000ms Memory limit: 65536K题目描述 Alice and Bob like playing games very much.Today, they introduce a new game. There is apolynomial like this:(a0*x^(2^0)+1) * (a1* x^(2^1)+1)*.......*(an-1* x^(2^(n-1))+1). Then Alice ask Bob Q questions. In theexpansion of the Polynomial, Gi.. 阅读全文
posted @ 2013-08-06 20:47 枫、 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 做模拟题做的我直接睡着了,题并不难,就是一个细心的问题,有一些细节问题注意了就差不多了,代码写的精美的一般找错误也好找一些,应该学着些好看的代码 1 #include 2 #include 3 #include 4 using namespace std ; 5 int len,high; 6 int a,b,j ; 7 struct node 8 { 9 int x; 10 int y ; 11 int dire; 12 } s[10001]; 13 int judge(int k) 14 { 15 int i; 16 if(s[k]... 阅读全文
posted @ 2013-08-06 13:46 枫、 阅读(214) 评论(0) 推荐(0) 编辑
  2013年8月5日
摘要: http://poj.org/problem?id=1328题的大意就是说在海里有小岛,坐标位置会给出,需要岸边的雷达覆盖所有的小岛,但雷达的覆盖范围有限,所以,需要最少的雷达覆盖所有的小岛,但若是有小岛没法被雷达给覆盖到,就输出-1;这个题的话可以转化成区间问题就是看雷达的覆盖范围作为半径,A若是小岛的位置,根据雷达的覆盖范围只要不小于这个点的Y坐标,那个覆盖范围就是这个三角形的斜边,所以只要雷达位于1,2边上就可以覆盖到这个小岛 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespa 阅读全文
posted @ 2013-08-05 21:36 枫、 阅读(290) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2586DescriptionAccounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lost some vital data for preparing annual report for MS Inc.All what they remember is that MS Inc. posted a surplus or a deficit each month of 1999 and each month when MS Inc. posted 阅读全文
posted @ 2013-08-05 19:34 枫、 阅读(198) 评论(0) 推荐(0) 编辑
  2013年8月3日
摘要: http://poj.org/problem?id=2965这个题的话,一开始也不会做,旁边的人说用BFS,后来去网上看了众大神的思路,瞬间觉得用BFS挺简单易;因为要让一个“+”变为“-”,只要将加号所在的位置(i,j)的行和列上的7个元素全部改变一次,这样的话(i,j)这个点将会变化7次,而 i 行上和 j 列另外六个元素将会变化4次,剩下的那些会变化2次,显而易见的是,一个位置上若翻转偶数次相当于没翻转,所以,只要记录下奇数次的翻转进行相加就可以了。 1 #include 2 #include 3 #include 4 #include 5 using namespace std ; 6 阅读全文
posted @ 2013-08-03 15:02 枫、 阅读(168) 评论(0) 推荐(0) 编辑
  2013年8月2日
摘要: http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2177题目描述 大家都知道,新生入学的前几周要体检,体检的那一天 HH 早起(九点半)来到了校医院,但是到了之后她发现排队等候体检的人太多了,而且人数在不断的增加。体检需要检查许多个项目,每个项目都需要排队,而且随着时间的推移,每个队列的人数都在慢慢增加。已知每个体检项目的队列都有两个属性(ai, bi):1、如果 HH 在 0 时刻站在了这个队列后,那么她需要 ai 秒就可以完成这个项目的体检;2、如果 HH 没在这个队列中,那么 HH 完成 阅读全文
posted @ 2013-08-02 19:56 枫、 阅读(269) 评论(0) 推荐(0) 编辑
  2013年8月1日
摘要: 这个题主要是判断硬币真假,可能轻可能重,称三次,要输出哪枚是假币,还要输出是重的还是轻的,所以最主要的是标记变量 1 #include 2 #include 3 #include 4 #include 5 using namespace std ; 6 7 int main() 8 { 9 int n ;10 while(cin>>n )11 {12 int a['L'+3] ;13 for(int k = 1 ; k >ch>>sh>>ju;20 if(strcmp(ju,"even")==0)21 ... 阅读全文
posted @ 2013-08-01 21:33 枫、 阅读(211) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1008&lang=default&change=true这个题倒是不难,就是麻烦一点,但是还WA了几次都是因为处理天数的时候没处理好,因为Haab这个日历日期是从0开始的,所以当第一年的最后一天第364天,而如果输入的恰好是365天应该是第二年的,所以,那个天数要放在下面处理 1 #include 2 #include 3 #include 4 using namespace std ; 5 int main() 6 { 7 int n ; 8 scanf("%d",&n) ; 9 printf( 阅读全文
posted @ 2013-08-01 14:41 枫、 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 这个题犯了一个小小的错误,double输出的时候用f才对,输入用lf即可。。。。http://poj.org/problem?id=1004 1 #include 2 int main() 3 { 4 5 double a[13],sum,ave; 6 int i; 7 sum=0; 8 for(i=0; i<=11; i++) 9 {10 scanf("%lf",&a[i]);11 sum+=a[i];12 }13 ave=sum/... 阅读全文
posted @ 2013-08-01 10:09 枫、 阅读(119) 评论(0) 推荐(0) 编辑