社区讨论
80分最后一个测试点
B3729[信息与未来 2017] 龟兔赛跑参与者 3已保存回复 11
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 11 条
- 当前快照
- 1 份
- 快照标识符
- @lo1lww16
- 此快照首次捕获于
- 2023/10/22 23:11 2 年前
- 此快照最后确认于
- 2023/11/02 23:55 2 年前
CPP
#include <bits/stdc++.h>
using namespace std;
int main(){
int x,y,t;
cin>>x>>y>>t;
long long s,tim,f=1;
s=t*x;
if(s+x<f*y){
cout<<s<<endl;
return 0;
}
for(int i=1;;i++){
if(s+f*x==f*y){
cout<<f*y<<endl;
return 0;
}else if(s+f*x>f*y){
f++;
}else{
cout<<s+(f-1)*x<<endl;
return 0;
}
}
return 0;
}
回复
共 11 条回复,欢迎继续交流。
正在加载回复...