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. 查询某个节点的子树上(包括本身)有多少个不 ...
随机推荐
- 模块mod_h323的编译
去h.323plus官网上下载关联的库 http://www.h323plus.org/source/ 很贴心,分操作系统下载,而且关联的ptlib库的版本也一并列了出来. 一.编译ptlib库 ex ...
- Download file using libcurl in C/C++
http://stackoverflow.com/questions/1636333/download-file-using-libcurl-in-c-c #include <stdio.h&g ...
- 表生成器@ TableGenerator
将当前主键的值单独保存到一个数据库的表中,主键的值每次都是从指定的表中查询来获得,这种生成主键的方式也是很常用的.这种方法生成主键的策略可以适用于任何的数据库,不必担心不同数据库不兼容造成的问题. 使 ...
- CUBRID学习笔记 29 web管理中文语言文件 CUBRID教程
网站的中文语言文件部分 http://files.cnblogs.com/files/wang2650/Messages.7z
- git学习笔记09-bug分支-自己的分支改到一半了-要去改bug怎么办?
当你接到一个修复一个代号101的bug的任务时,很自然地,你想创建一个分支issue-101来修复它,但是,等等,当前正在dev上进行的工作还没有提交: 并不是你不想提交,而是工作只进行到一半,还没法 ...
- 操作符 Thinking in Java 第三章
3.1 更简单的打印语句 3.2 使用Java操作符 3.3 优先级 *int类型+String类型 直接转换为String类型 3.4 赋值 1. *引用=引用 两个引用指向同一个对象,所以操作 ...
- [转载] [Mark]分布式存储必读论文
原文: http://50vip.com/423.html 分布式存储泛指存储存储和管理数据的系统, 与无状态的应用服务器不同, 如何处理各种故障以保证数据一致,数据不丢, 数据持续可用, 是分布式存 ...
- C# ?(问号)的三个用处(转载)
public DateTime? StatusDateTime = null; 脑子便也出现个问号,这是什么意思呢?网上搜下,总结如下: 1. 可空类型修饰符(?): 引用类型可以使用空引用表示一个不 ...
- (一)mtg3000常见操作
一.查看MTG3000主控板IP地址: 重启设备后一直跑到shell,用户名和密码都输入admin,然后输入en进入命令行界面,输入sh int可查看设备IP等信息. 2.升级app.web程序
- 僵尸进程学习 & 进程状态列表 & Linux信号学习
参考这篇文章: http://www.mike.org.cn/articles/treatment-of-zombie-processes-under-linux/ 在Linux进程的状态中,僵尸进程 ...