結果

問題 No.1468 Colourful Pastel
ユーザー merom686
提出日時 2021-04-04 14:15:06
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 10 ms / 1,000 ms
コード長 736 bytes
コンパイル時間 2,027 ms
コンパイル使用メモリ 194,720 KB
最終ジャッジ日時 2025-01-20 11:10:12
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;

    const string r[] = { "Red", "Orange", "Yellow", "Green", "Cyan", "Blue", "Violet" };
    int p[256] = {};
    for (int i = 0; i < n; i++) {
        char c[10];
        cin >> c;
        p[c[0]]++;
    }
    for (int i = 0; i < n - 1; i++) {
        char c[10];
        cin >> c;
        p[c[0]]--;
    }
    for (int j = 0; j < 256; j++) {
        if (p[j]) {
            for (auto& s : r) {
                if (s[0] == j) {
                    cout << s << endl;
                    break;
                }
            }
            break;
        }
    }

    return 0;
}
0