太菜,仅仅能去Div2.(都做不完 ORZ。。。

各自是 HDU:

5054

pid=5054"> Alice and Bob

5055Bob and math problem

5056Boring count

5057

pid=5057"> Argestes and Sequence

# 1001

碰面仅仅能在坐标中间。

所以推断一下就好了。

#include<cstdio>
#include<cstring>
#include<string>
#include<queue>
#include<algorithm>
#include<map>
#include<stack>
#include<iostream>
#include<list>
#include<set>
#include<vector>
#include<cmath> #define INF 0x7fffffff
#define eps 1e-8
#define LL long long
#define PI 3.141592654
#define CLR(a,b) memset(a,b,sizeof(a))
#define FOR(i,a,b) for(int i= a;i< b ;i++)
#define FOR0(i,a,b) for(int i= a;i>=b ;i--)
#define debug puts("==fuck==")
#define acfun std::ios::sync_with_stdio(false) #define SIZE 20+10
using namespace std; int main()
{
int n,m;
double x,y;
while(~scanf("%d%d%lf%lf",&n,&m,&x,&y))
{
double x1,y1,x2,y2;
x1=x,y1=y; x2=n-x,y2=m-y; if(abs(x1-x2)<=eps&&abs(y1-y2)<=eps)
puts("YES");
else
puts("NO");
}
}

# 1002

检查数字。题解给的是贪心。

我DFS写的。。。竟然没人Hack我……

5

1 0 0 0 0

-1

这组数据小心了。

5

1 1 0 0 0

10001

还有这。

#include<cstdio>
#include<cstring>
#include<string>
#include<queue>
#include<algorithm>
#include<map>
#include<stack>
#include<iostream>
#include<list>
#include<set>
#include<vector>
#include<cmath> #define INF 0x7fffffff
#define eps 1e-8
#define LL long long
#define PI 3.141592654
#define CLR(a,b) memset(a,b,sizeof(a))
#define FOR(i,a,b) for(int i= a;i< b ;i++)
#define FOR0(i,a,b) for(int i= a;i>=b ;i--)
#define debug puts("==fuck==")
#define acfun std::ios::sync_with_stdio(false) #define SIZE 20+10
using namespace std; int a[10],n;
bool cmp(int a,int b)
{
return a>b;
}
int num[101];
bool outflag; void dfs(int m)
{
if(outflag)return;
if(m==n)
{
if(num[m-1]&1)
{
FOR(j,0,n)
printf("%d",num[j]);
printf("\n");
outflag=1;
}
else
return;
}
FOR0(j,9,0)
{
if(a[j])
{
a[j]--;
num[m]=j;
dfs(m+1);
a[j]++;
}
}
} int main()
{
while(~scanf("%d",&n))
{
bool flag=0;
int odd=0;
int even=0;
CLR(a,0);
outflag=0;
FOR(i,0,n)
{
int tmp;
scanf("%d",&tmp);
if(tmp&1)flag=1;
a[tmp]++;
if(tmp&1)odd++;
else if(tmp!=0)even++;
}
if(!flag||(n!=1&&odd==1&&even==0))
{
puts("-1");
continue;
} dfs(0);
}
}

# 1003 知道是维护一个数列。时间复杂度是O(n)的。

ORZ。写了半天,还是没写出来,这周慢慢写吧,先挂这。

#

wait...

#

# 1004 我用线段树的,结果MLE。卡内存有意思?

有人说能够试试 unsigned short 看能不能过。

慢慢交吧。

反正在HDU41页。

#

wait...

#

BestCoder Round #11 (Div. 2)的更多相关文章

  1. BestCoder Round #11 (Div. 2) 题解

    HDOJ5054 Alice and Bob Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/O ...

  2. BestCoder Round #11 (Div. 2) 前三题题解

    题目链接: huangjing hdu5054 Alice and Bob 思路: 就是(x,y)在两个參考系中的表示演全然一样.那么仅仅可能在这个矩形的中点.. 题目: Alice and Bob ...

  3. hdu 5636 搜索 BestCoder Round #74 (div.2)

    Shortest Path  Accepts: 40  Submissions: 610  Time Limit: 4000/2000 MS (Java/Others)  Memory Limit: ...

  4. hdu5631 BestCoder Round #73 (div.2)

    Rikka with Graph  Accepts: 123  Submissions: 525  Time Limit: 2000/1000 MS (Java/Others)  Memory Lim ...

  5. hdu5630 BestCoder Round #73 (div.2)

    Rikka with Chess  Accepts: 393  Submissions: 548  Time Limit: 2000/1000 MS (Java/Others)  Memory Lim ...

  6. (BestCoder Round #64 (div.2))Array

    BestCoder Round #64 (div.2) Array 问题描述 Vicky是个热爱数学的魔法师,拥有复制创造的能力. 一开始他拥有一个数列{1}.每过一天,他将他当天的数列复制一遍,放在 ...

  7. BestCoder Round #69 (div.2) Baby Ming and Weight lifting(hdu 5610)

    Baby Ming and Weight lifting Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K ( ...

  8. BestCoder Round #68 (div.2) tree(hdu 5606)

    tree Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submis ...

  9. hdu5635 BestCoder Round #74 (div.2)

    LCP Array  Accepts: 131  Submissions: 1352  Time Limit: 4000/2000 MS (Java/Others)  Memory Limit: 13 ...

随机推荐

  1. 洛谷P2617 Dynamic Rankings 主席树 单点修改 区间查询第 K 大

    我们将线段树套在树状数组上,查询前预处理出所有要一起移动的节点编号,并在查询过程中一起将这些节点移到左右子树上. Code: #include<cstdio> #include<cs ...

  2. sql拼接

    with t as( select 'Charles' parent, 'William' child union select 'Charles', 'Harry' union select 'An ...

  3. CDQ分治笔记

    以前一直不会CDQ……然后经常听到dalao们说“这题直接CDQ啊”“CDQ不就秒了吗”的时候我只能瑟瑟发抖QAQ CDQ分治 其实CDQ分治就是二分分治,每次将$[l,r]$的问题划分为$[l,mi ...

  4. 垃圾回收器(GC)

    值类型占用的空间在方法执行结束后会被马上释放, 引用类型占用的空间在方法结束后不会被马上释放,具体什么时间释放由垃圾回收器(GC)来决定. GC(Garbage Collection):JAVA/.N ...

  5. 洛谷 P1052 过河 (离散化+dp)

    dp非常好想, f[i] = min(f[i-len] + stone[i]) s <= len <= t 然后因为L非常大,所以我就不知道该怎么搞了 我看到m只有100,而L有1e9,我 ...

  6. hook中ref使用

    hook使用ref 父组件: 引入                  useRef 声明ref的名字     const dateRef = useRef() 复值给组件         ref={d ...

  7. 2019年北航OO第三单元(JML规格任务)总结

    一.JML简介 1.1 JML与契约式设计 说起JML,就不得不提到契约式设计(Design by Contract).这种设计模式的始祖是1986年的Eiffel语言.它是一种限定了软件中每个元素所 ...

  8. [ML] Daily Portfolio Statistics

    Let's you have $10000, and you inverst 4 stocks. ['SPY', 'IBM', 'XOM', 'GOOG']. The allocation is [0 ...

  9. 用DOM动态控制表格

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding= ...

  10. Getting Started with MongoDB (C# Edition)

    https://docs.mongodb.com/getting-started/csharp/ 概览 Welcome to the Getting Started with MongoDB guid ...