fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. cout<<"Zrobione";
  6. return 0;
  7. }/*#include <iostream>
  8. #include <vector>
  9. #include <queue>
  10.  
  11. using namespace std;
  12.  
  13. const long long INF = 1e18;
  14. const int MAXN = 100005;
  15.  
  16. struct Edge {
  17.   int to;
  18.   int weight;
  19. };
  20.  
  21. vector<Edge> adj[MAXN * 10];
  22. long long dist[MAXN * 10];
  23. int nodes_down[MAXN * 4], nodes_up[MAXN * 4];
  24. int n, q, s, node_count;
  25.  
  26. void build(int v, int tl, int tr) {
  27.   if (tl == tr) {
  28.   nodes_down[v] = nodes_up[v] = tl;
  29.   return;
  30.   }
  31.   nodes_down[v] = ++node_count;
  32.   nodes_up[v] = ++node_count;
  33.   int tm = (tl + tr) / 2;
  34.   build(2 * v, tl, tm);
  35.   build(2 * v + 1, tm + 1, tr);
  36.  
  37.   adj[nodes_down[v]].push_back({nodes_down[2 * v], 0});
  38.   adj[nodes_down[v]].push_back({nodes_down[2 * v + 1], 0});
  39.  
  40.   adj[nodes_up[2 * v]].push_back({nodes_up[v], 0});
  41.   adj[nodes_up[2 * v + 1]].push_back({nodes_up[v], 0});
  42. }
  43.  
  44. void add_edge(int v, int tl, int tr, int l, int r, int u, int w, int type) {
  45.   if (l > r) return;
  46.   if (l == tl && r == tr) {
  47.   if (type == 2) adj[u].push_back({nodes_down[v], w});
  48.   else adj[nodes_up[v]].push_back({u, w});
  49.   return;
  50.   }
  51.   int tm = (tl + tr) / 2;
  52.   add_edge(2 * v, tl, tm, l, min(r, tm), u, w, type);
  53.   add_edge(2 * v + 1, tm + 1, tr, max(l, tm + 1), r, u, w, type);
  54. }
  55.  
  56. int main() {
  57.   ios_base::sync_with_stdio(false);
  58.   cin.tie(NULL);
  59.  
  60.   if (!(cin >> n >> q >> s)) return 0;
  61.  
  62.   node_count = n;
  63.   build(1, 1, n);
  64.  
  65.   for (int i = 0; i < q; ++i) {
  66.   int t;
  67.   cin >> t;
  68.   if (t == 1) {
  69.   int u, v, w;
  70.   cin >> v >> u >> w;
  71.   adj[v].push_back({u, w});
  72.   } else {
  73.   int v, l, r, w;
  74.   cin >> v >> l >> r >> w;
  75.   add_edge(1, 1, n, l, r, v, w, t);
  76.   }
  77.   }
  78.  
  79.   for (int i = 1; i <= node_count; ++i) dist[i] = INF;
  80.  
  81.   priority_queue<pair<long long, int>, vector<pair<long long, int>>, greater<pair<long long, int>>> pq;
  82.   dist[s] = 0;
  83.   pq.push({0, s});
  84.  
  85.   while (!pq.empty()) {
  86.   long long d = pq.top().first;
  87.   int v = pq.top().second;
  88.   pq.pop();
  89.  
  90.   if (d > dist[v]) continue;
  91.  
  92.   for (auto &edge : adj[v]) {
  93.   if (dist[v] + edge.weight < dist[edge.to]) {
  94.   dist[edge.to] = dist[v] + (long long)edge.weight;
  95.   pq.push({dist[edge.to], edge.to});
  96.   }
  97.   }
  98.   }
  99.  
  100.   for (int i = 1; i <= n; ++i) {
  101.   if (dist[i] == INF) cout << -1 << (i == n ? "" : " ");
  102.   else cout << dist[i] << (i == n ? "" : " ");
  103.   }
  104.   cout << endl;
  105.  
  106.   return 0;
  107. }*/
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
Zrobione