2 条题解

  • 1
    @ 2025-1-6 19:55:55
    #include<stdio.h>
    #include<iostream>
    using namespace std;
    int main()
    {
    	int n,t,s,count=0,q;
    	cin>>n>>t>>s;
    	for(int i=1;i<=1000;i++)
    	{
    		int x=i*t;
    		if(x<s)
    		{
    		count++;	
    		}
    		q=s-x;
    		if(q<=t)
    		{
    		count++;
    		break;	
    		}
    	}
    	if(n-count>0)
    	{
    		cout<<n-count;
    	}else{
    		cout<<0;
    	}
    	return 0;
    }
    认真细心
    
    • 0
      @ 2023-9-20 23:35:17
      #include<stdio.h>
      int main()
      {
          int n,t,s,k;
          scanf("%d %d %d",&n,&t,&s);
      	    if(s%t==0){
      	    	if(n>=s/t){
                      k=n-s/t;
                  }else k=0;
      		} else if(s%t!=0){
      			if(n>=s/t+1){
                      k=n-s/t-1;
                  }else k=0;
      		}
          printf("%d",k);
          return 0;
      }
      
      • 1

      信息

      ID
      107
      时间
      1000ms
      内存
      256MiB
      难度
      8
      标签
      (无)
      递交数
      1879
      已通过
      360
      上传者