結果

問題 No.785 色食い虫
ユーザー oooooba
提出日時 2021-04-11 19:36:46
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 954 bytes
コンパイル時間 1,396 ms
コンパイル使用メモリ 118,440 KB
最終ジャッジ日時 2025-01-20 16:09:54
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <optional>
#include <queue>
#include <set>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

int main() {
    vector<vector<bool>> xs(3, vector<bool>(16));
    for (auto i = 0; i < 3; ++i) {
        string s;
        cin >> s;
        if (s == "NONE")
            continue;
        for (auto c : s) {
            if (c == ',')
                continue;
            if ('0' <= c && c <= '9')
                xs[i][c - '0'] = true;
            else
                xs[i][c - 'A' + 10] = true;
        }
    }
    int32_t ans = 1;
    for (auto i = 0; i < 3; ++i) {
        int32_t t = 0;
        for (auto x : xs[i]) {
            if (!x)
                ++t;
        }
        ans *= t * t;
    }
    cout << ans << endl;
    return 0;
}
0