acgo题库
  • 首页
  • 题库
  • 题单
  • 竞赛
  • 讨论
  • 排行
  • 团队
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(0)讨论(0)提交记录(0)
  • 首解

    #include <iostream> #include <vector> #include <queue> #include <climits> using namespace std; struct Edge { int to, cost; Edge(int t, int c) : to(t), cost(c) {} }; typedef pair<int, int> pii; int main() { int n, m; cin >> n >> m; }链接描述

    userId_undefined

    不是不笑,只是时候未到

    出道萌新倔强青铜
    31阅读
    0回复
    1点赞
  • tj

    #include <iostream> #include <vector> #include <queue> #include <climits> using namespace std; struct Edge { int to, cost; Edge(int t, int c) : to(t), cost(c) {} }; typedef pair<int, int> pii; int main() { int n, m; cin >> n >> m; vector<vector<Edge>> graph(n + 1); for (int i = 0; i < m; ++i) { int a, b, c; cin >> a >> b >> c; graph[a].push_back(Edge(b, c)); graph[b].push_back(Edge(a, c)); } vector<int> dist(n + 1, INT_MAX); dist[1] = 0; priority_queue<pii, vector<pii>, greater<pii>> pq; pq.push({0, 1}); while (!pq.empty()) { int u = pq.top().second; int d = pq.top().first; pq.pop(); } if (dist[n] == INT_MAX) { cout << -1 << endl; } else { cout << dist[n] << endl; } return 0; }

    userId_undefined

    AAA秋褲批發lexora_哥

    小有名气题解仙人时空双修者秩序白银传道者
    6阅读
    0回复
    1点赞
  • 最优解(167行)

    userId_undefined

    无敌的鳖佬仔给老爷爷猜猜被

    7月全勤卷王时间刺客空间掌握者循环·循环打卡人荣耀黄金I/O·IO入门者
    10阅读
    0回复
    0点赞
首页