Submission #1122411

#TimeUsernameProblemLanguageResultExecution timeMemory
1122411gustavo_dTwo Transportations (JOI19_transportations)C++17
6 / 100
826 ms10276 KiB
#include "Azer.h" #include <bits/stdc++.h> using namespace std; namespace { int n; int i = 0; vector<int> ans; int bit = 0; } // namespace void InitA(int N, int A, vector<int> U, vector<int> V, vector<int> C) { ::n = N; ::ans = vector<int> (::n, 0); // SendA(true); } void ReceiveA(bool x) { if (x) { ::ans[::i] += (1 << ::bit); } ::bit++; if (::bit == 20) { ::bit = 0; ::i++; } } vector<int> Answer() { return ::ans; }
#include "Baijan.h" #include <bits/stdc++.h> using namespace std; namespace { } // namespace void InitB(int N, int B, vector<int> S, vector<int> T, vector<int> D) { int n = N; int MAXN = 2001; int INF = 1e9; vector<int> ans(n, INF); vector<pair<int, int>> adj[MAXN]; for (int i=0; i<B; i++) { int u = S[i], v = T[i], w = D[i]; adj[u].push_back({v, w}); adj[v].push_back({u, w}); } ans[0] = 0; priority_queue< pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>> > pq; pq.push({0, 0}); while (!pq.empty()) { int v = pq.top().second, d = pq.top().first; pq.pop(); if (ans[v] < d) continue; for (auto [viz, w] : adj[v]) { if (ans[viz] > d + w) { ans[viz] = d + w; pq.push({d + w, viz}); } } } for (int i=0; i<n; i++) { // cerr << ans[i] << endl; for (int b=0; b<20; b++) { if (((1 << b) & ans[i]) != 0) SendB(true); else SendB(false); } } } void ReceiveB(bool y) { // ++count; // if (count < 58000) { // SendB(FunctionExample(y)); // ++count; // } }
#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...