Submission #428247

#TimeUsernameProblemLanguageResultExecution timeMemory
428247tengiz05Two Transportations (JOI19_transportations)C++17
0 / 100
1 ms196 KiB
#include "Azer.h" #include <bits/stdc++.h> namespace { int N; int count; int a[10000]; 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; return; } void ReceiveA(bool x) { a[idx] += (1 << (count % 20)) * x; count++; if (count % 20 == 0) idx++; return; } std::vector<int> Answer() { //~ assert(count == 20 * N); std::vector<int> ans(N); for (int k = 0; k < N; ++k) { ans[k] = a[k]; } 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) { assert(false); ::n = N; std::vector<std::vector<std::pair<int, int>>> e(n); for (int i = 0; i < B - 1; i++) { e[S[i]].emplace_back(T[i], D[i]); e[T[i]].emplace_back(S[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); } } } for (int i = 0; i < n; i++) { for (int j = 0; j < 20; j++) { SendB(bool((1 << j) & dist[i])); } } } 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...