Shirlies
宁静专注认真的程序媛~
摘要: 这一题起初我连题目都没有看懂,汗,貌似最近自己对题目的理解有点障碍啊,得多多看书了,最好拿本英文书阅读,泪崩啊……郁闷中,理解题目了,但是没有头绪,不知道这一题哪里是二分题目了,茫然中搜了题解http://www.cnblogs.com/newpanderking/archive/2011/08/24/2152576.html自卑啊,也明白了并不是学到了什么就一定会用!要灵活变化啊~~~#include "stdio.h"#include "math.h"#define pi acos(-1.0)//!!#define er 1e-6double are 阅读全文
posted @ 2012-02-19 21:03 Shirlies 阅读(610) 评论(0) 推荐(0) 编辑
摘要: 晕,这一题我是准备暴力的,但是这里给的数据有点大,那样是会TLE的,网上搜搜,无语啦,竟然可以这样来思考:合并前两个数组,然后再二分……#include "stdio.h"#include "stdlib.h"int li[505];int mi[505];int ni[505];int join[250005];int cmp(const void *a,const void *b){int *c,*d;c=(int *)a;d=(int *)b;return *c-*d;}int main(){int l,m,n;int s;int count=1; 阅读全文
posted @ 2012-02-19 17:07 Shirlies 阅读(555) 评论(0) 推荐(0) 编辑
摘要: 这一题摔的有点惨,为嘛?首先是题目看错了,还以为是数据范围的问题,改成__int64,总共wa了两次,在仔细看题目,汗……我应该取模的,好吧,取了模,还是Wa了,额……怎么了,网上翻了别人的代码,哦哦,数据范围有问题,刚才改的时候,又改回成int了,好了,a了。其实这一题蛮简单的,就是找规律……#include "stdio.h"#include "math.h"int main(){int T;__int64 n,k;scanf("%d",&T);while(T--){scanf("%I64d",& 阅读全文
posted @ 2012-02-19 15:33 Shirlies 阅读(458) 评论(0) 推荐(0) 编辑
摘要: 对这一题表示无语……#include "stdio.h"#include "math.h"int main(){int T;int n;scanf("%d",&T);while(T--){scanf("%d",&n);printf("%d\n",(int)pow(2,n)-1);}return 0;} 阅读全文
posted @ 2012-02-19 12:31 Shirlies 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 先求导,在二分……#include "stdio.h"#include "math.h"#define er 1e-4double get_equ(double x){return 42*pow(x,6)+48*pow(x,5)+21*x*x+10*x;}int main(){int T;double y;double mid,left,right;scanf("%d",&T);while(T--){scanf("%lf",&y);left=0;right=100;mid=50;while(fabs 阅读全文
posted @ 2012-02-19 11:20 Shirlies 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 基本的二分,但是我还是提交了几次,因为那个er开大了,超时了……#include "stdio.h"#include "math.h"#define er 1e-4//这里的er我起初开到了1e-7……超时了……int main(){int T;double n,t,u,d,a;scanf("%d",&T);while(T--){scanf("%lf",&n);n=n-6;if(n<0||n>(8*10000-100+3)*101*100){printf("No solutio 阅读全文
posted @ 2012-02-19 10:33 Shirlies 阅读(257) 评论(0) 推荐(0) 编辑