結果

問題 No.3029 オイラー標数
ユーザー Today03
提出日時 2025-02-21 21:40:34
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 832 ms / 2,000 ms
コード長 498 bytes
コンパイル時間 3,932 ms
コンパイル使用メモリ 288,304 KB
実行使用メモリ 37,888 KB
最終ジャッジ日時 2025-02-21 21:40:57
合計ジャッジ時間 16,815 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9 + 10;
const ll INFL = 4e18;

int main() {
    int Q;
    cin >> Q;

    set<int> V;
    set<pair<int, int>> E;
    set<tuple<int, int, int>> F;

    while (Q--) {
        int a, b, c;
        cin >> a >> b >> c;
        V.insert(a), V.insert(b), V.insert(c);
        E.insert({a, b}), E.insert({b, c}), E.insert({a, c});
        F.insert({a, b, c});
    }

    cout << ssize(V) - ssize(E) + ssize(F) << endl;
}
0