QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#603677#7860. Graph of Maximum Degree 3PHarrCompile Error//C++201.8kb2024-10-01 18:17:292024-10-01 18:17:33

Judging History

你现在查看的是最新测评结果

  • [2024-10-01 18:17:33]
  • 评测
  • [2024-10-01 18:17:29]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

using i32 = int32_t;
using i64 = long long;

#define int i64

using vi = vector<int>;
using pii = pair<int, int>;

const i32 inf = INT_MAX / 2;

const int mod = 998244353;

i32 main() {
    ios::sync_with_stdio(false), cin.tie(nullptr);
    int n, m;
    cin >> n >> m;
    vector<vector<pii>> e(n + 1);

    for (int x, y, c; m; m--) {
        cin >> x >> y >> c;
        e[x].emplace_back(y, c);
        e[y].emplace_back(x, c);
    }

    set<vi> R, B;
    for (int x = 1; x <= n; x++) {
        for (auto [y, c1]: e[x]) {
            if (y > x) {
                if (c1) R.insert({x, y});
                else B.insert({x, y});
            }
            for (auto [z, c2]: e[x]) {
                if (y == z) continue;
                if (y < z) continue;

                if (c1 != c2) continue;
                vi t = {x, y, z};
                ranges::sort(t);
                if (c1) R.insert(t);
                else B.insert(t);

                for (auto [w, c3]: e[y]) {
                    if (w == x or w == y or w == z) continue;
                    if (c1 != c3) continue;
                    t = {w, x, y, z};
                    ranges::sort(t);
                    if (c1) R.insert(t);
                    else B.insert(t);
                }

                for (auto [w, c3]: e[z]) {
                    if (w == x or w == y or w == z) continue;
                    if (c1 != c3) continue;
                    t = {w, x, y, z};
                    ranges::sort(t);
                    if (c1) R.insert(t);
                    else B.insert(t);
                }
            }
        }
    }
    int res = n;
    for (auto it: R)
        if (B.count(it)) res++;
    cout << res % mod;
    return 0;
}
 

詳細信息

answer.code:72:1: error: extended character   is not valid in an identifier
   72 |  
      | ^
answer.code:72:1: error: ‘ ’ does not name a type
   72 |  
      | ^