Submission #428319

#TimeUsernameProblemLanguageResultExecution timeMemory
428319tengiz05Two Transportations (JOI19_transportations)C++17
8 / 100
1472 ms27672 KiB
#include "Azer.h" #include <bits/stdc++.h> namespace { int n; int count; int u[1000000], v[1000000], d[1000000]; int idx; } // namespace void InitA(int N, int A, std::vector<int> U, std::vector<int> V, std::vector<int> C) { ::n = N; count = 0; idx = 0; for (; idx < A; idx++) { u[idx] = U[idx]; v[idx] = V[idx]; d[idx] = C[idx]; } return; } void ReceiveA(bool x) { int t = count % 31; if (t < 11) { u[idx] += x * (1<<t); } else if (t < 22) { t -= 11; v[idx] += x * (1<<t); } else { t -= 22; d[idx] += x * (1<<t); } count++; if (count % 31 == 0) idx++; return; } typedef std::pair<int, int> pii; std::vector<int> Answer() { std::vector<int> ans(n); std::vector<std::vector<std::pair<int, int>>> e(n); for (int i = 0; i < idx; i++) { e[u[i]].emplace_back(v[i], d[i]); e[v[i]].emplace_back(u[i], d[i]); } std::priority_queue<pii, std::vector<pii>> q; q.emplace(0, 0); std::vector<int> dist(n, 1e9); dist[0] = 0; while (!q.empty()) { auto [d, u] = q.top(); q.pop(); if (d > dist[u]) { continue; } for (auto [v, w] : e[u]) { if (dist[v] > d + w) { dist[v] = d + w; q.emplace(dist[v], v); } } } ans = dist; return ans; }
#include "Baijan.h" #include <bits/stdc++.h> namespace { int n; } // namespace typedef std::pair<int, int> pii; void InitB(int N, int B, std::vector<int> S, std::vector<int> T, std::vector<int> D) { ::n = N; for (int i = 0; i < B; i++) { for (int j = 0; j < 11; j++) { SendB(bool((1<<j) & S[i])); } for (int j = 0; j < 11; j++) { SendB(bool((1<<j) & T[i])); } for (int j = 0; j < 9; j++) { SendB(bool((1 << j) & D[i])); } } return; } void ReceiveB(bool y) { while (true) {; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...