您的位置:首页 > 数据库

MemSQL Start[c]UP 2.0 - Round 1A(构造)

2015-01-26 00:33 260 查看
题目链接:http://codeforces.com/problemset/problem/452/A

解题思路:

打个表暴力查找匹配。

完整代码:

#include <algorithm>
#include <iostream>
#include <cstring>
#include <complex>
#include <cstdio>
#include <string>
#include <cmath>
using namespace std;
typedef long long LL;
const int MOD = int(1e9)+7;
const int INF = 0x3f3f3f3f;
const double EPS = 1e-9;
const double PI = acos(-1.0); //M_PI;
string s[8] = {"vaporeon", "jolteon", "flareon", "espeon", "umbreon", "leafeon", "glaceon", "sylveon"};
string t , a;
int main()
{
    #ifdef DoubleQ
    freopen("in.txt","r",stdin);
    #endif
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int n;
    while(cin >> n)
    {
        cin >> a;
        for(int i = 0 ; i < 8 ; i ++)
        {
            if(n == s[i].length())
            {
                int flag = 0;
                for(int j = 0 ; j < n ; j ++)
                {
                    if(a[j] != '.' && a[j] != s[i][j])
                    {
                        flag = 1;
                        break;
                    }
                }
                if(flag == 1)
                    continue;
                else
                {
                    cout << s[i] << endl;
                    break;
                }
            }
        }
    }
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: