题意:给定一些动物的叫声,然后再定某些动物的叫声,让你去除这些叫声后得到的叫声。

析:先存储所有的叫声,然后用map来记录其他的叫声,在输出时再判定一下就好。

代码如下:

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <cstdio>
#include <string>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cstring>
#include <set>
#include <queue>
#include <algorithm>
#include <vector>
#include <map>
#include <cctype>
#include <cmath>
#include <stack>
#include <sstream>
#define freopenr freopen("in.txt", "r", stdin)
#define freopenw freopen("out.txt", "w", stdout)
using namespace std; typedef long long LL;
typedef pair<int, int> P;
const int INF = 0x3f3f3f3f;
const double inf = 0x3f3f3f3f3f3f;
const double PI = acos(-1.0);
const double eps = 1e-8;
const int maxn = 1e5 + 5;
const int mod = 1e9 + 7;
const int dr[] = {-1, 0, 1, 0};
const int dc[] = {0, 1, 0, -1};
const char *de[] = {"0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111", "1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111"};
int n, m;
const int mon[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int monn[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
inline int Min(int a, int b){ return a < b ? a : b; }
inline int Max(int a, int b){ return a > b ? a : b; }
inline LL Min(LL a, LL b){ return a < b ? a : b; }
inline LL Max(LL a, LL b){ return a > b ? a : b; }
inline bool is_in(int r, int c){
return r >= 0 && r < n && c >= 0 && c < m;
}
vector<string> ans;
map<string, int> mp; int main(){
int T; cin >> T;
getchar();
while(T--){
ans.clear();
mp.clear();
string s;
getline(cin, s);
stringstream ss(s);
while(ss >> s) ans.push_back(s);
while(getline(cin, s) && s != "what does the fox say?"){
stringstream ss(s);
for(int i = 0; ss >> s; ++i)
if(i > 1) mp[s] = 1;
}
bool ok = false;
for(int i = 0; i < ans.size(); ++i){
if(!mp[ans[i]]){
if(ok) putchar(' ');
printf("%s", ans[i].c_str());
ok = true;
}
}
printf("\n");
}
return 0;
}

UVaLive 6581 && Gym 100299B What does the fox say? (模拟+STL)的更多相关文章

  1. UVaLive 6585 && Gym 100299F Draughts (暴力+回溯)

    题意:给定一个 10*10的矩阵,每一个W可以跳过一个B向对角走到#并把B吃掉,并且可以一直跳直到不能动为止,现在是W走的时候,问你最多吃几个B. 析:直接暴力+回溯,深搜就好. 代码如下: #pra ...

  2. UVaLive 6950 && Gym 100299K Digraphs (DFS找环或者是找最长链)

    题意:有n个只包含两个字母的字符串, 要求构造一个m*m的字母矩阵, 使得矩阵的每行每列都不包含所给的字符串, m要尽量大, 如果大于20的话构造20*20的矩阵就行了. 析:开始吧,并没有读对题意, ...

  3. UVaLive 6588 && Gym 100299I (贪心+构造)

    题意:给定一个序列,让你经过不超过9的6次方次操作,变成一个有序的,操作只有在一个连续区间,交换前一半和后一半. 析:这是一个构造题,我们可以对第 i 个位置找 i 在哪,假设 i  在pos 位置, ...

  4. UVaLive 6591 && Gym 100299L Bus (水题)

    题意:略. 析:不解释,水题. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include < ...

  5. UVaLive 7375 Hilbert Sort (递归,四分图,模拟)

    题意:告诉你一条希尔伯特曲线的大小,然后给你n 个人,及n 个人的坐标,你的起点是左下角,终点是右下角,按照希尔伯特的曲线去走,按照这个顺序给n个人排序, 按顺序输出每个人的名字! 析:这就是一个四分 ...

  6. UVALive 4119 Always an integer (差分数列,模拟)

    转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Always an integer Time Limit:3000MS     M ...

  7. Gym 100851E Easy Problemset (水题,模拟)

    题意:给定 n 个裁判,然后每个都一些题目,现在要从每一个按顺序去选出 k 个题,并且这 k 个要按不递减顺序,如果没有,就用50补充. 析:就按他说的来,直接模拟就好. 代码如下: #pragma ...

  8. Parenthesis UVALive - 4882 删除不必要的括号序列,模拟题 + 数据

    https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_probl ...

  9. Codeforces Gym 100851 K King's Inspection ( 哈密顿回路 && 模拟 )

    题目链接 题意 : 给出 N 个点(最多 1e6 )和 M 条边 (最多 N + 20 条 )要你输出一条从 1 开始回到 1 的哈密顿回路路径,不存在则输出 " There is no r ...

随机推荐

  1. iOS的应用程序实现之间的内容分享

    前言 我们在iOS的平台上想要实现不同应用之间的内容分享一般有几种常用方式: 一种第的英文通过AirDrop实现不同设备的应用之间文档和数据的分享; 第二种是给每个应用程序定义一个URL方案,通过访问 ...

  2. 微信小程序 - 提取字体图标与其优化

    微信小程序,无论是字体图标还是图标,都差不多,只不过是为了以后字体图标修改方便,或者加效果方便而使用它而已! 1. 下载font-awesome http://fontawesome.dashgame ...

  3. Linux安装程序Anaconda分析(续)

    本来想写篇关于Anaconda的文章,但看到这里写的这么详细,转,原文在这里:Linux安装程序Anaconda分析(续) (1) disptach.py: 下面我们看一下Dispatcher类的主要 ...

  4. UnsatisfiedLinkError: No implementation found for , AndroidStudio使用*.so

    今天工作的时候.发现了一个jni的问题,java.lang.UnsatisfiedLinkError: No implementation found for...... 问题1:后来查了资料后发现. ...

  5. MySQL优化之——触发器

    转载请注明出处:http://blog.csdn.net/l1028386804/article/details/46763665 触发器是一个特殊的存储过程,不同的是存储过程要用CALL来调用,而触 ...

  6. EnumChildWindows

    EnumChildWindows 函数功能:枚举一个父窗口的所有子窗口. 函数原型:BOOL EnumChildWindows(HWND hWndParent,WNDENUMPROC lpEnumFu ...

  7. Hadoop 0.20.2+Ubuntu13.04配置和WordCount測试

    事实上这篇博客写的有些晚了.之前做过一些总结后来学校的事给忘了,这几天想又一次拿来玩玩发现有的东西记不住了.翻博客发现居然没有.好吧,所以赶紧写一份留着自己用吧.这东西网上有非常多,只是也不是全然适用 ...

  8. python day - 19 抽象类 接口类 多态 封装

    一. 抽象类接口类即制定一个规范 特点: 1.不可被实例化. 2.规范子类当中必须事先某个方法. 3.在python中有原生实现抽象类的方法,但没有原生实现接口类的方法. 例题:制定一个规范就是,子类 ...

  9. com.mongodb. org.mongodb.

  10. DELPHI中的消息处理机制(三种消息处理方法的比较,如何截断消息)

    DELPHI中的消息处理机制 Delphi是Borland公司提供的一种全新的WINDOWS编程开发工具.由于它采用了具有弹性的和可重用的面向对象Pascal(object-orientedpasca ...