xingshenxunliansai002

#新生训练赛002
##J
ENGLISH
Frog Wa has many frogs, so he can hear GuaGuaGua every day. But one day a flappy bird ate his frogs, so Frog Wa decided to build a fence to protect his precious frogs. Frog Wa told you four points (x, 0), (x, y), (z, 0), (z, t) which represent for the vertex of the fence. he want to know the area of the fence, can you tell him?
Input
The input consist of four integers x, y, z and t. 0 <= x, y, z, t <= 10000, x < z and y < t.
Output
For each test case, print the area, numbers should accurate to one decimal places.
Sample Input
1 1 2 2
0 2 6 6
0 0 2 10
Sample Output
1.5
24.0
10.0
Hint

CHINESE
蛙娃有很多青蛙,所以他每天都能听到瓜瓜瓜。但有一天,一只松松垮垮的鸟吃掉了青蛙,于是青蛙娃决定建一道篱笆来保护他珍贵的青蛙。青蛙告诉你四个点(x,0),(x,y),(z,0),(z,t)代表栅栏的顶点。他想知道篱笆的面积,你能告诉他吗?

输入

输入由四个整数x,y,z和t组成。0<=x,y,z,t<=10000,x<z和y<t。

输出

对于每个测试用例,打印区域,数字应精确到小数点后一位。

样本输入

1 1 2 2年

0 2 6 6个

0 0 2 10个

样本输出

1.5条

24.0分

10.0条

暗示


代码
#include<stdio.h>
int main()
{
int x,y,z,t;
while(scanf("%d%d%d%d",&x,&y,&z,&t)!=EOF)
{
double a=(z-x)y+(1.0/2.0)(z-x)*(t-y);
printf("%.1lf\n",a);
}
return 0;
}
思路:硬干
##I
Hkhv喜欢二进制
hkhv学长最近对二进制数很感兴趣,喜欢一切0和1组成的数。现在有一个十进制整数n,问你1到n之间有多少个数是只有0和1组成的类似二进制的数,输出他们的个数。

Input
输入数据包含一个数n (1 <= n <=10^9).
Output
输出1到n中类似二进制的数的个数.
Sample Input
10
Sample Output
2
Hint
对于n = 10,1 和 10是类似二进制的数.

代码
#include <stdio.h>
#include <string.h>
int ans,n;
void dfs(int v,int d)
{
if(!d)
{
if(v<=n&&v) ans++;
return;
}
dfs(10v+1,d-1);
dfs(10
v,d-1);
}
int main()
{
while(scanf("%d",&n)!=EOF)
{
ans=0;
dfs(0,10);
printf("%d\n",ans);
}
return 0;
}
思路
dfs杠上天
无
H - Perfect String CodeForces - 1265A
ENGLISH
A string is called beautiful if no two consecutive characters are equal. For example, “ababcb”, “a” and “abab” are beautiful strings, while “aaaaaa”, “abaa” and “bb” are not.

Ahcl wants to construct a beautiful string. He has a string s, consisting of only characters ‘a’, ‘b’, ‘c’ and ‘?’. Ahcl needs to replace each character ‘?’ with one of the three characters ‘a’, ‘b’ or ‘c’, such that the resulting string is beautiful. Please help him!

More formally, after replacing all characters ‘?’, the condition si≠si+1 should be satisfied for all 1≤i≤|s|−1, where |s| is the length of the string s.

Input
The first line contains positive integer t (1≤t≤1000) — the number of test cases. Next t lines contain the descriptions of test cases.

Each line contains a non-empty string s consisting of only characters ‘a’, ‘b’, ‘c’ and ‘?’.

It is guaranteed that in each test case a string s has at least one character ‘?’. The sum of lengths of strings s in all test cases does not exceed 105.

Output
For each test case given in the input print the answer in the following format:

If it is impossible to create a beautiful string, print “-1” (without quotes);
Otherwise, print the resulting beautiful string after replacing all ‘?’ characters. If there are multiple answers, you can print any of them.
Example
Input
3
a???cb
a??bbc
a?b?c
Output
ababcb
-1
acbac
Note
In the first test case, all possible correct answers are “ababcb”, “abcacb”, “abcbcb”, “acabcb” and “acbacb”. The two answers “abcbab” and “abaabc” are incorrect, because you can replace only ‘?’ characters and the resulting string must be beautiful.

In the second test case, it is impossible to create a beautiful string, because the 4-th and 5-th characters will be always equal.

In the third test case, the only answer is “acbac”.

CHINESE
如果没有两个连续的字符相等,则称字符串为beautiful。例如,“ababcb”、“a”和“abab”是漂亮的字符串,而“aaaaaa”、“abaa”和“bb”不是。

Ahcl想做一根漂亮的绳子。他有一个字符串s,只包含字符“a”、“b”、“c”和“?”.Ahcl需要替换每个字符“?”使用三个字符“a”、“b”或“c”中的一个,这样生成的字符串很漂亮。请帮帮他!

更正式地说,在替换所有字符“?”之后,条件s i≠si+1应满足所有1≤i≤| s |-1,其中| s |是字符串s的长度。

输入

第一行包含正整数t(1≤t≤1000)-测试用例数。接下来的t行包含测试用例的描述。

每一行包含一个非空字符串s,该字符串只包含字符“a”、“b”、“c”和“?”.

保证在每个测试用例中,字符串s至少有一个字符’?’。所有测试用例中字符串的长度之和不超过105。

输出

对于输入中给出的每个测试用例,请按以下格式打印答案:

