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 ...
随机推荐
- Dropout 上
From <白话深度学习与TensorFlow> Dropout 顾名思义是“丢弃”,在一轮训练阶段丢弃一部分网络节点,比如可以在其中的某些层上临时关闭一些节点,让他们既不输入也不输出,这 ...
- KOA 框架
const koa = require('koa'); const static = require('koa-static'); const server = new koa(); // 静态文件 ...
- C语言的常用printf打印占位符%d, %u, %f, %s, %c, %o, %x
占位符含义及用法 代码: #include <stdio.h> int main(int argc, char const *argv[]) { , b = -; // 默认10进制赋值 ...
- HTTP——学习笔记(1)
名词解释: 协议: HTTP:HyperText Transfer Protocol,超文本传输协议,属于应用层的协议 FTP:File Transfer Protocol,文件传输协议,相比于HTT ...
- 2015 Multi-University Training Contest 2 hdu 5306 Gorgeous Sequence
Gorgeous Sequence Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Othe ...
- ActiveMQ maven
http://outofmemory.cn/java/mq/apache-activemq-demo
- 插入排序、冒泡排序、选择排序、希尔排序、高速排序、归并排序、堆排序和LST基数排序——C++实现
首先是算法实现文件Sort.h.代码例如以下: <pre name="code" class="java">/* * 实现了八个经常使用的排序算法: ...
- lua实现大数运算
lua实现的大数运算,代码超短,眼下仅仅实现的加减乘运算 ------------------------------------------------ --name: bigInt --creat ...
- CodeWars for JavaScript
SubClass https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes Sub classing with ...
- fullpage中大的图片超过一屏怎么在手机端滑动显示?
fullpage中大的图片超过一屏怎么在手机端滑动显示?(设置overflow电脑端是会出现滚动条的,但是在手机端不出现滚动条,图片也不可左右滑动显示) var $window = $(window) ...