本文主要是介绍MemSQL Start[c]UP 2.0 - Round 1A(构造),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
题目链接: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 DoubleQfreopen("in.txt","r",stdin);#endifstd::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;}}}}
}
这篇关于MemSQL Start[c]UP 2.0 - Round 1A(构造)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!