国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

ZOJ 3603 Draw Something Cheat

2019-11-08 02:21:27
字體:
來源:轉載
供稿:網友

Have you played Draw Something? It's currently one of the hottest social drawing games on Apple iOS and Android Devices! In this game, you and your friend play in turn. You need to pick a Word and draw a picture for this word. Then your friend will be asked what the word is, given the picture you have drawn. The following figure illustrates a typical scenario in guessing the word.

word guessing in draw something

As you see, when guessing a word you will be given the picture and 12 letters. You must pick some of these letters to form a word that matches the picture. Each letter can only be used once. It is a lot of fun if your friend is a talented painter, but unfortunately some drawings from your friend are totally incomPRehensible. After several times of becoming mad by the drawings, you find a way to cheat in the game.

In this game, letters not included in the correct answer are randomly generated. If you cannot find the correct answer when guessing, you can write down all the letters and restart the game. Then you would find some of these letters are changed. Of course these changed letters will never appear in the answer. By eliminating these letters you are a step closer to the answer.

So In this problem, you need to write a program to automate the cheating process. Given N strings of letters to the same picture, you need to eliminate as many letters as possible, and output the remaining letters.

Input

There are multiple test cases. The first line of the input is an integer T ≈ 1000 indicating the number of test cases.

Each test case begins with a positive integer N ≤ 20 indicating the number of times you have entered the game. Then N lines follow. Each line is a string of exactly 12 uppercase letters, indicating the candidate letters in one guess. It is guaranteed that the answer has at least 1 letter and has no more than 12 letters.

Output

For each test case, output the remaining letters in alphabet order after the process described above. One line for each test case.

Sample Input
22ABCDEFGHIJKLABCDEFGHIJKL2SAWBCVUXDTPNZQTLFJYRCGAKSample Output
ABCDEFGHIJKL

ACT

簡單題

#include<map>#include<cmath>    #include<queue>    #include<vector>#include<cstdio>    #include<cstring>    #include<algorithm>    using namespace std;#define ms(x,y) memset(x,y,sizeof(x))    #define rep(i,j,k) for(int i=j;i<=k;i++)    #define per(i,j,k) for(int i=j;i>=k;i--)    #define loop(i,j,k) for (int i=j;i!=-1;i=k[i])    #define inone(x) scanf("%d",&x)    #define intwo(x,y) scanf("%d%d",&x,&y)    #define inthr(x,y,z) scanf("%d%d%d",&x,&y,&z)    typedef long long LL;const int low(int x) { return x&-x; }const int INF = 0x7FFFFFFF;const int mod = 1e9 + 7;const int N = 1e3 + 10;int T, n, f[N], g[N];char s[N];int main(){	for (inone(T); T--;)	{		inone(n); 		rep(i, 0, 26) f[i] = INF;		rep(i, 1, n)		{			scanf("%s", s);			rep(j, 0, 26) g[j] = 0;			for (int j = 0; s[j]; j++) g[s[j] - 'A']++;			rep(j, 0, 26) f[j] = min(f[j], g[j]);		}		rep(i, 0, 26) rep(j, 1, f[i]) putchar('A' + i);		putchar(10);	}	return 0;}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 凌海市| 大田县| 汉川市| 新邵县| 青铜峡市| 绥德县| 克拉玛依市| 洪湖市| 和顺县| 定西市| 乡宁县| 宝山区| 鹤壁市| 汉中市| 平南县| 梁平县| 临湘市| 东宁县| 禄劝| 双牌县| 芦溪县| 长沙县| 肃北| 友谊县| 江达县| 宜兰县| 兰考县| 稻城县| 阿克苏市| 隆尧县| 福海县| 木兰县| 桦甸市| 阿合奇县| 哈巴河县| 平果县| 汝城县| 若羌县| 若羌县| 开原市| 芜湖市|