听说是邀请赛啊,大概做了做…中午出去吃了个饭回来过掉的I。然后去做作业了……

 #include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <climits>
#include <complex>
#include <fstream>
#include <cassert>
#include <cstdio>
#include <bitset>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <ctime>
#include <set>
#include <map>
#include <cmath> using namespace std; #define fr first
#define sc second
#define pb(a) push_back(a)
#define Rint(a) scanf("%d", &a)
#define Rll(a) scanf("%I64d", &a)
#define Rs(a) scanf("%s", a)
#define FRead() freopen("in", "r", stdin)
#define FWrite() freopen("out", "w", stdout)
#define Rep(i, len) for(int i = 0; i < (len); i++)
#define For(i, a, len) for(int i = (a); i < (len); i++)
#define Cls(a) memset((a), 0, sizeof(a))
#define Full(a) memset((a), 0x7f7f, sizeof(a)) typedef long long ll;
const int maxn = ;
string s;
int g[]; int main() {
// FRead();
int T;
Rint(T);
while(T--) {
string pre;
int pos = ;
Cls(g);
while(cin >> s) {
if(s[] == 'E') break;
if(::s == pre) {
pos = - pos;
g[pos]++;
pre = ::s;
}
else {
g[pos]++;
pre = ::s;
}
}
// cout << g[0] << " "<< g[1] <<endl;
printf("%d\n", g[] * g[]);
}
return ;
}

C

 #include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <climits>
#include <complex>
#include <fstream>
#include <cassert>
#include <cstdio>
#include <bitset>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <ctime>
#include <set>
#include <map>
#include <cmath> using namespace std; #define fr first
#define sc second
#define pb(a) push_back(a)
#define Rint(a) scanf("%d", &a)
#define Rll(a) scanf("%I64d", &a)
#define Rs(a) scanf("%s", a)
#define FRead() freopen("in", "r", stdin)
#define FWrite() freopen("out", "w", stdout)
#define Rep(i, len) for(int i = 0; i < (len); i++)
#define For(i, a, len) for(int i = (a); i < (len); i++)
#define Cls(a) memset((a), 0, sizeof(a))
#define Full(a) memset((a), 0x7f7f, sizeof(a)) typedef long long ll;
ll n, k; int main() {
// FRead();
while(~Rint(n) && ~Rint(k)) {
ll t;
while() {
if(t == n) break;
t = n;
n /= ;
n += k;
}
cout << t << endl;
}
return ;
}

H

 #include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <climits>
#include <complex>
#include <fstream>
#include <cassert>
#include <cstdio>
#include <bitset>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <ctime>
#include <set>
#include <map>
#include <cmath> using namespace std; #define fr first
#define sc second
#define pb(a) push_back(a)
#define Rint(a) scanf("%d", &a)
#define Rll(a) scanf("%I64d", &a)
#define Rs(a) scanf("%s", a)
#define FRead() freopen("in", "r", stdin)
#define FWrite() freopen("out", "w", stdout)
#define Rep(i, len) for(int i = 0; i < (len); i++)
#define For(i, a, len) for(int i = (a); i < (len); i++)
#define Cls(a) memset((a), 0, sizeof(a))
#define Full(a) memset((a), 0x7f7f, sizeof(a)) const int maxn = ;
double n, V;
double a[maxn], v[maxn];
double ans; int main() {
// FRead();
while(cin >> n >> V) {
bool exflag = ;
ans = ;
Rep(i, n) {
cin >> a[i] >> v[i];
if(abs(v[i]) >= V && a[i] != ) exflag = ;
}
if(exflag) {
printf("Bad Dog\n");
continue;
}
double pos = ;
Rep(i, n) {
a[i] += ans * v[i];
if(a[i] == pos) continue;
if(a[i] < pos) V = - * abs(V);
else V = abs(V);
if(abs(V - v[i]) <= ) {
exflag = ;
break;
}
double d = abs(pos - a[i]);
double t = d / abs(V - v[i]);
ans += t;
pos += t * V;
}
if(exflag) printf("Bad Dog\n");
else printf("%.2lf\n", ans);
}
return ;
}

I

 #include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <climits>
#include <complex>
#include <fstream>
#include <cassert>
#include <cstdio>
#include <bitset>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <ctime>
#include <set>
#include <map>
#include <cmath> using namespace std; #define fr first
#define sc second
#define pb(a) push_back(a)
#define Rint(a) scanf("%d", &a)
#define Rll(a) scanf("%I64d", &a)
#define Rs(a) scanf("%s", a)
#define FRead() freopen("in", "r", stdin)
#define FWrite() freopen("out", "w", stdout)
#define Rep(i, len) for(int i = 0; i < (len); i++)
#define For(i, a, len) for(int i = (a); i < (len); i++)
#define Cls(a) memset((a), 0, sizeof(a))
#define Full(a) memset((a), 0x7f7f, sizeof(a)) const int maxn = ;
int h[maxn];
int ans;
int n; int check(int d) {
int ret = ;
int tmp = ;
for(int i = ; i <= ; i++) {
tmp = ;
if(h[i] == ) continue;
for(int j = i; j <= ; j+=d) {
if(h[j]) tmp++;
else break;
}
ret = max(tmp, ret);
}
return ret;
} int main() {
// FRead();
int tmp;
while(~Rint(n)) {
Cls(h);
ans = ;
Rep(i, n) {
Rint(tmp);
h[tmp]++;
}
//d = 0
for(int i = ; i <= ; i++) {
ans = max(ans, h[i]);
}
for(int d = ; d <= ; d++) {
ans = max(ans, check(d));
}
cout << ans << endl;
}
return ;
}

