---
# System prepended metadata

title: 12266 - Looking for Chinese Tutor
tags: [STL]

---

# 12266 - Looking for Chinese Tutor
>author: Utin
###### tags: `STL`

---

## Brief
See the code below

## Solution 0

```cpp=
#include <iostream>
#include <map>
#include <string>

std::map<std::string, std::string> Map = {
    {"Wa", "Waninoko"},
    {"Mi", "Milotic"},
    {"Ma", "Magikarp"},
    {"Va", "Vaporeon"},
    {"Sh", "Sharpedo"},
    {"Tapu", "Tapu Fini"},
    {"Em", "Empoleon"},
    {"La", "Lapras"},
    {"Pi", "Pikachu"},
    {"Pe", "Pikachu"},
    {"Me", "Mega Gyarados"}
};

int main() {
    int T;
    std::string name, school;
    std::cin >> T;
    while(T--) {
        std::string prefix = "";
        std::cin >> name >> school;
        prefix.push_back(name[0]);
        prefix.push_back(name[1]);
        auto it = Map.find(prefix);
        if (it == Map.end()) {
            prefix.push_back(name[2]);
            prefix.push_back(name[3]);
            if (prefix == "Tapu") std::cout << name << " the " << school << ' ' << Map[prefix] << '\n';
            else std::cout << name << " is looking for a Chinese tutor, too!\n";
        }
        else std::cout << name << " the " << school << ' ' << Map[prefix] << '\n';
    }
}

// By Utin
```

## Solution 1

```cpp=
#include <bits/stdc++.h>

int main() {
    int T;
    std::string name, school, pokemon;
    
    std::cin >> T;
    while (T--) {
        
        // get input
        std::cin >> name >> school;
        
        // process the data
        if (!name.find("Wa")) pokemon = "Waninoko";
        else if (!name.find("Mi")) pokemon = "Milotic";
        else if (!name.find("Ma")) pokemon = "Magikarp";
        else if (!name.find("Va")) pokemon = "Vaporeon";
        else if (!name.find("Sh")) pokemon = "Sharpedo";
        else if (!name.find("Tapu")) pokemon = "Tapu Fini";
        else if (!name.find("Em")) pokemon = "Empoleon";
        else if (!name.find("La")) pokemon = "Lapras";
        else if (!name.find("Pi")) pokemon = "Pikachu";
        else if (!name.find("Pe")) pokemon = "Pikachu";
        else if (!name.find("Me")) pokemon = "Mega Gyarados";
        else pokemon = "NotFound";

        // output
        if (pokemon != "NotFound") std::cout << name << " the " << school << ' ' << pokemon << '\n';
        else std::cout << name << " is looking for a Chinese tutor, too!\n";
    }
}

// By Utin
```

## Reference