BestCoder Round #11 (Div. 2)
太菜,仅仅能去Div2.(都做不完 ORZ。。。
各自是 HDU:
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)的更多相关文章
- BestCoder Round #11 (Div. 2) 题解
HDOJ5054 Alice and Bob Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/O ...
- BestCoder Round #11 (Div. 2) 前三题题解
题目链接: huangjing hdu5054 Alice and Bob 思路: 就是(x,y)在两个參考系中的表示演全然一样.那么仅仅可能在这个矩形的中点.. 题目: Alice and Bob ...
- hdu 5636 搜索 BestCoder Round #74 (div.2)
Shortest Path Accepts: 40 Submissions: 610 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: ...
- hdu5631 BestCoder Round #73 (div.2)
Rikka with Graph Accepts: 123 Submissions: 525 Time Limit: 2000/1000 MS (Java/Others) Memory Lim ...
- hdu5630 BestCoder Round #73 (div.2)
Rikka with Chess Accepts: 393 Submissions: 548 Time Limit: 2000/1000 MS (Java/Others) Memory Lim ...
- (BestCoder Round #64 (div.2))Array
BestCoder Round #64 (div.2) Array 问题描述 Vicky是个热爱数学的魔法师,拥有复制创造的能力. 一开始他拥有一个数列{1}.每过一天,他将他当天的数列复制一遍,放在 ...
- 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 ( ...
- 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 ...
- hdu5635 BestCoder Round #74 (div.2)
LCP Array Accepts: 131 Submissions: 1352 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 13 ...
随机推荐
- 使用java向邮箱发送邮件
这是我很早之前写的一个工具类,最近在整理自己所学的东西,无意中找到了,就拿出来与大家分享,代码如下: import java.io.ByteArrayOutputStream; import java ...
- luogu P1405 苦恼的小明(欧拉定理)
题意 求a1^a2^a3^...^an(mod10007)n<=1000000,a[i]<=10000 题解 明眼人一眼就可以看出是欧拉定理的推论. 首先这个题是错的,没说保证互质. 然而 ...
- [codevs3657]括号序列
题目大意:有一列只有'(',')','[',']'构成的括号序列,求在序列中至少加上多少括号,能使该序列合法. 解题思路:区间dp. 我们以$f[i][j]$表示把区间$[i,j]$添成合法括号所需的 ...
- yum-config-manager --add-repo=
[root@server0 yum.repos.d]# yum-config-manager --add-repo=ftp://192.168.31.121/centos7u4Loaded plugi ...
- 微信小程序的开启授权,当单机取消授权后 再次授权
//单机去搜索 toSearch:function(){ this.getLocation(res => { console.log('成功') wx.navigateTo({ url: `.. ...
- CentOS的基本设置界面
系统的基本设置,如语言.键盘鼠标.时间.网络.壁纸.通知等功能的设置 高级设置:如磁盘分区.系统日志.各种系统分析工具
- vue2.0移动端自定义性别选择提示框
这篇文章主要是简单的实现了vue2.0移动端自定义性别选择的功能,很简单但是经常用到,于是写了一个小小的demo,记录下来. 效果图: 实现代码: <template> <div c ...
- Android 最火的高速开发框架xUtils
Github下载地址:https://github.com/wyouflf/xUtils xUtils简单介绍 xUtils 包括了非常多有用的Android工具. xUtils 最初源于Afinal ...
- CCEditBox/CCEditBoxImplAndroid
#ifndef __CCEDITBOXIMPLANDROID_H__ #define __CCEDITBOXIMPLANDROID_H__ #include "cocos2d.h" ...
- Android笔记——Activity中的数据传递案例(用户注冊)
1.创建程序activity_main: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/andro ...