けんちょんの競プロ精進記録

競プロの精進記録や小ネタを書いていきます

AtCoder ABC 319 A - Legendary Players (灰色, 100 点)

これは難しくないけど、少し面倒。。

問題概要

次のようなプレイヤーのレーティング情報が与えられる。

tourist 3858
ksun48 3679
Benq 3658
Um_nik 3648
apiad 3638
Stonefeang 3630
ecnerwala 3613
mnbvmar 3555
newbiedmy 3516
semiexp 3481

プレイヤーの名前を表す文字列  S が与えられるので、そのプレイヤーのレーティングを出力せよ。

コード

オーソドックスにやるなら、素直に if 文を連ねればいいと思う。

#include <bits/stdc++.h>
using namespace std;

int main() {
    string S;
    cin >> S;
    if (S == "tourist") cout << 3858 << endl;
    else if (S == "ksun48") cout << 3679 << endl;
    else if (S == "Benq") cout << 3658 << endl;
    else if (S == "Um_nik") cout << 3648 << endl;
    else if (S == "apiad") cout << 3638 << endl;
    else if (S == "Stonefeang") cout << 3630 << endl;
    else if (S == "ecnerwala") cout << 3613 << endl;
    else if (S == "mnbvmar") cout << 3555 << endl;
    else if (S == "newbiedmy") cout << 3516 << endl;
    else if (S == "semiexp") cout << 3481 << endl;
}