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. Java笔试面试题整理第五波

    转载至:http://blog.csdn.net/shakespeare001/article/details/51321498 作者:山代王(开心阳) 本系列整理Java相关的笔试面试知识点,其他几 ...

  2. Android Studio 加载网络图片

    Android Studio是基于gradle的一个Android开发软件,在引用网络图片的时候需要连接第三方库,这里介绍 引用glide的方法. 一.在github页面搜索glide,点击第一个 二 ...

  3. ie和dom事件流的区别

    1.事件流的区别 IE采用冒泡型事件 Netscape使用捕获型事件 DOM使用先捕获后冒泡型事件 示例: 复制代码代码如下: <body> <div> <button& ...

  4. 微信小程序 实现三级联动-省市区

    github项目地址   https://github.com/z1511676208/chooseAddr 序:项目中需要用到三级联动,自己试着写了下,也查了一些资料,现在把这个记录一下,里面地区数 ...

  5. linux如何复制文件夹和移动文件夹

    linux下文件的复制.移动与删除命令为:cp,mv,rm一.文件复制命令cp 命令格式:cp [-adfilprsu] 源文件(source) 目标文件(destination)cp [option ...

  6. web socket client

    <!DOCTYPE HTML> <html> <head> <title>My WebSocket</title> </head> ...

  7. IIC 设备使用

    通过 读 / 写 IIC 设备上特定的存储空间,来使用设备提供的功能: 存储空间地址 = 设备名 + 设备地址(Slave Address) + 寄存器地址 . 注:设备地址.寄存器地址.地址中写入数 ...

  8. git从远程分支clone项目到本地,切换分支命令,其他常用命令

    1.在git命令窗口输入git clone git@139.129.217.217:sg/sgsq_cms.git 回车,即可克隆远程项目到本地.红色字体为远程分支的SSHkey,可以登录到gitli ...

  9. wget 网站扒取

    wget --mirror --page-requisites --adjust-extension --no-parent --convert-links  http://target.com

  10. Spring再接触 IOC DI

    直接上例子 引入spring以及Junite所需要的jar包 User.java package com.bjsxt.model; public class User { private String ...