30 条题解

  • 66
    @ 2022-8-11 22:40:58

    这道题 MOD 看来是被坑惨了,-5个赞…… 好了,话不多说,看看思路吧~

    1. 输入的长度 n 是米!要乘 100 转换成厘米
    2. 可以先减去一朵花的长度 n - x 就可以判断剩下可以放下几个 x + y了
    3. 最后别忘记前面减去的 x 所以要再加上1
    4. floor函数是向下取整,可以舍弃所有小数点~也就不会有多余的一朵花啦!

    上代码吧!(全世界最短的代码)

    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        double n, x, y;
        cin >> n >> x >> y;
        cout << floor((n * 100 - x) / (x + y) + 1);
        return 0;
    }
    
    • @ 2022-11-20 16:51:10

      MOD现在变-9了

    • @ 2023-7-8 14:34:02

      MOB谁啊

    • @ 2023-7-8 14:38:15

      找到了,都-17了,哎

    • @ 2023-7-9 16:25:03

      @[](/user/10204管理员

    • @ 2023-8-14 22:11:20

      -19了

    • @ 2023-8-18 11:53:23

      现在都-19了 @

    • @ 2023-8-23 11:34:25

      -20了

    • @ 2023-11-8 20:41:06

      Mod现在变-25了(hh-hg) 感谢思路

    • @ 2023-11-12 15:53:09

      变**-26**了

    • @ 2024-1-30 10:04:46

      可以把

      return 0;
      去掉
      
    • @ 2024-1-30 10:05:44
      #include <bits/stdc++.h>
      using namespace std;int main(){double n, x, y;cin >> n >> x >> y;cout << floor((n * 100 - x) / (x + y) + 1);return 0;}
      
    • @ 2024-2-2 15:58:15

      我的才是全世界最短代码

      #include<iostream>
      using namespace std;
      int main()
      {
          cout<<27;
      }
      
  • 13
    @ 2023-11-12 16:02:58

    (纯AC代码,请放心食用( •̀ ω •́ )✧) 如果不AC,你晚上来我家偷我家马桶盖**(没事我家厕所有防盗门)**

    
    
    #include <iostream>
    using namespace std;
    int main()
    {
        double n, x, y;
        cin >> n >> x >> y;
        double o = n * 100;
        int ans = o / (x + y);
        if (o - (ans * (x + y)) >= x)
        {
            ans += 1;
        }
        cout << ans << endl;
        return 0;
    }
    

    天灵灵,地灵灵,给个赞,行不行🙇‍ 球球了😕

    • 3
      @ 2023-11-20 20:35:39
      #include <bits/stdc++.h> 
      using namespace std;
      int main()
      {
      	double n,x,y;
      	cin>>n>>x>>y;
      	n*=100;
      	int p=n/(x+y);
      	if(n-p*(x+y)>=x){
      		p++;
      	}
      	cout<<p;
          return 0;
      }
      
      • 2
        @ 2023-11-4 17:13:32

        不多说,上代码

        #include <bits/stdc++.h>
        using namespace std;
        int main()
        {
            double n, x, y;
            cin >> n >> x >> y;
            cout << floor((n * 100 - x) / (x + y) + 1);
            return 0;
        }
        
        
        • 2
          @ 2023-10-4 12:19:29
          #include<bits/stdtr1c++.h>
            	using namespace std;
          int main()	
          {
              double n,x,y;
              int a;
              cin>>n>>x>>y;
              n*=100;
              a=n/(x+y);
              cout<<a; 
          	return 0;		
          }
          这才对了
          
          
          • 1
            @ 2023-10-4 12:18:26
            #include <iostream>
            using namespace std;
            int main()
            {
                double n,x,y;
                int c;
                cin >> n >> x >> y;
                c+=n/(x+y);
                if (n%(x+y)>=x)
                {
                    c++;
                }
                cout << c;
                return 0;
            }
            还有谁
            
            
            • 1
              @ 2023-8-15 12:17:50
              #include <bits/stdc++.h>
              using namespace std;
              int main()
              {
                  double n, x, y;
                  cin >> n >> x >> y;
                  cout << floor((n * 100 - x) / (x + y) + 1);
                  return 0;
              }
              两种写法
              

              #include <bits/stdc++.h> using namespace std; int main() { cout<<"27"; return 0; } //本人不赞成这种写法,只是数据太水,还是自己编好,两种方法均以AC,0.0s过,不用❤️ 😄

              
              
              • 0
                @ 2023-10-3 13:11:20

                上代码!!!0.0秒过,记得点赞哦。

                #include<bits/stdtr1c++.h> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; cout<<(bc)+(ab2)+(ac*2); return 0; }

                
                
                • 0
                  @ 2023-10-2 21:39:55
                  #include<bits/stdtr1c++.h>
                    	using namespace std;
                  int main()	
                  {
                      double n,x,y;
                      int a;
                      cin>>n>>x>>y;
                      n*=100;
                      a=n/(x+y);
                      cout<<a; 
                  	return 0;		
                  }
                  
                  • 0
                    @ 2023-9-23 17:49:48
                    #include <iostream>
                    using namespace std;
                    int main(){
                        double a,b,c;//定义间隔,宽度,总长
                        cin>>a>>b>>c;
                        a=a*100;//换单位
                        a=a-b;
                        int d;
                        d=a/(b+c);//顺序
                        cout<<d+1;//前面减去了布首的长度,要加回来
                    }
                    
                    • 0
                      @ 2023-8-23 12:07:57
                      #include <iostream>
                      using namespace std;
                      int main()
                      {
                          double n,x,y;
                          int c;
                          cin >> n >> x >> y;
                          c+=n/(x+y);
                          if (n%(x+y)>=x)
                          {
                              c++;
                          }
                          cout << c;
                          return 0;
                      }
                      有错吗?
                      
                      • 0
                        @ 2023-8-16 17:00:42
                        #include <iostream>
                        using namespace std;
                        int main()
                        {
                            double n, x, y, m = 0, j = 0, g = 0;
                            cin >> n >> x >> y;
                            m = n * 100;
                            j = x + y;
                            g = m / j;
                            if (m - g * j >= x)
                            {
                                cout << int(g) + 1;
                            }
                            else
                            {
                                cout << int(g);
                            }
                            return 0;
                        }
                        
                        • 0
                          @ 2023-8-10 13:15:43
                          #include <bits/stdc++.h>
                          using namespace std;
                          int main()
                          {
                              cout<<"27";
                              return 0;
                          }
                          

                          0.0秒过!!!!!!!!!!!!!

                          Copy

                        • 0
                          @ 2023-8-3 20:02:39
                          #include <bits/stdc++.h>
                          using namespace std;
                          int main()
                          {
                              double n, x, y;
                              cin >> n >> x >> y;
                              cout << floor((n * 100 - x) / (x + y) + 1);
                              return 0;
                          }
                          
                          • 0
                            @ 2023-7-20 21:33:57
                            #include <bits/stdc++.h> 
                            using namespace std;
                            int main()
                            {
                                int a,b,c,sum=0,d=0,s=0,n=0;
                                cin>>a>>b>>c;
                                d=a*100;
                                s=b+c;
                                sum=d/s;
                                n=sum+1;
                                cout<<sum;
                                return 0;
                            }
                            
                            • 0
                              @ 2023-7-4 12:33:45

                              这一题很简单,上代码! #include <bits/stdc++.h> using namespace std; double n, x, y, sum; int main() { cin >> n >> x >> y; n *= 100;//输入的是米,而花边是厘米,所以要×100; while((x + y) * sum <= n) { sum++; } sum--; cout<<sum; return 0; }

                              • 0
                                @ 2023-1-7 20:38:42

                                最简单的代码

                                #include <bits/stdc++.h>
                                using namespace std;
                                int main()
                                {
                                    cout<<"27";
                                    return 0;
                                }
                                
                              • 0
                                @ 2023-1-7 17:17:02

                                兄弟们,友友们,来上代码了啊

                                #include<iostream>
                                #include<cstdio>
                                using namespace std;
                                int main()
                                {
                                	double n,x,y,c;
                                	int g;
                                	cin >> n >> x >> y;
                                	n*=100;      //单位换算(一定要换算单位)
                                	g=n/(x+y);      //花+间隔的个数 
                                	c=n-g*(x+y);      //剩下的长度 
                                	if(c>x)      //可以省略大括号,但是还是要养成好习惯
                                	{
                                		cout<< g+1 << endl;
                                	}
                                	else 
                                	{
                                		cout<< g << endl;
                                	} 
                                	return 0;
                                }
                                

                                注意:代码的头文件(也就是#include后面的‘’<>‘’这个符号里的东西)不要写错了。

                                附:如果有错欢迎指出! 思路不懂可以看其他题解。

                                • 0
                                  @ 2022-8-19 11:36:55

                                  这道题比较简单,但是AC的人不是很多

                                  先把能做出来的花+间隔个数求出来,剩下的长度也就好办了

                                  最后再判断剩下的够不够一朵花

                                  不多说了,思路还是很容易就能出来,上代码

                                  #include<iostream>
                                  #include<cstdio>
                                  using namespace std;
                                  int main(){
                                  	double n,x,y,c;
                                  	int g;
                                  	cin>>n>>x>>y;
                                  	n*=100;//单位换算 
                                  	g=n/(x+y);//花+间隔的个数 
                                  	c=n-g*(x+y);//剩下的长度 
                                  	if(c>x) cout<<g+1<<endl;
                                  	else cout<<g<<endl;//if和else的下级代码如果只有一句,可以不用大括号 
                                  	return 0;
                                  }
                                  
                                  </span>
                                  • -1
                                    @ 2024-2-23 10:37:55

                                    `

                                    #include <bits/stdc++.h>
                                    using namespace std;
                                    int main()
                                    {
                                        double n,x,y,c;
                                        int g=0;
                                        cin>>n>>x>>y;
                                        c=n*100;
                                        g+=c/(x+y);
                                        cout<<g;
                                        return 0;
                                    }
                                    

                                    信息

                                    ID
                                    328
                                    时间
                                    1000ms
                                    内存
                                    16MiB
                                    难度
                                    4
                                    标签
                                    递交数
                                    3197
                                    已通过
                                    1384
                                    上传者