当前位置:网站首页>hdu1495 非常可乐 (广搜)
hdu1495 非常可乐 (广搜)
2022-08-08 18:58:00 【51CTO】
非常可乐
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 14064 Accepted Submission(s): 5600
Problem Description
大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,且 S==N+M,101>S>0,N>0,M>0) 。聪明的ACMER你们说他们能平分吗?如果能请输出倒可乐的最少的次数,如果不能输出"NO"。
Input
三个整数 : S 可乐的体积 , N 和 M是两个杯子的容量,以"0 0 0"结束。
Output
如果能平分的话请输出最少要倒的次数,否则输出"NO"。
Sample Input
Sample Output
Author
Source
“2006校园文化活动月”之“校庆杯”大学生程序设计竞赛暨杭州电子科技大学第四届大学生程序设计竞赛
Recommend
LL | We have carefully selected several similar problems for you: 1072 1372 1180 1240 1026
Statistic | Submit | Discuss | Note
类似三个水杯倒水。
假如i向j倒水有以下规则:
- 如果i水杯内水的容量大于j水杯内倒满所需的容量x,则i水杯倒水后的容量为:i-x,j水杯倒水后容量为:j+x
- 如果i水杯内水的容量小于j水杯内倒满所需的容量x,则i水杯倒水后的容量为:0,j水杯倒水后容量为:j+x
边栏推荐
- [MRCTF2020]你传你码呢
- hdu1042 N! (large number)
- Style Design Principles in Open Office XML Format
- WPF DataGrid 展示数据
- The history of cartoon rendering
- 几何g6将搭载harmonyos系统,产品竞争力全面升级
- 最长子串(长沙理工大学第十一届程序设计竞赛 离线 做了n天.....崩溃了)
- [BJDCTF2020]Easy MD5
- Securities account is better to choose which brokerage platform, which is more safe
- Implementing Forward+ in Unity URP
猜你喜欢
聚名十周年线上庆典正式开启,发送祝福即有好礼相赠~
Dandelion R300A 4G router, remote monitoring PLC tutorial
PG 之 huge page
The origin and creation of Smobiler's complex controls
Transsion Holdings: At present, there is no clear plan for the company's mobile phone products to enter the Chinese market
Build DG will increase the amount of lead to archive log problem
数字化工厂建设的内容主要有哪三个方面
大学生图书馆网页设计模板代码 DIV布局书店网页作业成品 学校书籍网页制作模板 学生简单书籍阅读网站设计成品
Research on ORACLE subqueries that lead to inability to push predicates
odoo 登录布局调整
随机推荐
JDBC最详讲解(快速入门)
FastDFS distributed file system
16. Learn Lua file I/O together
laravel 在工作日(节假日除外)运行调度程序命令
即将开幕!阿里云飞天技术峰会邀您一同探秘云原生最佳实践
疫情期间闲来无事,我自制了一个按钮展示框特效来展示我的博客
How to add F4 Value Help to the input parameters of the report in the ABAP report
Monaco-Editor Multiplayer Collaboration Editor
synApps -- Autosave
传统和加密域名概述
nyoj714 Card Trick (The 6th Henan Province Programming Contest)
PyTorch入门:(一)数据加载
hdu2647 N!Again
搭建DG导致归档日志量变多问题排查
The origin and creation of Smobiler's complex controls
阿里云数据库PolarDB开源人才培养计划发布!万元好礼等你来拿!
架构设计基本原则
PyTorch入门:(五)模型的搭建
C语言初阶-结构体
Azure Neural TTS continues to be updated to help enterprises develop small language markets