【水题】Codeforces Round #485 (Div. 2) A. Infinity Gauntlet

题目链接:http://codeforces.com/contest/987/problem/A

  

 题目大意:

  输入正整数n与n种看到的颜色,根据颜色来判断宝石,输出未看到的宝石的数量与名称

 1 #include <bits/stdc++.h>
 2 
 3 using namespace std;
 4 
 5 #define ll long long
 6 
 7 
 8 map<string,int> m;
 9 string ss[] = {"purple","green","blue","orange","red","yellow"};
10 int book[] = {0,0,0,0,0,0,0};
11 string sss[] = {"Power","Time","Space","Soul","Reality","Mind"};
12 int main()
13 {
14     int n;
15     scanf("%d",&n);
16     int p = 6-n;
17     string s;
18     for(int i = 1;i <= n;++i)
19     {
20         cin >> s;
21         m[s] = 1;
22     }
23     cout << p << endl;
24     for(int i = 0;i < 6;++i)
25     {
26         if(m[ss[i]] == 0)
27         {
28             book[i] = 1;
29         }
30     }
31     for(int i = 0;i < 6;++i)
32     {
33         if(book[i])
34             cout << sss[i] << endl;
35     }
36     return 0;
37 }
原文地址:https://www.cnblogs.com/duny31030/p/9109059.html