Codeforces Round #250 (Div. 2) 437A The Child and Homework(模拟)

orchestrator常见问题汇总 默认的取集群名称的规则为参数决定 ,默认为取主实例 主机名 ,然后按分隔符"."之前的第一段字符为集群别名,这样在集群主库宕机后,新提升的从库的服务器名称为了新的集群名,宕机的主库成为单独的一个集群。1 默认配置文件中设置了匹配规则 ,只有被匹配的主机名才能进行故障恢复,所以该参数需要设置为 "*"3 另外配置文件中还有许多发现,恢复的忽略规则(Ignore) 这些参数也是需要注意的。由于LVS的后端的RS为IP地址,如果直接显示主机名,LVS的接口方法将无法工作。只传入脚本中用到的参数,不要多传入。 阅读详情

A. The Child and Homework
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.

Fortunately the child knows how to solve such complicated test. The child will follow the algorithm:

  • If there is some choice whose description at least twice shorter than all other descriptions, or at least twice longer than all other descriptions, then the child thinks the choice is great.
  • If there is exactly one great choice then the child chooses it. Otherwise the child chooses C (the child think it is the luckiest choice).

You are given a multiple-choice questions, can you predict child's choose?

Input

The first line starts with "A." (without quotes), then followed the description of choice A. The next three lines contains the descriptions of the other choices in the same format. They are given in order: B, C, D. Please note, that the description goes after prefix "X.", so the prefix mustn't be counted in description's length.

Each description is non-empty and consists of at most 100 characters. Each character can be either uppercase English letter or lowercase English letter, or "_".

Output

Print a single line with the child's choice: "A", "B", "C" or "D" (without quotes).

Sample test(s)
input
A.VFleaKing_is_the_author_of_this_problem
B.Picks_is_the_author_of_this_problem
C.Picking_is_the_author_of_this_problem
D.Ftiasch_is_cute
output
D
input
A.ab
B.abcde
C.ab
D.abc
output
C
input
A.c
B.cc
C.c
D.c
output
B
Note

In the first sample, the first choice has length 39, the second one has length 35, the third one has length 37, and the last one has length 15. The choice D (length 15) is twice shorter than all other choices', so it is great choice. There is no other great choices so the child will choose D.

In the second sample, no choice is great, so the child will choose the luckiest choice C.

In the third sample, the choice B (length 2) is twice longer than all other choices', so it is great choice. There is no other great choices so the child will choose B.



好好读题轻易ac,题目说有确定的一个选项则输出该选项,否则输出C。


AC代码:


#include "iostream"
#include "cstdio"
#include "cstring"
#include "algorithm"
using namespace std;
struct node
{
	/* data */
	int len;
	char s[200], flag;
}a[4];
bool cmp(node a, node b)
{
	if(a.len == b.len)
		return a.flag < b.flag;
	return a.len < b.len;
}
int main(int argc, char const *argv[])
{
	for(int i = 0; i < 4; ++i) {
		scanf("%s", a[i].s);
		a[i].flag = a[i].s[0];
		a[i].len = strlen(a[i].s) - 2;
	}
	sort(a, a + 4, cmp);
	bool flag1 = false, flag2 = false;
	if(a[0].len * 2 <= a[1].len) flag1 = true;
	if(a[3].len >= a[2].len * 2) flag2 = true;	
	if((flag2 && flag1) || (!flag2 && !flag1)) printf("C\n"); 
	else if(flag1) printf("%c\n", a[0].flag);
	else if(flag2) printf("%c\n", a[3].flag);
	return 0;
}


