poj3250

//(栈)poj3250将第i头牛能看到多少牛传化为第i头牛能被多少牛看见

/*

#include <stdio.h>
#include <stack>
using namespace std;
int main(){
	unsigned long N,ans=0;
	stack<unsigned long>s;
	scanf("%ld",&N);
	while(N--){
		unsigned long cowHigh;
		scanf("%ld",&cowHigh);
		while(!s.empty()&&s.top()<=cowHigh) s.pop();
		ans+=s.size();
		s.push(cowHigh);
	}
	printf("%ld",ans);
	return 0;
}

//*/

  

posted @ 2015-04-19 23:53  PaigeWw  阅读(129)  评论(0编辑  收藏  举报