如果无法创建漂亮的字符串,请打印“-1”(不带引号);

否则,请在替换所有“?”后打印生成的漂亮字符串角色。如果有多个答案,您可以打印其中任何一个。

注意

在第一个测试用例中,所有可能的正确答案都是“ababcb”、“abcacb”、“abcbcb”、“acabcb”和“acbacb”。“abcbab”和“ababc”这两个答案不正确,因为您只能替换“?”字符和生成的字符串必须美观。
在第二个测试用例中,不可能创建一个漂亮的字符串,因为第4个和第5个字符总是相等的。
在第三个测试用例中,唯一的答案是“acbac”。

代码
#include<stdio.h>
#include
#include<string.h>
using namespace std;
int t;
string a;
int main()
{
scanf("%d",&t);
while(t–)
{
cin>>a;
int d=0;
if(a[0]’?’){
if(a[1]!=‘a’)a[0]=‘a’;else
if(a[1]!=‘b’)a[0]=‘b’;else
if(a[1]!=‘c’)a[0]=‘c’;
}
for(int i=0;i<a.length();i++)
{
if(a[i]
’?’)
{
if(a[i+1]!=‘a’&&a[i-1]!=‘a’)a[i]=‘a’;else
if(a[i+1]!=‘b’&&a[i-1]!=‘b’)a[i]=‘b’;else
if(a[i+1]!=‘c’&&a[i-1]!=‘c’)a[i]=‘c’;
}
else if(a[i]a[i+1])
{
printf("-1\n");
d=1;
break;
}
}
if(d
0) cout<<a<<"\n";
}
}
思路
s[0]=? -->从a到c,不等于s[1]
s[i]=? -->从a到c,不等于前后
(i>0)
如果相邻有两个字母(一样的)直接完蛋。
G - 0011
ENGLISH
Alex likes to play with one and zero!One day he gets an empty string.So our cute boy wants to add one and zero in it. Every time he will add ‘01’in the string at any position and then get a new string.For example:if the string is “01” now ,he can get “0101” or “0011,Now give you a string that is Alex has get,you need to answer whether the string is legal?

Input
First is a integer n(n<=100)
Next contains n lines .Every line is a string whose legth is no more than 1000.
Output
For each case output “YES” in a single line if it’s legal.
Or you need to output “NO”;
Sample Input
3
0101
0110
0011
Sample Output
YES
NO
YES
Hint

CHINESE
亚历克斯喜欢玩一和零!有一天他得到了一根空绳子。所以我们可爱的男孩想在里面加一个零。每次他在字符串的任何位置加上’01’,然后得到一个新字符串。例如:如果字符串现在是“01”,他可以得到“0101”或“0011,现在给你一个字符串,这是亚历克斯得到的,你需要回答字符串是否合法?
输入
第一个是整数n(n<=100)
Next包含n行,每行是一个长度不超过1000的字符串。
输出
对于每个案例,如果合法的话,在一行中输出“是”。
或者你需要输出“否”;
Sample Input
3
0101
0110
0011
Sample Output
YES
NO
YES
暗示

代码
#include <stdio.h>
#include <string.h>
char a[1010];
int main()
{
int n;
scanf("%d",&n);
while(n–)
{
scanf("%s",a);
int hhh=0,f=0;
int str=strlen(a);
for(int i=0;i<str;i++)
{
if(a[i]‘0’)
hhh++;
else if(a[i]
‘1’)
hhh–;
if(hhh<0)
{
printf(“NO\n”);
f=1;
break;
}
}
if(!f&&!hhh)
printf(“YES\n”);
else if(!f)
printf(“NO\n”);
}
return 0;
}
思路
从头开始整,一旦hhh<0,表示此时0数小于1,直接玩儿蛋;
整完hhh=0才算过关。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
牙科就诊管理系统利用当下成熟完善的SSM框架,使用跨平台的可开发大型商业网站的Java语言,以及最受欢迎的RDBMS应用软件之一的Mysql数据库进行程序开发。实现了用户在线查看数据。管理员管理病例管理、字典管理、公告管理、药单管理、药品管理、药品收藏管理、药品评价管理、药品订单管理、牙医管理、牙医收藏管理、牙医评价管理、牙医挂号管理、用户管理、管理员管理等功能。牙科就诊管理系统的开发根据操作人员需要设计的界面简洁美观,在功能模块布局上跟同类型网站保持一致,程序在实现基本要求功能时,也为数据信息面临的安全问题提供了一些实用的解决方案。可以说该程序在帮助管理者高效率地处理工作事务的同时,也实现了数据信息的整体化,规范化与自动化。 管理员在后台主要管理病例管理、字典管理、公告管理、药单管理、药品管理、药品收藏管理、药品评价管理、药品订单管理、牙医管理、牙医收藏管理、牙医评价管理、牙医挂号管理、用户管理、管理员管理等。 牙医列表页面,此页面提供给管理员的功能有:查看牙医、新增牙医、修改牙医、删除牙医等。公告信息管理页面提供的功能操作有:新增公告,修改公告,删除公告操作。公告类型管理页面显示所有公告类型,在此页面既可以让管理员添加新的公告信息类型,也能对已有的公告类型信息执行编辑更新,失效的公告类型信息也能让管理员快速删除。药品管理页面,此页面提供给管理员的功能有:新增药品,修改药品,删除药品。药品类型管理页面,此页面提供给管理员的功能有:新增药品类型,修改药品类型,删除药品类型。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值