题目地址:点击打开链接AC代码:#includeint main(){	double h,u,d,f,sum,down;	int day,flag;	while(scanf("%lf%lf%lf%lf",&h,&u,&d,&f) && h)	{		flag = 1;		day = 0;		sum = 0;		f = f / 100;		down = f * u;		            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-08-04 09:05:14
                            
                                35阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            题意:
一直蜗牛想爬出深度度为h的井,白天向上爬u米,晚上下降d米,还有一个就是第二天向上爬的距离为减少F%,第三天又减少F%,u至少为零,不会变成负数。当蜗牛爬出井口或者滑到井底就输出当时的天数。
注意:刚好到井口或者刚好到井底是不算的。
思路:
模拟蜗牛的爬行。
#include
#include
using namespace std;
int main()
{
	double h            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-10-19 16:14:03
                            
                                32阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            
 1 class Solution:
 2     def levelOrder(self,root,l,res):
 3         while len(l) > 0:
 4             temp = []
 5             while len(l) > 0:
 6                 cur = l.pop()
 7                        
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2019-12-29 14:09:00
                            
                                21阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            2011-12-26 09:07:10地址:http://acm.hdu.edu.cn/showproblem.php?pid=1302题意:有个蜗牛爬墙。墙高H。一开始每天白天能爬U,晚上滑下来D。之后因为疲劳,每天能爬的高度都比前一天减少U*F%。问何时能离开墙(爬过或跌下来)。mark:直接模拟。代码:# include <stdio.h>int h, u, d, f ;int gao(){ double a = 0, b = u, c = 1.0*f/100.0 * u ; int days = 1 ; while (1) { // printf (...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2012-01-06 23:45:00
                            
                                34阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            蜗牛爬井问题 不同的这次加入了疲劳度 每一天...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2016-06-05 02:53:00
                            
                                72阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            The SnailTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/3            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-08-30 15:15:55
                            
                                68阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            、DS3231甚至其他的时钟模块的第三方库。终于,还是被我找到了 —— Rtc 时钟库。2.RTC2.1 简介Arduino Real Time Clock library(Ard...            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2021-07-05 11:41:59
                            
                                3654阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            The SnailTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3126    Accepted Submission(s): 2249Problem DescriptionA snail is at the bo            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2023-02-20 10:23:33
                            
                                25阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            股票买卖 和 合唱队形 有异曲同工之妙! 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<algorithm> 5 using namespace std; 6 const int N=1e5+5; 7 i ...            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2021-08-23 10:21:00
                            
                                154阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            1302. Deepest Leaves Sum**
https://leetcode.com/problems/deepest-leaves-sum/            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-05-30 10:31:18
                            
                                62阅读
                            
                                                                             
                 
                
                                
                     
                                    
                             
         
            
            
            
            1302. Deepest Leaves Sum Given a binary tree, return the sum of values of its deepest leaves. Example 1: Input: root = [1,2,3,4,5,null,6,7,null,null,n            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2020-01-30 12:20:00
                            
                                29阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            题干:
            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-06-15 10:47:02
                            
                                54阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            Given the root of a binary tree, return the sum of values of its deepest leaves. Example 1: Input: root = [1,2,3,4,5,null,6,7,null,null,null,null,8] O            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2021-04-13 12:30:00
                            
                                132阅读
                            
                                                                                    
                                2评论
                            
                                                 
                 
                
                             
         
            
            
            
            本文为《汇编语言程序设计》1302小节例程。            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-02-22 18:00:23
                            
                                123阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            
Problem Description
A snail is at the             
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-08-11 16:48:54
                            
                                51阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            2#include#include#include#i            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-08-12 13:21:27
                            
                                28阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            本文为《汇编语言程序设计》1302小节例程。点击链接…进课程主页。任务:在屏幕的5行12列显示3个红底高亮闪烁绿色的’a’ 程序:assume cs:codecode segment        mov ah,2        ;置光标功能        mov bh,0        ;第0页        mov dh,5        ;dh中放行号        mov dl,            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2021-05-26 13:01:40
                            
                                198阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            DescriptionGiven a binary tree, return the sum of values of its deepest leaves.Example 1:Input: root = [1,2,3,4,5,null,6,7,            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2022-08-11 17:38:57
                            
                                36阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            【代码】LQB新2024:DS1302。            
                
                    
                        
                                                            
                                                                        
                                                                                        原创
                                                                                    
                            2024-03-17 14:14:05
                            
                                36阅读
                            
                                                                             
                 
                
                             
         
            
            
            
            题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1302思路:直接按着题目意思模拟就行了。。。View Code 1 #define _CRT_SECURE_NO_WARNINGS 2 #include<iostream> 3 #include<cstdio> 4 #include<cmath> 5 using namespace std; 6 7 int main(){ 8 double h,u,d,f; 9 while(~scanf("%lf",&h)&&h){10            
                
                    
                        
                                                            
                                                                        
                                                                                        转载
                                                                                    
                            2013-04-26 12:28:00
                            
                                72阅读
                            
                                                                                    
                                2评论