Monday, July 28, 2014

Codeforces 2014 MemSQL Start[c]UP 2.0 - Round 1, problem: (A) Eevee solution

Codeforces 2014 MemSQL Start[c]UP 2.0 - Round 1, problem: (A) Eevee: http://codeforces.com/contest/452/problem/A

Codeforces 2014 MemSQL Start[c]UP 2.0 - Round 1, problem: (A) Eevee solution: http://ideone.com/XyPs1J


#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

int main() {
    int n, cnt=0, idx, b=0;
    char s[15], a[15][15]={"vaporeon","jolteon","flareon","espeon","umbreon","leafeon","glaceon","sylveon"};
    scanf("%d", &n);
    scanf("%s", s);
    for(int i=0; i<n; i++) if(s[i]!='.') b++;
    for(int i=0; i<8; i++) if(strlen(a[i])==n) {
        for(int j=0; j<n; j++) if(a[i][j]==s[j] && s[j]!='.') cnt++;
        if(cnt==b) {idx=i; break;}
        cnt=0;
    }
    printf("%s", a[idx]);
    return 0;
}

No comments:

Post a Comment