10 条题解

  • 0
    @ 2024-2-23 10:43:56
    #include<bits/stdc++.h>
    using namespace std;
    
    int main()
    {
    	int s,v;
    	cin>>s>>v;
    	double x=s*1.0/v*1.0;
    	int t=10+s/v;
    	if(x>s/v||s/v<0)
    	{
    		t=t+1;	
    	}
    	int h,y;
    	if(t<=480)
    	{
    		h=(480-t)/60;
    		y=(480-t)%60;
    		if(h<10&&y>=10)
    		{
    			cout<<"0"<<h<<":"<<y<<endl;
    		}
    		else if(h<10&&y<10)
    		{
    			cout<<"0"<<h<<":"<<"0"<<y<<endl;
    		}
    		else if(h>=10&&y>=10)
    		{
    			cout<<h<<":"<<y<<endl;
    		}	
    	}
    	else if(t>480)
    	{
    		int u=t-480;
    		h=u/60;
    		if(h==0)
    		{
    			h=23;
    		}
    		else
    		{
    			h=23-h;
    		}
    		y=60-u%60;
    		if(h<10&&y>=10)
    		{
    			cout<<"0"<<h<<":"<<y<<endl;
    		}
    		else if(h<10&&y<10)
    		{
    			cout<<"0"<<h<<":"<<"0"<<y<<endl;
    		}
    		else if(h>=10&&y>=10)
    		{
    			cout<<h<<":"<<y<<endl;
    		}
    	}
    	return 0;
    }
    

    信息

    ID
    609
    时间
    1000ms
    内存
    125MiB
    难度
    5
    标签
    (无)
    递交数
    261
    已通过
    95
    上传者