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. window.open() 打开的子页面 往主页面传参问题

    <!--主页面的代码--><!DOCTYPE html> <html> <head> <meta charset="utf-8" ...

  2. matlab-画一个圆

    我们可以用 李萨如图形 的思路去画一个圆,或者一个椭圆. x,y是圆心所在坐标,r是半径,nseg是边缘段数(越高,边缘越顺滑,建议100以上),S是plot的样式设置字符 function Draw ...

  3. python至winreg模块

    _winreg模块在python3中已经改名了 https://blog.csdn.net/zhangxiaoyang0/article/details/72236305?fps=1&loca ...

  4. c# post 接收传来的文件

    private void UploadFile() { // //......其他代码 // HttpFileCollection files = HttpContext.Current.Reques ...

  5. mvc中view与controll之间传递参数时,可以使用url进行传递

    mvc中view与controller之间传递参数时,可以使用url进行传递,但是在url的地址中需要加上“id=123”这样的东西才行. 具体如代码: window.location.href = ...

  6. 关于HashMap和HashTable.md

    目录 先来些简单的问题 你用过HashMap吗?" "什么是HashMap?你为什么用到它?" "你知道HashMap的工作原理吗?" "你 ...

  7. python入门(五):切片列表元祖字典

    1.切片 针对序列,使用切片可以获得我们想要的内容 序列:字符串.列表.元祖 特点:可以使用坐标获取某一个值.坐标是从0开始算 >>> s="0123456789" ...

  8. Java学习笔记(十六):this关键字

  9. DB2在dbvisualizer 客户端执行begi/end 语句块

    注意,begin end 代码块在dbvisualizer 执行前要加 --/   后面要加   / 注意,begin end 代码块在dbvisualizer 执行前要加 --/   后面要加    ...

  10. 十一、Composite 组合模式

    原理: 代码清单 Entity public abstract class Entry { public abstract String getName(); public abstract int ...