题解:P10291 [CCC 2024 J2] Dusa And The Yobis
我们已知
- 当
x < d ,则让d = d + t ; - 当
x \ge d ,直接输出d 即可。
#include <iostream>
#define int long long
using namespace std;
signed main() {
int d;
cin >> d;
while (1) {
int t;
cin >> t;
if (d > t) d += t;
else {
cout << d;
return 0;
}
}
}