Submission #985114

# Submission time Handle Problem Language Result Execution time Memory
985114 2024-05-17T10:49:34 Z reverberation Cyberland (APIO23_cyberland) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
using pll = pair<ll, ll>;
using ll = long long;
double solve(ll n, ll m, ll k, ll h, vector<ll> x, vector<ll> y, vector<ll> c, vector<ll> v) {
    vector<vector<pll>> g(n);
    for (ll i = 0; i < m; i++) {
        ll a = x[i], b = y[i], cost = c[i];
        g[a].push_back({b, cost});
        g[b].push_back({a, cost});
    }
    vector<ll> dist(n, 1e16 + 10);
    dist[0] = 0;
    priority_queue<pll, vector<pll>, greater<pll>> q;
    q.push({0, 0});
    while (!q.empty()) {
        auto [curcost, v] = q.top();
        q.pop();
        if (curcost != dist[v]) continue;
        for (auto [to, cost] : g[v]) {
            if (dist[to] > dist[v] + cost) {
                dist[to] = dist[v] + cost;
                q.push({dist[to], to});
            }
        }
    }
    return dist[h];
}

Compilation message

cyberland.cpp:3:18: error: 'll' was not declared in this scope
    3 | using pll = pair<ll, ll>;
      |                  ^~
cyberland.cpp:3:22: error: 'll' was not declared in this scope
    3 | using pll = pair<ll, ll>;
      |                      ^~
cyberland.cpp:3:24: error: template argument 1 is invalid
    3 | using pll = pair<ll, ll>;
      |                        ^
cyberland.cpp:3:24: error: template argument 2 is invalid
cyberland.cpp: In function 'double solve(ll, ll, ll, ll, std::vector<long long int>, std::vector<long long int>, std::vector<long long int>, std::vector<long long int>)':
cyberland.cpp:6:19: error: 'pll' was not declared in this scope; did you mean 'll'?
    6 |     vector<vector<pll>> g(n);
      |                   ^~~
      |                   ll
cyberland.cpp:6:19: error: template argument 1 is invalid
cyberland.cpp:6:19: error: template argument 2 is invalid
cyberland.cpp:6:22: error: template argument 1 is invalid
    6 |     vector<vector<pll>> g(n);
      |                      ^~
cyberland.cpp:6:22: error: template argument 2 is invalid
cyberland.cpp:9:10: error: invalid types 'int[ll {aka long long int}]' for array subscript
    9 |         g[a].push_back({b, cost});
      |          ^
cyberland.cpp:10:10: error: invalid types 'int[ll {aka long long int}]' for array subscript
   10 |         g[b].push_back({a, cost});
      |          ^
cyberland.cpp:14:35: error: template argument 2 is invalid
   14 |     priority_queue<pll, vector<pll>, greater<pll>> q;
      |                                   ^
cyberland.cpp:14:49: error: template argument 2 is invalid
   14 |     priority_queue<pll, vector<pll>, greater<pll>> q;
      |                                                 ^~
cyberland.cpp:14:49: error: template argument 3 is invalid
cyberland.cpp:15:7: error: request for member 'push' in 'q', which is of non-class type 'int'
   15 |     q.push({0, 0});
      |       ^~~~
cyberland.cpp:16:15: error: request for member 'empty' in 'q', which is of non-class type 'int'
   16 |     while (!q.empty()) {
      |               ^~~~~
cyberland.cpp:17:31: error: request for member 'top' in 'q', which is of non-class type 'int'
   17 |         auto [curcost, v] = q.top();
      |                               ^~~
cyberland.cpp:18:11: error: request for member 'pop' in 'q', which is of non-class type 'int'
   18 |         q.pop();
      |           ^~~
cyberland.cpp:23:19: error: request for member 'push' in 'q', which is of non-class type 'int'
   23 |                 q.push({dist[to], to});
      |                   ^~~~