`
txf2004
  • 浏览: 6855255 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

【ZOJ坑爹的题意和数据】浙大 zoj 4706 Draw Something Cheat

 
阅读更多


/* THE PROGRAM IS MADE BY PYY */
/*----------------------------------------------------------------------------//
    Copyright (c) 2012 panyanyany All rights reserved.

    URL   : http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4706
    Name  : 4706 Draw Something Cheat

    Date  : Friday, April 20, 2012
    Time Stage : one hour more ?

    Result:
2869961	2012-04-20 23:06:29	Accepted	3603
C++
10	188	pyy


Test Data :

Review :
注意这种情况:
2
2
AAAAAABBBBBB
BBBBBBBBBBBB
BBBBBB 				/* 此为答案 */
2
AAAAAABBBBCC
BBBBBBBBBBBB
BBBB 					/* 此为答案 */

它的题目描述其实就是“逗你玩儿”的~上面的数据都是我一步一步试出来的,跟题目描述的
真是完全不一样……
//----------------------------------------------------------------------------*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>

#include <algorithm>
#include <iostream>
#include <queue>
#include <set>
#include <string>

using namespace std ;

#define MEM(a, v)        memset (a, v, sizeof (a))    // a for address, v for value

#define INF     (0x3f3f3f3f)

#define DB    /##/

int		tcase, n;

int main()
{
	char a[255], b[255], c;
	int i;

	while (scanf("%d", &tcase) != EOF)
	{
		while (tcase--)
		{
			MEM(b, INF);
			scanf("%d", &n);
//			getchar();
			while (n--)
			{
				MEM(a, 0);

				getchar();
				for (i = 0; i < 12; ++i)
				{
					c = getchar();
					a[c] += 1;
				}

				for (i = 0; i < 255; ++i)
					if (b[i] && !a[i])
						b[i] = 0;
					else if (b[i] && a[i])
						b[i] = b[i] < a[i] ? b[i] : a[i];
			}

			for (i = 0; i < 255; ++i)
				if (b[i])
				{
					while (b[i]--)
						printf("%c", i);
				}
			putchar('\n');
		}
	}
	return 0;
}


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics