本地没报错,落谷报了?
查看原帖
本地没报错,落谷报了?
332399
TeaWine楼主2020/10/29 19:04
#include <iostream>

using namespace std;

int jie [10000], teng[10000], time, ren, tou, OK = 0;

int n = 0;

int main () {
	
	cin>>ren>>tou;
	
	for(int i = 0; i<ren; i++) cin>>jie [i];
	
	while(1) {
		
		for(int i = 0; i<=tou; i++)
		{
			
			while(teng [i]==jie [i]) i++;
			
			time++;
			
			teng [i]++;
			
		}
		
		n = 0;
		
		for(int i = 0; i<=ren; i++) if(teng [i]==jie [i]) n++;
		
		if(n==ren) break;
		
	}
	
	cout<<time;
	
	return 0;
}

???

2020/10/29 19:04
加载中...