您的位置:首页 > 其它

URAL 1644 A Whole Lot of Walnuts (水

2014-09-27 18:39 369 查看
题目链接:点击打开链接

题意略坑。。

#include <cstdio>
#include <algorithm>
using namespace std;
int main() {
	char s[15];
	int n, x;
	while(~scanf("%d", &n)) {
		int a = 2, b = 10;
		for(int i = 0; i < n; i ++) {
			scanf("%d %s", &x, s);
			if(s[0] == 'h') a = max(a, x);
			else b = min(b, x);
		}
		if(b <= a) puts("Inconsistent");
		else printf("%d\n", b);
	}
	return 0;
}
/*
4
4 hungry
7 satisfied
5 hungry
8 satisfied

2
6 hungry
5 satisfied

0

1
3 satisfied

*/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: