QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#487260#6354. 4ucup-team2307#Compile Error//C++141.5kb2024-07-22 19:23:422024-07-22 19:23:42

Judging History

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

  • [2024-07-22 19:23:42]
  • 评测
  • [2024-07-22 19:23:42]
  • 提交

answer

#pragma GCC optimize("Ofast,unroll-loops")
#include<bits/stdc++.h>
#pragma GCC target("avx,avx2,sse,sse2")
#define all(x) begin(x), end(x)
using namespace std;
using ll = long long;
#include <bits/extc++.h> /** keep-include */
// To use most bits rather than just the lowest ones:
struct chash { // large odd number for C
	const uint64_t C = ll(4e18 * acos(0)) | 71;
	ll operator()(ll x) const { return __builtin_bswap64(x*C); }
};

int main() {
	cin.tie(0)->sync_with_stdio(0);
    mt19937 rng(32);
    int n, m;
    cin >> n >> m;

    vector<int> perm(n); iota(all(perm), 0); shuffle(all(perm), rng);

    vector<vector<int>> g(n);
    vector uh(n, __gnu_pbds::gp_hash_table<ll,int,chash>({},{},{},{},{1<<16}));
    vector<array<int, 2>> edges(m);
    for(auto &[u, v] : edges) {
        cin >> u >> v;
        --u, --v;
        u = perm[u], v= perm[v];
        g[u].push_back(v);
        g[v].push_back(u);
        uh[u][v] = uh[v][u] = 1;
    }
    vector<uint64_t> bt(n);
    ll ans = 0;
    for(int s = 0; s < m; s += 64) {
        int e = min(s + 64, m);
        fill(all(bt), 0);
        
        for(int i = s; i < e; i++) {
            auto [u, v] = edges[i];
            if(g[u].size() > g[v].size()) swap(u, v);
            for(auto w : g[u]) {
                if(uh[v][w]) {
                    bt[w] |= 1ull<<(i&63);
                }
            }
        }

        for(auto [u, v] : edges) {
            ans += __builtin_popcountll(bt[u] & bt[v]);
        }
    }
    cout << ans / 6 << '\n';
}

详细

answer.code: In function ‘int main()’:
answer.code:23:12: error: missing template arguments before ‘uh’
   23 |     vector uh(n, __gnu_pbds::gp_hash_table<ll,int,chash>({},{},{},{},{1<<16}));
      |            ^~
answer.code:23:60: error: expected primary-expression before ‘,’ token
   23 |     vector uh(n, __gnu_pbds::gp_hash_table<ll,int,chash>({},{},{},{},{1<<16}));
      |                                                            ^
answer.code:23:61: error: expected primary-expression before ‘{’ token
   23 |     vector uh(n, __gnu_pbds::gp_hash_table<ll,int,chash>({},{},{},{},{1<<16}));
      |                                                             ^
answer.code:23:63: error: expected primary-expression before ‘,’ token
   23 |     vector uh(n, __gnu_pbds::gp_hash_table<ll,int,chash>({},{},{},{},{1<<16}));
      |                                                               ^
answer.code:23:64: error: expected primary-expression before ‘{’ token
   23 |     vector uh(n, __gnu_pbds::gp_hash_table<ll,int,chash>({},{},{},{},{1<<16}));
      |                                                                ^
answer.code:23:66: error: expected primary-expression before ‘,’ token
   23 |     vector uh(n, __gnu_pbds::gp_hash_table<ll,int,chash>({},{},{},{},{1<<16}));
      |                                                                  ^
answer.code:23:67: error: expected primary-expression before ‘{’ token
   23 |     vector uh(n, __gnu_pbds::gp_hash_table<ll,int,chash>({},{},{},{},{1<<16}));
      |                                                                   ^
answer.code:23:69: error: expected primary-expression before ‘,’ token
   23 |     vector uh(n, __gnu_pbds::gp_hash_table<ll,int,chash>({},{},{},{},{1<<16}));
      |                                                                     ^
answer.code:23:70: error: expected primary-expression before ‘{’ token
   23 |     vector uh(n, __gnu_pbds::gp_hash_table<ll,int,chash>({},{},{},{},{1<<16}));
      |                                                                      ^
answer.code:23:77: error: expected primary-expression before ‘)’ token
   23 |     vector uh(n, __gnu_pbds::gp_hash_table<ll,int,chash>({},{},{},{},{1<<16}));
      |                                                                             ^
answer.code:25:15: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
   25 |     for(auto &[u, v] : edges) {
      |               ^
answer.code:31:9: error: ‘uh’ was not declared in this scope; did you mean ‘u’?
   31 |         uh[u][v] = uh[v][u] = 1;
      |         ^~
      |         u
answer.code:40:18: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
   40 |             auto [u, v] = edges[i];
      |                  ^
answer.code:43:20: error: ‘uh’ was not declared in this scope; did you mean ‘u’?
   43 |                 if(uh[v][w]) {
      |                    ^~
      |                    u
answer.code:49:18: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
   49 |         for(auto [u, v] : edges) {
      |                  ^