// Online C++ compiler to run C++ program online
#include<iostream>
#include<vector>
#include<stdlib.h>
#include<algorithm>
#include<string.h>
#include<exception>
#include<map>
#include<cmath>
#include<unordered_map>
#include<set>
#include<climits>
#include<ctype.h>
#include<queue>
#include<stack>
#include<list>
using namespace std;
int main() {
//输入初始化
int procNum;
int taskNum;
cin >> procNum;
cin >> taskNum;
vector<int> times;
for (int i = 0; i < taskNum; ++i)
{
int val;
cin >> val;
times.push_back(val);
}
int left = 0;
for (int i = 0; i < taskNum; ++i)
{
left = max(times[i]+left- procNum, 0);
}
while (left > 0)
{
left = max(left - procNum, 0);
++taskNum;
}
cout << taskNum << endl;
}
华为OD机试 - GPU算力
最新推荐文章于 2024-10-19 22:38:42 发布