蒟蒻的70分求助

P5707 【深基2.例12】上学迟到

鱼鱼鱼刚改了一下变90分了 ``` #include<bits/stdc++.h> using namespace std; int a,s,t,shi,f; int main(){ cin>>a>>s; t=a/s+10; if(a%s) t++; shi=t/60; f=t%60; if(shi>8||(shi==8&&f>0)){ shi=24-shi+8-1; if((shi<10)||(shi==10&&f)) cout<<0; cout<<shi; } else { cout<<0; cout<<8-shi-1; } cout<<":"; if(f>=50||f==0){ cout<<0; } cout<<60-f; return 0; } ```
by 514czh @ 2023-11-30 21:49:18


@[ywz121014](/user/1032282) 应该能AC
by Dark_Monarch @ 2023-12-03 15:08:25


@[wschxz](/user/1179543) ``` #include<bits/stdc++.h> #include<cstdio> #include<cmath> using namespace std; int main() { int s,v; scanf("%d%d",&s,&v); int t_min = ceil(1.0 * s / v) + 10; //向上取整, 分钟为单位 int time_sum = 60 * (24 + 8); //时间限制 int ans = time_sum - t_min;//从0点算,何时出发 int h = (ans / 60) % 24; int min = ans % 60; printf("%02d:%02d",h,min); return 0; } ```
by Dark_Monarch @ 2023-12-03 15:21:45


@[ywz121014](/user/1032282) 蟹蟹awa
by 514czh @ 2023-12-04 09:43:32


|