2013年12月11日
摘要: Problem 2136 取糖果Accept: 89Submit: 221Time Limit: 1000 mSecMemory Limit : 32768 KBProblem Description有N个袋子放成一排,每个袋子里有一定数量的糖果,lzs会随机选择连续的几个袋子,然后拿走这些袋子中包含最多糖果的袋子。现问你,在选择x个袋子的情况下,lzs最坏情况下,也就是最少会拿到多少个糖果?对于x取值为1到n都分别输出答案。Input第一行一个整数T,表示有T组数据。每组数据先输入一行一个整数N(1 2 #include 3 #include 4 #include 5 #inc... 阅读全文
posted @ 2013-12-11 19:29 看见的是.... 阅读(140) 评论(0) 推荐(0)
  2013年8月23日
摘要: //开始 自己 做 ,不是 WA 就是 TLE// 后 来 还是看别人代码的//注意 此 下面 代码C++ AC ,G++ TLE;#include#include#include#includeusing namespace std;#define N 1005#define PR 1e-8struct TPoint{ double x,y; TPoint(){}; TPoint(double _x,double _y):x(_x),y(_y){} TPoint operator-(const TPoint p){return TPoint(x-p.x,y-p.y)... 阅读全文
posted @ 2013-08-23 10:07 看见的是.... 阅读(453) 评论(0) 推荐(0)
  2013年8月21日
摘要: //2分 水过//判断 在 以mid 的长度 是否在 M次内 能通过; 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int L; 7 int N,M; 8 int len[500050]; 9 int solve(int step)10 {11 int s=0,count=0,i=0;12 while(sans)34 ans=len[i]-len[i-1];35 long l=ans,r=L,mid;36 while(l<... 阅读全文
posted @ 2013-08-21 15:52 看见的是.... 阅读(177) 评论(0) 推荐(0)
摘要: //strstr 水过 1 #include 2 #include 3 char str1[1000004],str2[100]; 4 char *p; 5 int main() 6 { 7 int T; 8 scanf("%d",&T); 9 while(T--)10 {11 scanf("%s%s",str1,str2);12 int len=strlen(str2),count=0;13 p=str1;14 while((p=strstr(p,str2))!=NULL)15 {... 阅读全文
posted @ 2013-08-21 14:36 看见的是.... 阅读(286) 评论(0) 推荐(0)
摘要: //这 题我是用树状 数组写的//表示 对于我这种 数据结构都用没 学过的菜鸟 来说还是有一定难度的//不多说直接 附代#include#include#includeusing namespace std;struct node{ int num,count;}d[20005];int c[20005],n,str[20005][2];//str存每次攻击的范围;int lowbit(int x){ return x&(-x);}void update(int i,int j){ while(i0) { sum+=c[x]; x-=lowb... 阅读全文
posted @ 2013-08-21 10:32 看见的是.... 阅读(179) 评论(0) 推荐(0)
摘要: //注意这题的 质量 是 可以不用的//剩下的直接 用高中物理即可#include#include#includeusing namespace std;struct node{ double x; double h;}a[1010];double min_v(double h,double v){ return sqrt(2*20.0*h+v*v);}int main(){ int T; scanf("%d",&T); int n,p,m[1010],mt; for(int k=1;kx) { ... 阅读全文
posted @ 2013-08-21 10:14 看见的是.... 阅读(163) 评论(0) 推荐(0)

点击右上角即可分享
微信分享提示