QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#75213#3871. Voting CitieshassybirobiroCompile Error//C++174.5kb2023-02-04 16:45:182023-02-04 16:45:19

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-04 16:45:19]
  • Judged
  • [2023-02-04 16:45:18]
  • Submitted

answer

#include <bits/stdc++.h>
#include <sys/time.h>
#include <atcoder/all>

using namespace std;
using namespace atcoder;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vl = vector<long>;
using vvl = vector<vl>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vpii = vector<pii>;
using vpll = vector<pll>;
using vstr = vector<string>;
constexpr ll INF_LL=1LL<<62;
constexpr int INF_I=1LL<<30;
constexpr ll inf = 1e12 + 7;
#define rep(i,n) for(int i=0; i<((int)(n)); i++)
#define reps(i,n) for(int i=1; i<=((int)(n)); i++)
#define vector_cin(x) for(auto &n : (x)) cin >> n
#define ALL(x) (x).begin(), (x).end()
#define YesNo(x) ((x) ? "Yes": "No")
#define pb emplace_back
#define to_lower(S) transform(ALL((S)), (S).begin(), ::tolower)
#define to_upper(S) transform(ALL((S)), (S).begin(), ::toupper)
template <typename T>
bool chmax(T &a, const T& b) {if (a < b){a = b;return true;}return false;}

template <typename T>
bool chmin(T &a, const T& b) {if (a > b){a = b;return true;}return false;}
ll ceilint(ll x, ll y) {return (x + y - 1) / y;}
void Main();
int main() {std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);std::cout << std::fixed << std::setprecision(15);Main();return 0;}

//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

struct edge{
    ll to, cost;
    edge(ll t, ll c) : to(t), cost(c) {};
};

using Graph = vector<vector<edge>>;

vector<ll> dijkstra(vector<vector<edge>> graph, int n, int start, ll INF) {
    priority_queue<pll, vector<pll>, greater<pll>> que;
    vector<ll> dst(n, INF);
    dst[start] = 0;
    que.push(pll(0, start));
    while (que.size())
    {
        int d = que.top().first;
        int u = que.top().second;
        que.pop();
        if (dst[u] < d)
            continue;
        for (int i = 0; i < graph[u].size(); ++i)
        {
            int v = graph[u][i].to;
            ll cost = graph[u][i].cost;
            if (dst[v] > d + cost)
            {
                dst[v] = d + cost;
                que.push(pll(dst[v], v));
            }
        }
    }
    return dst;
}

vll getpath(vll& prev, ll g) {
    vll path;
    for (int cur = g; cur != -1; cur = prev[cur])
        path.pb(cur);
    reverse(ALL(path));
    return path;
}

void Main () {
    ll N, E, K;
    cin >> N >> E >> K;
    Graph G(N);
    vll T(K);
    vvll edge_cost(N, vll(N, -1));
    vector_cin(T);
    rep(i, E) {
        ll U, V, C;
        cin >> U >> V >> C;
        edge_cost[U][V] = C;
        G[U].pb(edge(V, C));
    }
    ll Q;
    cin >> Q;
    if (Q == 1 && K == 1) {
        ll S;
        cin >> S;
        vll P(5);
        rep(i, 5) cin >> P[i];
        vll d, path, prev(N, -1);
        d = dijkstra(G, N, S, INF_LL);
        if (d[T[0]] == INF_LL) cout << -1 << endl;
        else cout << d[T[0]] << endl;
        return;
    } else return;
    /*while (Q--) {
        ll S;
        cin >> S;
        vll P(5);
        rep(i, 5) cin >> P[i];
        ll ans = INF_LL;
        vll d, path, prev(N, -1);
        d = dijikstra(G, S, N, prev);
        for (auto& t : T) {
            if (d[t] == INF_LL)
                continue;
            vll costs;
            path = getpath(prev, t);
            rep(i, path.size()) {
                if (i > 0) {
                    costs.pb(edge_cost[path[i - 1]][path[i]]);
                }
            }
            sort(ALL(costs), greater<ll>());
            for (int bit = 0; bit < (1LL << 5); bit++) {
                vll V;
                rep(i, 5) if (bit & (1LL << i)) V.pb(i);
                reverse(ALL(V));
                ll dist =  d[t];
                ll j = 0;
                rep(i, V.size()) {
                    if (P[V[i]] == -1) continue;
                    if (P[V[i]] > (costs[j] / 10) * (V[i] + 1)) {
                        dist = INF_LL;
                        break;
                    }
                    dist += P[V[i]];
                    dist -= (costs[j] / 10) * (V[i] + 1);
                    j++;
                    if (j >= costs.size()) break;
                }
                chmin(ans, dist);
            }
        }
        if (ans != INF_LL) 
            cout << ans << endl;
        else 
            cout << -1 << endl;
    }*/
}

Details

answer.code:3:10: fatal error: atcoder/all: No such file or directory
    3 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.