首页 > 其他分享 >吃桃子(桃子随时间变化在变化)

吃桃子(桃子随时间变化在变化)

时间:2022-10-16 13:56:16浏览次数:40  
标签:include ++ cin long 时间 taozi 桃子 变化

 

 

#include<iostream>
#include <climits>
#include <cstring>
using namespace std;
int main ( )
{
    long long n,k,x,yuzhi=LLONG_MIN, tiji = 0;
    cin >> n >> k >> x;
    vector<long long> taozi(n, 0);
    for(long long i = 0;i < n;++i)
    {
        cin >> taozi[i];
    }

    for(long long i = 0;i < k;++i)
    {
        for(long long j = 0;j < n;++j)
        {
            if(taozi[j] >= x)
            {
                tiji += taozi[j];
                taozi[j] = yuzhi;
            }
            taozi[j] = taozi[j] + 1;
        }
    }
    cout << tiji;

    return 0;
}
/*
3 2 5
3 4 6
*/

 

标签:include,++,cin,long,时间,taozi,桃子,变化
From: https://www.cnblogs.com/boost/p/16796096.html

相关文章