A. Jzzhu and Children【1000 / 模拟】
作者:互联网
https://codeforces.com/problemset/problem/450/A
#include<bits/stdc++.h>
using namespace std;
int s[105];
queue<int>q;
int main(void)
{
int n,m,x; cin>>n>>m;
for(int i=1;i<=n;i++) cin>>s[i],q.push(i);
while(q.size()>1)
{
int temp=q.front(); q.pop();
if(s[temp]<=m) continue;
else q.push(temp),s[temp]-=m;
}
cout<<q.front();
return 0;
}
标签:temp,int,namespace,Jzzhu,450,size,Children,1000 来源: https://blog.csdn.net/bettle_king/article/details/120504269