Codeforces Round #485 (Div. 2) A. Infinity Gauntlet

题目连接:

http://codeforces.com/contest/987/problem/A

Description

You took a peek on Thanos wearing Infinity Gauntlet. In the Gauntlet there is a place for six Infinity Gems:

  • the Power Gem of purple color,
  • the Time Gem of green color,
  • the Space Gem of blue color,
  • the Soul Gem of orange color,
  • the Reality Gem of red color,
  • the Mind Gem of yellow color.

Using colors of Gems you saw in the Gauntlet determine the names of absent Gems.

Sample Input

4
red
purple
yellow
orange

Sample Output

2
Space
Time

题意

无限手套有六颗宝石,现在已经有了几种颜色的,问现在缺少哪些能力

题解:

用map暴力处理

代码

#include <bits/stdc++.h>

using namespace std;

map<string, string> m;
int n;
string d; int main() {
m.insert(make_pair("red", "Reality"));
m.insert(make_pair("purple", "Power"));
m.insert(make_pair("green", "Time"));
m.insert(make_pair("blue", "Space"));
m.insert(make_pair("orange", "Soul"));
m.insert(make_pair("yellow", "Mind"));
cin >> n;
for (int i = 0; i < n; i++) {
cin >> d;
m.erase(d);
}
cout << m.size() << endl;
for (auto i:m)
cout << i.second << endl; }

Codeforces Round #485 (Div. 2) A. Infinity Gauntlet的更多相关文章

  1. Codeforces Round #485 (Div. 2)

    Codeforces Round #485 (Div. 2) https://codeforces.com/contest/987 A #include<bits/stdc++.h> us ...

  2. Codeforces Round #485 (Div. 2) D. Fair

    Codeforces Round #485 (Div. 2) D. Fair 题目连接: http://codeforces.com/contest/987/problem/D Description ...

  3. Codeforces Round #485 (Div. 2) F. AND Graph

    Codeforces Round #485 (Div. 2) F. AND Graph 题目连接: http://codeforces.com/contest/987/problem/F Descri ...

  4. Codeforces Round #485 (Div. 2) E. Petr and Permutations

    Codeforces Round #485 (Div. 2) E. Petr and Permutations 题目连接: http://codeforces.com/contest/987/prob ...

  5. Codeforces Round #485 (Div. 2) C. Three displays

    Codeforces Round #485 (Div. 2) C. Three displays 题目连接: http://codeforces.com/contest/987/problem/C D ...

  6. Codeforces Round #485 (Div. 2)-B-High School: Become Human

    B. High School: Become Human time limit per test 1 second memory limit per test 256 megabytes input ...

  7. Codeforces Round #485 (Div. 2) C题求三元组(思维)

    C. Three displays time limit per test 1 second memory limit per test 256 megabytes input standard in ...

  8. Codeforces Round #485 Div. 1 vp记

    A:对每种商品多源bfs一下每个点到该商品的最近距离,对每个点sort一下取前s个即可. #include<iostream> #include<cstdio> #includ ...

  9. Codeforces Round #366 (Div. 2) ABC

    Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate ...

随机推荐

  1. Python中的正则表达式(re)

    import re re.match #从开始位置开始匹配,如果开头没有则无 re.search #搜索整个字符串 re.findall #搜索整个字符串,返回一个list 举例: r(raw)用在p ...

  2. npm下载安装文件太慢..修改这个就好了..治好多年的便秘..真香预警

    修改 npm 的安装目录下的 npmrc文件 增加一条 registry=http://registry.cnpmjs.org 将原来的https改成下面的http $ npm config set ...

  3. kubernets网络模式

    参考:https://www.kubernetes.org.cn/2059.html

  4. 【机器学习_5】Anaconda:初学Python、入门机器学习的首选

    Anaconda是一个用于科学计算的Python发行版,提供了包管理与环境管理的功能,可以很方便地解决多版本python并存.切换以及各种第三方包安装问题. 集成包功能: NumPy:提供了矩阵运算的 ...

  5. shell脚本运行java程序jar

    在UBuntu上部署项目的时候,我们往往通过一段shell来启动程序,甚至是通过crontab定时任务来定时的调用java程序,但是很奇怪的一个问题就是,比如我写了一个如下的shell脚本: #!/b ...

  6. thymeleaf注入springboot

    thymeleaf注入springboot需要引入jar: <dependency> <groupId>org.springframework.boot</groupId ...

  7. windows上安装Maven与Gradle

    (一)安装Maven 1.百度maven,进入官网http://maven.apache.org/download.cgi,选择Download,在选择相应的压缩包apache-maven-3.6.0 ...

  8. gitlab 常用维护命令

    GitLab简介 GitLab 是一个用于仓库管理系统的开源项目.使用Git作为代码管理工具,并在此基础上搭建起来的web服务.Github是公共的git仓库,而Gitlab适合于搭建企业内部私有gi ...

  9. Full authentication is required to access this resource

    参考 https://www.jianshu.com/p/d10e0cee4adb security.basic.enabled=false

  10. Linux - 操作系统

    操作系统(科普章节) 目标 了解操作系统及作用 1. 操作系统(Operation System,OS) 操作系统作为接口的示意图 没有安装操作系统的计算机,通常被称为 裸机 如果想在 裸机 上运行自 ...