freeshare @ 2024-05-03 19:02:26
请看代码
//#include<iostream>
//#define ll long long
#include <bits/stdc++.h>
using namespace std;
int main(){
int s,v;
int fen=1430,hh=0,mm=0;
cin>>s>>v;
//v*t=s; t=s/v;
if(s%v==0){
fen-=s/v;
}else{
fen-=s/v+1;
}
//cout<<fen<<endl;
while(fen>=60){
hh++;
fen-=60;
}
while(fen>=1){
mm++;
fen-=1;
}
if(hh-16>0){
cout<<"0"<<hh-16<<":"<<mm;
}else{
cout<<hh<<":"<<mm;
}
return 0;
}
题目中提前一天那里我认为是只能在24小时之内出发,但看了题解之后似乎是我理解错了orz