25、BDS-3卫星信号性能与PPP-B2b增强消息完整性分析 本文对BDS-3卫星信号性能及PPP-B2b增强消息的完整性进行了系统分析。评估了MEO、IGSO和GEO卫星的轨道与时钟精度,得出BDS-3总体SISRE为0.25 m,系统完整性可覆盖99.999%的误差。分析表明SIS中断主要由时钟调整和轨道机动引起,个别卫星存在因境外监测受限导致的非计划中断。通过自研解码软件对PPP-B2b增强消息进行采集与解析,实验结果显示BDS-3和GPS的平均历元完整性率均高于98.55%,其中卫星掩码和时钟校正消息的完整性率超过99.8%。研究还发现IGSO卫星相比MEO卫 阅读详情

相关推荐

接口调试必看:status显示canceled的3种常见原因及修复方法

本文深度解析了接口调试中status显示canceled的三种核心原因:网络层中断(如请求超时)、应用层逻辑主动取消(如请求竞态、组件卸载)以及用户交互与浏览器行为。文章提供了从诊断到修复的系统性方案,包括分析Network Timing、使用Axios CancelToken、优化请求策略与性能,帮助开发者从根本上解决这一常见问题。

bb456的博客 936

The Child and Homework

The Child and Homework Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a de...

weixin_44824383的博客 205

基于springboot生鲜食品订购系统的设计与实现

近年来互联网络的迅猛发展和电子终端设备的普及,赋予了各行业充足的发展空间。微信小程序的O2O生鲜食品订购相比于传统信息技术,时效性是它最大的特色,已经在电子娱乐、经济等中发挥着举足轻重的作用。短时间内迅速扩大了线上管理系统的规模。尽管O2O生鲜食品订购已经有了很大程度的发展,但在微信小程序的O2O生鲜食品订购领域上却少有建设。

1024

CF#250 (Div. 2) A .

The Child and Homework time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Once upon a time a child got a test consisting of

代码艺术的道与术 817

中兴OLT配置实战:从零开始,手把手教你完成一个HGU的完整业务开通(含DBA模板、限速与远程升级)

本文详细介绍了中兴OLT配置实战,从零开始手把手教你完成HGU的完整业务开通,包括DBA模板设计、限速与远程升级等关键步骤。通过实际案例和详细命令,帮助工程师快速掌握GPON网络配置技巧,提升运维效率。

weixin_30599769的博客 348

DC-DC BUCK电路 PCB 布局布线 5 要点:以 XL4015 12V转5V 为例解析噪声控制

本文以XL4015 12V转5V降压电路为例,详细解析DC-DC BUCK电路PCB布局布线的5个关键要点,重点探讨噪声控制策略。通过功率回路最小化、热管理与接地优化、电感电容布局、反馈网络防干扰设计以及实测验证技巧,帮助工程师实现高效稳定的电源设计,显著降低输出纹波和电磁干扰。

weixin_29165725的博客 369

Codeforces Round #250 (Div. 2) A. The Child and Homework

A. The Child and Homework time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Once upon a time a child got a tes

flyljg的专栏 856

2D Nesting Defining a CSV File of Part Data

若。

qq_36560674的博客 1838

A. The Child and Homework

http://codeforces.com/contest/437/problem/A 1 import java.util.ArrayList; 2 import java.util.Scanner; 3 4 public class Main { 5 6 public static void main(String[] args) ...

ao9795的博客 201

地瓜机器人RDK Studio使用入门教程

不知道大家在使用AI开发板的时候有没有遇到过板子官方镜像占据空间大难以保存,想要的时候找不到?官方示例项目久而久之便难以找寻?首次登陆开发板连接网络还需要准备显示器键盘鼠标外设繁杂?…为了解决平时开发过程中遇到的种种不便利问题,地瓜机器人创新的推出了RDK Studio这一官方开发者软件,使智能机器人开发迎来新纪元!通过这一软件极大降低了机器人的开发门槛,哪怕是零基础的用户亦可轻松上手RDK系列板卡!

xiongqi123123的博客 3427

Windows版,vcenter 6.0 STS 证书更新--Vcenter 6.0 windows 版,没有-set_signing_cert 替换参数

Windows版,vcenter 6.0 STS 证书手动更新

