QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#878068#9691. Little, Cyan, Fish!ucup-team3646#Compile Error//C++201.7kb2025-02-01 13:23:212025-02-01 13:23:22

Judging History

This is the latest submission verdict.

  • [2025-02-01 13:23:22]
  • Judged
  • [2025-02-01 13:23:21]
  • Submitted

answer

template<class ft = ll>
struct Dinic {
  ll n, m;
  struct edge {
    ll to, rev;
    ft cap;
  };
  vector<vector<edge>> g;
  vector<array<ll, 2>> pos;

  Dinic() = default;
  Dinic(ll n) : n(n), m(0), g(n) {}

  ll add_edge(ll from, ll to, ft cap) {
    ll tid = g[to].size(), fid = g[from].size();
    g[from].push_back(edge{to, tid, cap});
    g[to].push_back({edge{from, fid, 0}});
    pos.push_back({from, fid});
    return m++;
  }

  ft flow(ll s, ll t, ft limit = 1e18) {
    vector<ll> level(n), iter(n);
    auto bfs = [&]() {
      fill(all(level), -1);
      level[s] = 0;
      queue<ll> que;
      que.push(s);
      while(que.size()) {
        ll v = que.front();
        que.pop();
        for(auto e : g[v]) {
          if(e.cap == 0 || level[e.to] >= 0) continue;
          level[e.to] = level[v] + 1;
          if(e.to == t) return;
          que.push(e.to);
        }
      }
    };
    auto dfs= [&](auto self, ll v, ft up) {
      if(v == s) return up;
      ft res = 0;
      for(ll &i = iter[v]; i < (ll)g[v].size(); ++i) {
        edge &e = g[v][i];
        if(level[v] <= level[e.to] || g[e.to][e.rev].cap == 0) continue;
        ft d = self(self, e.to, min(up - res, g[e.to][e.rev].cap));
        if(d <= 0) continue;
        g[v][i].cap += d;
        g[e.to][e.rev]cap -= d;
        res += d;
        if(res == up) return res;
      }
      level[v] = n;
      return res;
    };

    ft flow = 0;
    while(flow < limit) {
      bfs();
      if(level[t] == -1) break;
      fill(all(iter), 0);
      ft f = dfs(dfs, t, limit - flow);
      if(!f) break;
      flow += f;
    }
    return flow;
  }

};

hoge

詳細信息

answer.code:1:21: error: ‘ll’ does not name a type
    1 | template<class ft = ll>
      |                     ^~
answer.code:3:3: error: ‘ll’ does not name a type
    3 |   ll n, m;
      |   ^~
answer.code:5:5: error: ‘ll’ does not name a type
    5 |     ll to, rev;
      |     ^~
answer.code:8:10: error: ‘vector’ was not declared in this scope
    8 |   vector<vector<edge>> g;
      |          ^~~~~~
answer.code:8:10: error: ‘vector’ was not declared in this scope
answer.code:8:10: error: ‘vector’ was not declared in this scope
answer.code:8:10: error: ‘vector’ was not declared in this scope
answer.code:8:10: error: ‘vector’ was not declared in this scope
answer.code:8:10: error: ‘vector’ was not declared in this scope
answer.code:8:10: error: ‘vector’ was not declared in this scope
answer.code:8:10: error: ‘vector’ was not declared in this scope
answer.code:8:10: error: ‘vector’ was not declared in this scope
answer.code:8:10: error: ‘vector’ was not declared in this scope
answer.code:8:3: error: ‘vector’ does not name a type
    8 |   vector<vector<edge>> g;
      |   ^~~~~~
answer.code:9:16: error: ‘ll’ was not declared in this scope
    9 |   vector<array<ll, 2>> pos;
      |                ^~
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:10: error: ‘array’ was not declared in this scope
    9 |   vector<array<ll, 2>> pos;
      |          ^~~~~
answer.code:9:16: error: ‘ll’ was not declared in this scope
    9 |   vector<array<ll, 2>> pos;
      |                ^~
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:10: error: ‘array’ was not declared in this scope
    9 |   vector<array<ll, 2>> pos;
      |          ^~~~~
answer.code:9:16: error: ‘ll’ was not declared in this scope
    9 |   vector<array<ll, 2>> pos;
      |                ^~
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:10: error: ‘array’ was not declared in this scope
    9 |   vector<array<ll, 2>> pos;
      |          ^~~~~
answer.code:9:16: error: ‘ll’ was not declared in this scope
    9 |   vector<array<ll, 2>> pos;
      |                ^~
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:10: error: ‘array’ was not declared in this scope
    9 |   vector<array<ll, 2>> pos;
      |          ^~~~~
answer.code:9:16: error: ‘ll’ was not declared in this scope
    9 |   vector<array<ll, 2>> pos;
      |                ^~
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in this scope
answer.code:9:16: error: ‘ll’ was not declared in ...