60分求助m-(t+s-1)/t

P5709 【深基2.习6】Apples Prologue / 苹果和虫子

(t + s - 1) / t有可能会比m大,出现负数苹果
by xuyao35 @ 2024-01-03 21:57:24


@[Dailyk](/user/1168912) ```c #include<iostream> #include<cmath> using namespace std; int main(){ int m,t,s; cin>>m>>t>>s; if(t==0){ cout<<"0"; }else{ int sh=max(0,m-(t+s-1)/t); cout<<sh; } return 0; } ``` 改了一下
by 20110915_260 @ 2024-01-29 09:43:17


|