技术是手段,服务才是目的。开源与协作是创新的活水,而核心技术的自主可控是立足之本。身处黄金时代,唯持续学习,方能不惧变化。从使用者到创造者,中国技术的未来,正待你们接过火炬,走得更远、更稳、更好。 675

Codeforces Round #250 (Div. 2) A - The Child and Homework

传送门Codeforces Round #250 (Div. 2) A - The Child and Homework

一只冰熊 1871

DISM进行系统修复,进度条卡在63.2%的解决方法

一时用不了软件,安装修复的时候也出现问题 DISM一直卡在63.2%,等了好久时间,直接强制退出寻找最终的解决方案

码农研究僧的博客 1万+

Codeforces Round #250 (Div. 1) D. The Child and Sequence(线段树+区间求模+区间查询)

先呈上原题链接[Codeforces Round #250 (Div. 1) D. The Child and Sequence] 题意: 给定一组数有三个操作: 区间每个值对P求模; 单点修改 询问区间和 思路: 两棵线段树,一个维护区间最大值,一个维护区间和。 因为求模运算每次至少是折半的,所以对需要求模的暴力修改就行了。 坑点: 无 good luck and have fun!!! 附上代...

BNUbeginner的博客 247

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

Codeforces Round #250 (Div. 2) 437C The Child and Toy(脑洞贪心)

C. The Child and Toy time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output On Children's Day, the child got a toy

GKHack's Blog 1626

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

Codeforces Round #250 (Div. 2) C. The Child and Toy 详解

output standard output On Children's Day, the child got a toy from Delayyy as a present. However, the child is so naughty that he can't wait to destroy the toy. The toy consists of n parts and

__ElemenT 1504

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

Codeforces Round #250 (Div. 1) D. The Child and Sequence 分块

/* Codeforces Round #250 (Div. 1) D. The Child and Sequence 分块 链接:https://codeforces.com/contest/438/problem/D 题意: op 1 : 区间加 op 2 : 区间每个数取模 op 3 : 单点修改; 分块 操作1 : 区间加 完整块O(1),非完整块暴力累加即可; 操作2 : 取模 ...

布呗之路 349

Codeforces Round #250 Div. 2(C.The Child and Toy)

题目如下: C. The Child and Toy time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output On Children's Day, the child

Sun_tester的专栏 1801

Codeforces Round #250 (Div. 2)——The Child and Set

给定goal和limit,求1-limit中的若干个数,每个数最多出现一次,且这些数的lowbit()值之和等于goal,如果存在这样的一些数,输出个数和每个数;否则-1

Confidence的专栏 1506

Codeforces Round #250 (Div. 1) D. The Child and Sequence

D. The Child and Sequence time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output At the children's day, the child

qqspeed 1864

Codeforces Round #250 (Div. 2)—A. The Child and Homework

好题啊,被HACK了,以前做题都是人数越来越多,这次比赛 PASS人数 从2000直掉 1000人  被HACK  1000多人!!!!没见过的科技啊 A. The Child and Homework time limit per test 1 second memory limit per test 256 megabytes input

NotPerfect-EOF 1806

Codeforces Round #250 Div1A Div2C 437C The Child and Toy 贪心

这道题我在考场上并不是自己想出来的,是在别人帮助下搞懂的。

KuribohG 1016

Codeforces Round #250 (Div. 2) B. The Child and Set

B - The Child and Set 链接: B - The Child and Set. At the children’s day, the child came to Picks’s house, and messed his house up. Picks was angry at him. A lot of important things were lost, in particular the favorite set of Picks. Fortunately, Picks remem

浅蓝色の伤的博客 148
上一篇: POJ3268 Silver Cow Party(dijkstra)
下一篇: Codeforces Round #250 (Div. 2) 437C The Child and Toy(脑洞贪心)
GKHack
博客等级 码龄11年 48粉丝 291原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值