Codeforces Round #454 A. Masha and Bears

科技中介服务机构想要提升服务效率,需要哪些数智工具支持?.docx 科技中介服务机构想要提升服务效率,需要哪些数智工具支持? 立即下载

题目链接:http://codeforces.com/contest/907/problem/A

A. Masha and Bears
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

A family consisting of father bear, mother bear and son bear owns three cars. Father bear can climb into the largest car and he likes it. Also, mother bear can climb into the middle car and she likes it. Moreover, son bear can climb into the smallest car and he likes it. It's known that the largest car is strictly larger than the middle car, and the middle car is strictly larger than the smallest car.

Masha came to test these cars. She could climb into all cars, but she liked only the smallest car.

It's known that a character with size a can climb into some car with size b if and only if a ≤ b, he or she likes it if and only if he can climb into this car and 2a ≥ b.

You are given sizes of bears and Masha. Find out some possible integer non-negative sizes of cars.

Input

You are given four integers V1, V2, V3, Vm(1 ≤ Vi ≤ 100) — sizes of father bear, mother bear, son bear and Masha, respectively. It's guaranteed that V1 > V2 > V3.

Output

Output three integers — sizes of father bear's car, mother bear's car and son bear's car, respectively.

If there are multiple possible solutions, print any.

If there is no solution, print "-1" (without quotes).

Examples
Input
Copy
50 30 10 10
Output
Copy
50
30
10
Input
Copy
100 50 10 21
Output
Copy
-1
Note

In first test case all conditions for cars' sizes are satisfied.

In second test case there is no answer, because Masha should be able to climb into smallest car (so size of smallest car in not less than 21), but son bear should like it, so maximum possible size of it is 20.

题目大意:

给你4个尺寸,分别是熊爸,熊妈,熊儿子,和masha的。然后让你给出3辆车的尺寸。这三辆车严格递减,分别是让熊爸,熊妈和熊儿子坐的并且masha喜欢做最小的内辆车。假设车的尺寸是b,那么a喜欢尺寸为b的车的条件是a<=b并且2*a>=b.注意不能让masha喜欢上中等及以上尺寸的车。

思路:

要想让masha能够坐进最小的车,那么最小车的尺寸b就必须大于等于masha 的尺寸a1,并且2*a1>=b.同时还需要保证b大于等于熊儿子的尺寸a2,同时2*a2>=b.最后还需要保证中等车的尺寸B满足B>2*a2.于是就转换成熊妈妈的尺寸a3>a2.以上条件不满足就输出-1

