제출 #428231

#제출 시각아이디문제언어결과실행 시간메모리
428231tengiz05Two Transportations (JOI19_transportations)C++17
0 / 100
3000 ms384 KiB
#include "Azer.h" #include <bits/stdc++.h> namespace { int N; int count; std::vector<int> a; } // namespace int idx; void InitA(int N, int A, std::vector<int> U, std::vector<int> V, std::vector<int> C) { if (A != 0) { while (true) {; } } ::N = N; count = 0; idx = 0; a.assign(N, 0); } void ReceiveA(bool x) { a[idx] += (1 << (count % 20)) * x; count++; if (count % 20 == 0) idx++; } 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; int count; } // 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; 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++) { if (dist[i] == 1000000000) while (true) {; } for (int j = 0; j < 20; j++) { SendB(bool((1 << j) & dist[i])); } } count = 0; } 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...