J

[HZAU]华中农业大学第四届程序设计大赛网络同步赛的更多相关文章

  1. (hzau)华中农业大学第四届程序设计大赛网络同步赛 G: Array C

    题目链接:http://acm.hzau.edu.cn/problem.php?id=18 题意是给你两个长度为n的数组,a数组相当于1到n的物品的数量,b数组相当于物品价值,而真正的价值表示是b[i ...

  2. 华中农业大学第四届程序设计大赛网络同步赛 G.Array C 线段树或者优先队列

    Problem G: Array C Time Limit: 1 Sec  Memory Limit: 128 MB Description Giving two integers  and  and ...

  3. 华中农业大学第四届程序设计大赛网络同步赛 J

    Problem J: Arithmetic Sequence Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 1766  Solved: 299[Subm ...

  4. 华中农业大学第四届程序设计大赛网络同步赛 I

    Problem I: Catching Dogs Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 1130  Solved: 292[Submit][St ...

  5. 华中农业大学第四届程序设计大赛网络同步赛-1020: Arithmetic Sequence,题挺好的,考思路;

    1020: Arithmetic Sequence Time Limit: 1 Sec  Memory Limit: 128 MB Submit:  ->打开链接<- Descriptio ...

  6. 华中农业大学第五届程序设计大赛网络同步赛-L

    L.Happiness Chicken brother is very happy today, because he attained N pieces of biscuits whose tast ...

  7. 华中农业大学第五届程序设计大赛网络同步赛-K

    K.Deadline There are N bugs to be repaired and some engineers whose abilities are roughly equal. And ...

  8. 华中农业大学第五届程序设计大赛网络同步赛-G

    G. Sequence Number In Linear algebra, we have learned the definition of inversion number: Assuming A ...

  9. 华中农业大学第五届程序设计大赛网络同步赛-D

    Problem D: GCD Time Limit: 1 Sec  Memory Limit: 1280 MBSubmit: 179  Solved: 25[Submit][Status][Web B ...

随机推荐

  1. Linux命令练级初级

    Linux命令练级初级 http://ke.qq.com/video/index.html?course_id=6815 ls    -a 所有文件    -l    类型,连接数,所属用户,工作组, ...

  2. SQL Server 2008安装和配置过程

    下面我将用图解的方式,来介绍SQL Server 2008安装和配置过程,希望对大家有所帮助. 闲言少叙,直奔主题!点击setup.exe安装文件后,如果系统没有以下组件,则会出现如下提示! 安装20 ...

  3. 8种方法提升windows 8使用方便-----Win+x 编辑菜单

    在windows 8上,你可以同时按下windows键和x键或者右键点击屏幕左下角打开一个菜单名为电源菜单或者快速访问菜单,这个菜单包含快速访问系统的工具,如控制面板,命令提示符,任务管理器,资源管理 ...

  4. 从一个新手容易混淆的例子简单分析C语言中函数调用过程

    某天,王尼玛写了段C程序: #include <stdio.h> void input() { int i; ]; ; i < ; i++) { array[i] = i; } } ...

  5. C# File

    http://msdn.microsoft.com/zh-cn/library/system.io.file(v=vs.110).aspx using System; using System.IO; ...

  6. java url中文参数乱码问题

    http://www.blogjava.net/jerry-zhaoj/archive/2009/07/16/286993.html 转 JAVA 中URL链接中文参数乱码的处理方法JAVA 中URL ...

  7. K短路

    K短路 用dijsktra+A*启发式搜索当点v第K次出堆的时候,这时候求得的路径是k短路.A*算法有一个启发式函数f(p)=g(p)+h(p), 即评估函数=当前值+当前位置到终点的最短距离g(p) ...

  8. NYOJ-36 最长公共子序列 AC 分类: NYOJ 2014-01-03 20:54 155人阅读 评论(0) 收藏

    #include<stdio.h> #include<string.h> #define N 1010 #define max(x,y) x>y?x:y int dp() ...

  9. Linq to EF 与Linq to Object 使用心得

    大家都知道Linq既可以用来查询数据库对象(我这里指的是Entity FrameWork里的Model对象),也可以用来查询内存中的IEnumerable对象. 两者单独查询时都不会出现什么问题,不过 ...

  10. CentOS下安装Redmine 2.5.2

    Redmine是用Ruby开发的基于web的项目管理软件,所以先要下载安装Ruby,再下载对 Ruby组件进行打包的 Ruby 打包系统RubyGems. 第一步:下载必要的软件 1.依赖包安装 # ...