当前位置:网站首页>HJ22 汽水瓶
HJ22 汽水瓶
2022-06-09 08:25:00 【源氏不可挡】
import java.util.*;
import java.io.*;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str="";
while(!(str=br.readLine()).equals("0")){
Box box=new Box(0,Integer.parseInt(str));
System.out.println(checkBox(box).drinkBox);
}
}
public static Box checkBox(Box box){
if (box.emptyBox<2){
return box;
}else if (box.emptyBox==2){
box.drinkBox++;
box.emptyBox=0;
return box;
}else{
box.drinkBox=box.drinkBox+box.emptyBox/3;
box.emptyBox=box.emptyBox%3+box.emptyBox/3;
Box box1 = checkBox(box);
return box1;
}
}
static class Box{
private Integer drinkBox;
private Integer emptyBox;
public Box(int drinkBox,int emptyBox){
this.drinkBox=drinkBox;
this.emptyBox=emptyBox;
}
}
}
边栏推荐
- Dell iDRAC Express版本的共享网口设置
- 系统运维系列 之greenplum vacuum清理删除数据命令
- 【读点论文】Benchmark Analysis of Representative Deep Neural Network Architectures当准确率不再是唯一衡量标准,给多目标优化一个导向
- Market Research - current market situation and future development trend of cosmetic grade ethylhexyl glycerol in the world and China
- ELK+Filebeat 部署安装
- RMAN备份概念_关于RMAN控制文件和服务器参数文件的自动备份
- 系统运维系列 之Clickhouse数据类型整理
- Puzzle (105) plane inversion
- xml-json-yaml 互转
- belongsTo和hasOne的区别
猜你喜欢

阿裏雲ack免密拉取企業版acr鏡像

Clickhouse distributed table & local table & Clickhouse realize time series data management and mining

Question about Oracle: why can't the DBMS be linked according to the evening tutorial and output results

【天线】【1】一些名词和简单概念的解释

RMAN备份概念_关于备份保留策略(RETENTION POLICY)

Understand the difference between left join, right join and join

EDA开源仿真工具verilator入门1:安装和测试

自制编译器学习4:使用Flex

Openinfra summit 2022 𞓜 Android cloud users stand out and are shortlisted for the super user Award

办公软件系列 之excel应用4
随机推荐
Could not find artifact com.retail.stock:retail-stock-center:pom:1.0-SNAPSHOT in snapshots
【TeXstudio】【2】一般的图片和表格的表现形式
xml-json-yaml 互轉
Yyds dry goods sharing # master this Q version of figure painting method, and you can finish the avatar for one month at a time!
English语法_副词
Huayun data was selected as the representative manufacturer of cloud infrastructure in IDC development trends of industrial software and industrial Internet
CV learning notes cnn-vgg
NetCore框架WTM的分表分库实现
【读点论文】GhostNet: More Features from Cheap Operations 卷积操作还是比较昂贵,特征图冗余可以线性变换获得
Quarkus实战学习一
First knowledge of nodejs crawler framework puppeter
[reading some papers] benchmark analysis of representative deep neural network architectures when accuracy is no longer the only measure, it provides a guidance for multi-objective optimization
Market Research - current situation and future development trend of Brazil berry oil market in the world and China
2022-2028 global Supplementary Cementitious Materials (SCM) industry research and trend analysis report
RMAN备份概念_关于映像拷贝(Image Copy)
mysql中if和ifnull
Implementation of WTM based on NETCORE framework
通过低代码和无代码实现保险行业客户体验突破
GC study notes
puzzle(105)平面逆推