CF---(452)A. Eevee
1 second
256 megabytes
standard input
standard output
You are solving the crossword problem K from IPSC 2014. You solved all the clues except for one: who does Eevee evolve into? You are not very into pokemons, but quick googling helped you find out, that Eevee can evolve into eight different pokemons: Vaporeon, Jolteon, Flareon, Espeon, Umbreon, Leafeon, Glaceon, and Sylveon.
You know the length of the word in the crossword, and you already know some letters. Designers of the crossword made sure that the answer is unambiguous, so you can assume that exactly one pokemon out of the 8 that Eevee evolves into fits the length and the letters given. Your task is to find it.
First line contains an integer n (6 ≤ n ≤ 8) – the length of the string.
Next line contains a string consisting of n characters, each of which is either a lower case english letter (indicating a known letter) or a dot character (indicating an empty cell in the crossword).
Print a name of the pokemon that Eevee can evolve into that matches the pattern in the input. Use lower case letters only to print the name (in particular, do not capitalize the first letter).
7 j......
jolteon
7 ...feon
leafeon
7 .l.r.o.
flareon
Here's a set of names in a form you can paste into your solution:
["vaporeon", "jolteon", "flareon", "espeon", "umbreon", "leafeon", "glaceon", "sylveon"]
{"vaporeon", "jolteon", "flareon", "espeon", "umbreon", "leafeon", "glaceon", "sylveon"}
给你一个稀疏的字符串,告诉你长度,然后要你在已知的8个字符串下进行匹配..........
代码:
#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
struct node{
int len;
char ss[];
};
node str[]={
{,"vaporeon"},
{,"jolteon"},
{,"flareon"},
{, "espeon"},
{,"umbreon"},
{,"leafeon"},
{,"glaceon"},
{,"sylveon"}
};
int main()
{
int n;
char ss[];
//freopen("test.in","r",stdin);
while(scanf("%d%s",&n,ss)!=EOF)
for(int i=;i<;i++){
if(n==str[i].len){
bool flag=true;
for(int j=;j<n;j++){
if(ss[j]!='.'&&ss[j]!=str[i].ss[j]){
flag=false;
break;
}
}
if(flag){
printf("%s\n",str[i].ss);
break;
}
}
}
return ;
}
CF---(452)A. Eevee的更多相关文章
- Oracle索引梳理系列(九)- 浅谈聚簇因子对索引使用的影响及优化方法
版权声明:本文发布于http://www.cnblogs.com/yumiko/,版权由Yumiko_sunny所有,欢迎转载.转载时,请在文章明显位置注明原文链接.若在未经作者同意的情况下,将本文内 ...
- 嵌入式Linux开发教程:Linux常见命令(上篇)
摘要:这是对周立功编著的<嵌入式Linux开发教程>的第7期连载.本期刊载内容有关LinuxLinux常见命令中的导航命令.目录命令和文件命令.下一期将连载网络操作命令.安装卸载文件系统等 ...
- Cocos2d-x学习笔记(19)(TestCpp源代码分析-3)
本章主要介绍testBasic.h/cpp,这两个文件主要用于返回主场景界面. //testBasic.h #ifndef _TEST_BASIC_H_ #define _TEST_BASIC_H_ ...
- 流式大数据计算实践(5)----HBase使用&SpringBoot集成
一.前言 1.上文中我们搭建好了一套HBase集群环境,这一文我们学习一下HBase的基本操作和客户端API的使用 二.shell操作 先通过命令进入HBase的命令行操作 /work/soft/hb ...
- CF(协同过滤算法)
1 集体智慧和协同过滤 1.1 什么是集体智慧(社会计算)? 集体智慧 (Collective Intelligence) 并不是 Web2.0 时代特有的,只是在 Web2.0 时代,大家在 Web ...
- 推荐系统算法学习(一)——协同过滤(CF) MF FM FFM
https://blog.csdn.net/qq_23269761/article/details/81355383 1.协同过滤(CF)[基于内存的协同过滤] 优点:简单,可解释 缺点:在稀疏情况下 ...
- CF 980D Perfect Groups(数论)
CF 980D Perfect Groups(数论) 一个数组a的子序列划分仅当这样是合法的:每个划分中的任意两个数乘积是完全平方数.定义a的权值为a的最小子序列划分个数.现在给出一个数组b,问权值为 ...
- CF 984C Finite or not? (数论)
CF 984C Finite or not? (数论) 给定T(T<=1e5)组数据,每组数据给出十进制表示下的整数p,q,b,求问p/q在b进制意义下是否是有限小数. 首先我们先把p/q约分一 ...
- 【LeetCode】452. Minimum Number of Arrows to Burst Balloons 解题报告(Python)
[LeetCode]452. Minimum Number of Arrows to Burst Balloons 解题报告(Python) 标签(空格分隔): LeetCode 题目地址:https ...
- DFS序+线段树+bitset CF 620E New Year Tree(圣诞树)
题目链接 题意: 一棵以1为根的树,树上每个节点有颜色标记(<=60),有两种操作: 1. 可以把某个节点的子树的节点(包括本身)都改成某种颜色 2. 查询某个节点的子树上(包括本身)有多少个不 ...
随机推荐
- Android Volley 框架的使用(一)
为什么要使用Volley框架 开发android应用很多时候都要涉及网络操作,Android SDK中提供了HttpClient 和 HttpUrlConnection两种方式用来处理网络操作,但当应 ...
- [转]GameObject的Active与InActive
GameObject的Active与InActive 1.Script可以控制InActive的GameObject,但前提是Script所依附的GameObject不能是InActive,一旦为In ...
- FreeSWITCH的传真发送
详细的学习请参考:https://wiki.freeswitch.org/wiki/Mod_spandsp 我只说说WIKI上没有直接写出来却又很实用的东西. 一.传真收发 环境大致如下: FreeS ...
- 集成学习(Ensembling Learning)
集成学习(Ensembling Learning) 标签(空格分隔): 机器学习 Adabost 对于一些弱分类器来说,如何通过组合方法构成一个强分类器.一般的思路是:改变训练数据的概率分布(权值分布 ...
- bzoj 1588: [HNOI2002]营业额统计 treap
1588: [HNOI2002]营业额统计 Time Limit: 5 Sec Memory Limit: 162 MBSubmit: 13902 Solved: 5225[Submit][Sta ...
- ubuntu14.04配置静态IP地址
1. 找到文件并作如下修改:vim /etc/network/interfaces修改如下部分:# interfaces(5) file used by ifup(8) and ifdown(8)au ...
- iOS - UITextView
前言 NS_CLASS_AVAILABLE_IOS(2_0) @interface UITextView : UIScrollView <UITextInput> @available(i ...
- iOS - UIPickerView
前言 NS_CLASS_AVAILABLE_IOS(2_0) __TVOS_PROHIBITED @interface UIPickerView : UIView <NSCoding, UITa ...
- 一个不错的能将HTML表格导出为excel,pdf等的jquery插件
https://github.com/kayalshri/tableExport.jquery.plugin https://github.com/kayalshri/ tableExport.jqu ...
- hibernate对象关系实现(三)多对多实现
单向n-n:(catogory-item)一个类别对应多个条目,一个条目对应多个类别 a.以类别类中有条目的集合的引用为例: b.数据库中的体现:建立一个新表,以类别和条目的主键关联的外键做新表的联合 ...