15 条题解

  • 2
    @ 2023-5-11 18:04:15

    #include<iostream>

    #include<cmath>

    using namespace std;

    int main()

    {

    int n,x,y,s;

    cin>>n>>x>>y;

    s=n-ceil(y*1.0/x);

    if(s<0)

    {

    s=0;

    }

    cout<<s;

    return 0;

    }

    • 1
      @ 2023-10-25 22:21:11
      #include <bits/stdc++.h>
      #include <iostream>
      #include <iomanip>
      #include <cmath>
      #include <math.h>
      #include <algorithm>
      #include <cstring>
      using namespace std;
      const int N = 1e5 + 10;
      const int INF = 0x3f3f3f3f;
      int main()
      {
      	int n , x , y , c;
      	cin >> n >> x >> y;
      	c = y / x;
      	if( y % x > 0 )
      	{
      		if( n - c < 0 )
      		{
      			cout << 0 << endl;
      		}
      		else
      		{
      			c = c + 1;
      			c = n - c;
      			cout << c << endl;
      		}
      	}
      	else
      	{
      		if( n - c < 0 )
      		{
      			cout << 0 << endl;
      		}
      		else
      		{
      			c = n - c;
      			cout << c << endl;
      		}
      	}
          return 0;
      }
      
      • 1
        @ 2023-3-18 21:37:24
        #include<iostream>
        
        using namespace std;
        
        int main()
        {
        
        int a,b,c,d;
        
        cin>>a>>b>>c;
        
        d=c/b;
        
        if(c%b!=0) ;
        {
        
        	d=d+1;
        
        }
        
        if(a-d<=0){
        
        	cout<<"0";
        
        }else{
        
        	cout<<a-d;
        
        }
            return 0;
        }
        
        • 0
          @ 2024-6-4 21:30:41
          #include<cmath>
          using namespace std;
          int main()
          {
          int n,x,y;
          cin>>n>>x>>y;
          
          int d=n-ceil(y*1.0/x);
          
          if(d<0){d=0;}
          	cout<<d;
          
              return 0;
          }
          
          • 0
            @ 2024-4-6 9:34:50
            #include<bits/stdc++.h>
            using namespace std;
            int const N=1e5+10;
            double n,x,y;
            int main(){
            	cin>>n>>x>>y;
            	int ans=n-y/x;
            	if(ans<=0){
            		cout<<"0";
            		return 0;
            	}
            	cout<<ans;
            	return 0;
            }
            
            
            • 0
              @ 2023-3-18 21:37:32
              #include<iostream>
              
              using namespace std;
              
              int main()
              {
              
              int a,b,c,d;
              
              cin>>a>>b>>c;
              
              d=c/b;
              
              if(c%b!=0) ;
              {
              
              	d=d+1;
              
              }
              
              if(a-d<=0){
              
              	cout<<"0";
              
              }else{
              
              	cout<<a-d;
              
              }
                  return 0;
              }
              
              • 0
                @ 2023-3-18 21:37:20
                #include<iostream>
                
                using namespace std;
                
                int main()
                {
                
                int a,b,c,d;
                
                cin>>a>>b>>c;
                
                d=c/b;
                
                if(c%b!=0) ;
                {
                
                	d=d+1;
                
                }
                
                if(a-d<=0){
                
                	cout<<"0";
                
                }else{
                
                	cout<<a-d;
                
                }
                    return 0;
                }
                
                • 0
                  @ 2023-3-18 21:37:12
                  #include<iostream>
                  
                  using namespace std;
                  
                  int main()
                  {
                  
                  int a,b,c,d;
                  
                  cin>>a>>b>>c;
                  
                  d=c/b;
                  
                  if(c%b!=0) ;
                  {
                  
                  	d=d+1;
                  
                  }
                  
                  if(a-d<=0){
                  
                  	cout<<"0";
                  
                  }else{
                  
                  	cout<<a-d;
                  
                  }
                      return 0;
                  }
                  
                  • 0
                    @ 2022-12-7 22:19:35
                    #include<iostream>
                    using namespace std;
                    int main(){
                    	int a,b,c,d;
                    	cin>>a>>b>>c;
                    	d=c/b;
                    	if(c%b!=0){
                    		d++;//注意题目要求求完整的苹果
                    	}
                    	if(a-d<=0){
                    		cout<<"0";//注意苹果不低于0
                    	}else{
                    		cout<<a-d;
                    	}
                    }
                    
                    • 0
                      @ 2022-3-30 21:16:11

                      #include<iostream>

                      using namespace std;

                      int main(){

                      int a,b,c,d;
                      
                      cin>>a>>b>>c;
                      
                      d=c/b;
                      
                      if(c%b!=0){
                      
                      	d++;//注意题目要求求完整的苹果
                      
                      }
                      
                      if(a-d<=0){
                      
                      	cout<<"0";//注意苹果不低于0
                      
                      }else{
                      
                      	cout<<a-d;
                      
                      }
                      

                      }

                      • 0
                        @ 2022-1-6 14:04:27
                        #include <queue>
                        #include <math.h>
                        #include <stack>
                        #include <stdio.h>
                        #include <iostream>
                        #include <vector>
                        #include <iomanip>
                        #include <string.h>
                        #include <algorithm>
                        using namespace std;
                        #define LL long long
                        const int N = 1e5 + 10;
                        const int INF = 0x3f3f3f3f;
                        int main()
                        {
                        	 int n ,x,y;
                        	 cin >> n >> x >> y;
                        	 n = n - y/x;
                        	 if(y%x != 0)
                        	 {
                        	 	n -= 1;
                        	 }
                        	 if(n < 0)
                        	 	n = 0;
                        	 cout << n;
                        	 
                        }
                        
                        • -1
                          @ 2022-1-3 12:03:02
                          #include <iostream>
                          #include <math.h>
                          #include <iomanip>
                          using namespace std;
                          int main()
                          {
                          	double n,x,y;
                          	cin>>n>>x>>y;
                          	int s=n-(y/x);
                          	if(s<0)
                          	s=0;
                          	cout<<s;
                          }
                          
                          • -3
                            @ 2023-3-4 9:23:21

                            • -3
                              @ 2022-7-2 20:00:05

                              #include<stdio.h> #include<iostream> using namespace std; int main() { int n,x,y; cin>>n>>x>>y; if(y%x==0) { int a=y/x; if(n-a<=0) { cout<<0<<endl; }else { cout<<n-a<<endl; } }else { int b=y/x+1; if(n-b<=0) { cout<<0<<endl; }else { cout<<n-b<<endl; } } }

                              • -3
                                @ 2022-1-24 13:18:40

                                #include<iostream> using namespace std; int main() { int n,x,y,cnt; cin>>n>>x>>y; if(y/x==0)cnt=1; //要完整的苹果,所以至少为一 else cnt =y/x+1; //理由同上 if(n-cnt<=0)cout<<0; //苹果不可能比零个少 else cout<<n-cnt; return 0; }

                                • 1

                                信息

                                ID
                                871
                                时间
                                1000ms
                                内存
                                128MiB
                                难度
                                7
                                标签
                                递交数
                                1313
                                已通过
                                284
                                上传者