P10291 [CCC 2024 J2] Dusa And The Yobis tj
_colin1112_ · · 题解
思路
首先输入 Dusa 的身高,然后使用 while 循环输入 Yobi 的身高,如果 Dusa 身高
Code
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;
const int E=1e6+5;
ll d;
ll x;
int main(){
cin >>d;
while(cin >>x){
if(x>=d)break;
d+=x;
}
cout <<d;
return 0;
}