#include<string.h>
#include<iostream>
#include<algorithm>
#include<stdio.h>
#define ll long long
using namespace std;
int  main()
{
    int v1,v2,v3,v4;
    cin>>v1>>v2>>v3>>v4;
    if(v3*2<v4||v3>2*v4||v4>=v2)
    {
        cout<<-1<<endl;
    }
    else
    {
        if(v3>v4)
        {
            cout<<2*v1<<endl;
            cout<<2*v2<<endl;
            cout<<v3<<endl;
        }
        else
        {
            cout<<2*v1<<endl;
            cout<<2*v2<<endl;
            cout<<v4<<endl;
        }

    }
    return 0;
}
另外,这场的题意是真的有点坑。。。
KEPServerEX与三菱iQ-R系列PLC通讯 KEPServerEX与三菱iQ-R系列PLC通讯Mitsubishi Ethernet北京东方鼎晨科技有限公司目 录1. 前言2. 三菱PLC端相关设置3. Kepware端相关设置KEPServerEX是美国PTC Kepware公司生产的具有行业性的连接平台,KEPServerEX支持150多种通讯协议,用于向您的所有应用程序提供单一来源的工业自动化数据。该平台的设计使用户能够通过一个直观的用户界面来连接、管理、监视和控制不同的自动化设备和软件应用程序。KEPServerEX利用OPC(自动化产业的互 阅读详情

相关推荐

基于ROS2的无人机野生动物巡查系统设计

自主巡检系统是嵌入式人工智能与机器人技术融合的关键应用方向,其核心在于多源感知融合、实时路径规划与端侧智能识别的协同实现。原理上依赖SLAM定位构建环境地图,结合栅格化建模与混合路径算法(如蚁群+BFS)达成全覆盖遍历;技术价值体现在资源受限平台下的确定性响应与时空对齐能力,支撑高鲁棒性野外作业。典型应用场景包括生态监测、禁飞区巡检及小尺度智能安防。本文围绕ROS2 Humble中间件架构、Livox激光雷达与MaixCAM视觉协同、YOLO11n INT8模型端侧部署等关键技术展开,突出嵌入式AI与实时控

weixin_30598047的博客 650

Codeforces Round #407 (Div. 2) B. Masha and geometric depression

B. Masha and geometric depression time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Masha really loves algebra

Accepted ALL lve 679

Qt+PCL实战:如何用QVTKOpenGLNativeWidget高效渲染3D点云(附完整代码)

本文深入解析了Qt与PCL结合使用QVTKOpenGLNativeWidget进行高效3D点云渲染的实战技术。通过对比传统QVTKWidget,详细介绍了QVTKOpenGLNativeWidget在渲染效率、内存占用和兼容性方面的显著优势,并提供了完整的代码示例和性能优化策略,助力开发者在工业检测、自动驾驶等领域实现更高效的点云可视化。

keras9composer的博客 687

9anchor

CoordinatorLayout还提供了一种布局方式叫anchor,看下边效果对应xml <android.support.design.widget.FloatingActionButton android:id="@+id/fab" app:layout_anchor="@id/appbar" app:layout_anchorGravit

litefish的专栏 1596

项目回顾一:《高速多端口共享缓存模块》

本帖子仅为了回顾一下一年前自己动手完成的第一个数字ic设计项目的历程,为复试做一下准备,完成的这个sramc模块花了整整四个月的时间,从0到12个模块的代码产出以及模块的验证,虽然没有拿奖,也没有进入复赛,设计过程中使用的技术手段和算法也不太成熟,但这这是一个值得记录的过程!

weixin_60261760的博客 1255

Explorer.exe系统错误,电脑重启后刚开始一段时间正常,过一会桌面任务栏就卡死,可以打开任务管理器

联想E14Win10专业版。

本博客,博文仅代表个人操作经验,不能完全解决你的问题,仅供参考,佛系回复。 8053

CodeForce 907 A. Masha and Bears

A. Masha and Bears time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A family consisting of father bear, moth

DlPF_C的博客 1200

Vue + ECharts:从零构建智慧农业数据监控大屏(附完整源码)」 「超实用!一步步实现智慧农业大屏,完整代码+讲解」 「前端新手友好:Vue + ECharts 打造炫酷农业数据大屏」 「

Vue + ECharts:从零构建智慧农业数据监控大屏(附完整源码)」 「超实用!一步步实现智慧农业大屏,完整代码+讲解」 「前端新手友好:Vue + ECharts 打造炫酷农业数据大屏」 「前端可视化项目实战:智慧农业监控大屏开发详解」 「农作物可视化监控:用 Vue 和 ECharts 构建大屏应用」 「从零开始开发一个智慧农业数据大屏(代码+图表展示)」 「前端新手也能实现!智慧农业监控大屏开发教程」 「用 Vue 和 ECharts 搭建动态数据大屏:详细图文教程」 「学习前端大屏开发:

sky10100100的博客 1535

CF907A Masha and Bears 【思维】

【题解】CF907A Masha and Bears 【思维】

Sycamore_Ma的博客 252

C# 的 Dapper 库高级进阶:刨根问底的深度解析

通过今天的探索,我们了解了 Dapper 的一些高级功能,包括如何处理复杂的查询、执行批量操作以及如何优化性能。希望这篇深入浅出的文章能帮助你在实际项目中更好地运用 Dapper!🎈好了,小伙伴们,今天的分享就到这里啦!如果你有任何疑问或者想要分享自己的经验,请在评论区留言。我们下次再见!👋上述示例代码仅供参考,实际使用时请根据项目需求进行适当调整。✨Dapper 官方文档Dapper 性能优化指南Dapper 动态参数使用来同时执行多个查询。利用Execute和Query方法来简化 SQL 调用。

java专栏 813

基于Python的房地产评估数据抓取与分析 —— 房价走势与市场报告

在房地产行业中,了解和分析房产价格的变化趋势、各个地区的房价差异以及市场评价报告,可以帮助投资者、购房者以及政策制定者做出更加明智的决策。本文介绍了如何使用Python爬虫技术抓取房地产平台上的房产评估报告、价格走势等数据,并对抓取的数据进行分析。通过这些技术,您可以自动化抓取房地产平台的数据,分析房价走势,获取市场报告,为房地产投资决策提供数据支持。假设我们要从链家网抓取某个房产的价格、房产描述以及历史成交价格,首先需要获取目标房产页面的URL,并发送HTTP请求。伪装为常见浏览器,避免被识别为爬虫。

2201_76125261的博客 847

Codeforces Round #259(454A,454B,453A(排列组合))

1.Little Pony and Crystal Mine 题目链接: http://codeforces.com/problemset/problem/454/A 解题思路: Brief description: Draw the grid graph as the problem said. Analysis: Just a few basi

piaocoder 612

如何使用 Python 爬取 58 同城招聘信息

职位名称:招聘的岗位名称,如“前端开发”、“数据分析师”等。公司名称:招聘公司的名称。薪资待遇:职位的薪资范围,通常以“面议”、“10k-20k”这样的形式表示。工作地点:公司所在的城市及具体地址。公司福利:例如五险一金、带薪年假、绩效奖金等。发布时间:职位信息的发布时间。一个典型的招聘页面 URL 格式通常如下:在这个页面上,职位信息会分页展示,爬虫需要模拟翻页,获取多个页面的招聘信息。

2201_76125261的博客 1291

Codeforces Round #454 (Div. 2, based on Technocup 2018 Elimination Round 4) A - Masha and Bears

根据题意小熊和masha两人都可以坐最小的车并且喜欢。并且这masha的身材也严格小于中熊和大熊的身材,因为如果不是严格小于,中熊和大熊喜欢的车masha不可能不喜欢。在这个前提下,小熊和masha两者取大则两者都喜欢,中熊和大熊都取两倍的车#include <iostream> using namespace std; int main(){ int a,b,c,d; cin>>a

Myriad Dreamin 愿逐将属于我的奇迹 229

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

Codeforces Round #454 Div. 2 A B C (暂时)

A. Masha and bears 题意 人的体积为\(V\),车的大小为\(size\),人能钻进车的条件是\(V\leq size\),人对车满意的条件是\(2V\geq size\). 现知道 熊爸爸能钻进最大的车并且满意 熊妈妈能钻进中等的车并且满意 熊宝宝能钻进最小的车并且满意 Masha能钻进最小的车并且只对它满意 给定四人的体积(保证\(V1\gt V2\gt V3\...

ahu12345678的博客 173

OV9734 DATASHEET,完整规格书

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

Codeforces Round #454 (Div. 2, based on Technocup 2018 Elimination Round 4) A-C

这套题有史以来做的最恶心的一套题,没有之一; A题,讲的不明不白的。到底是区间还是这4个数,没有说明白, 交了7遍 全都是WA on test 4;因为一直认为就是这4个数里面选择 ,恶心, 实际要求是在区间里选定某个值; 暴力枚举!!!!!!! A: A. Masha and Bears time limit per test 2 seconds ...

weixin_30244889的博客 178

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

Codeforces 454A Little Pony and Crystal Mine

#define _CRT_SECURE_NO_WARNINGS #include &lt;iostream&gt; #include &lt;cstdio&gt; #include &lt;math.h&gt; #include &lt;string&gt; #include &lt;algorithm&gt; #include &lt;vector&gt; using namespace s...

Polanwind 270

CodeForces-907A Masha and Bears(想法水题)

CodeForces-907A Masha ans Bears

Boss_Xie的博客 674

Codeforces 907A Masha and Bears

A family consisting of father bear, mother bear and son bear owns three cars. Father bear can climb into the largest car and he likes it. Also, mother bear can climb into the middle car and she likes i

toby的博客 688

【codeforces454div2】A. Masha and Bears

A family consisting of father bear, mother bear and son bear owns three cars. Father bear can climb into the largest car and he likes it. Also, mother bear can climb into the middle car and she likes i

Lesroad 500

Codeforces Round #259 (Div. 2) A-Little Pony and Crystal Mine

A. Little Pony and Crystal Mine time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Twilight Sparkle once got a

守护生命的绿荷的专栏 909

907A - Masha and Bears

题意:真的是读的稀里糊涂的,我以为读懂了了,结果还是没有,一直不知道那个masha有什么用,我就感觉相当于小熊。 输入4个值,分别代表熊爸,熊妈,熊儿子,masha的大小,如果他们自己的尺寸=车的大小,就代表他们喜欢这辆车。 让我们求出输入三只熊喜欢车的大小,没有的话输出-1。 题解:暴力枚举,Msha的作用可能就是有个隐含条件,那就是它只喜欢最小的车,和小熊判断条件一样,但是还要判

memory_qianxiao的博客 763

题解___CodeForces 454A___10月___个人赛

该题目为模拟题, 注意从数组首位同时进行赋值会使算法时间复杂度降低 代码: #include #include #include using namespace std; const int maxn = 101; char matrix[maxn][maxn]; int n; int main() { while(scanf("%d",&n) != EOF)

zl_130的博客 400

Codeforces Round #454 - Div. 1 - (A)

A. Shockers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Valentin participates in a show called "Shocker

Orz 390

Codeforces 454A. Little Pony and Crystal Mine

time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Twilight Sparkle once got a crystal from the Crystal Mine. A crystal of size n (n

jjs98 962

Masha and Bears(CodeForces 907A )

Description A family consisting of father bear, mother bear and son bear owns three cars. Father bear can climb into the largest car and he likes it. Also, mother bear can climb into the middle car a...

Baiyi_destroyer的博客 314
上一篇: education round 20 d Magazine Ad
下一篇: Codeforces Round #454 B. Tic-Tac-Toe
sinwalker2333_
博客等级 码龄9年 0粉丝 10原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值