Submission #1122397

#TimeUsernameProblemLanguageResultExecution timeMemory
1122397gustavo_dTwo Transportations (JOI19_transportations)C++17
0 / 100
456 ms764 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 == 30) { ::bit = 0; ::i++; } } vector<int> Answer() { return ::ans; }
#include "Baijan.h" #include <bits/stdc++.h> using namespace std; namespace { int n; int count; } // 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<30; b++) { if (((1 << b) & ans[i]) != 0) SendB(true); else SendB(false); } } } void ReceiveB(bool y) { // ++count; // if (count < 58000) { // SendB(FunctionExample(y)); // ++count; // } }

Compilation message (stderr)

Baijan.cpp:8:5: warning: '{anonymous}::count' defined but not used [-Wunused-variable]
    8 | int count;
      |     ^~~~~
Baijan.cpp:7:5: warning: '{anonymous}::n' defined but not used [-Wunused-variable]
    7 | int n;
      |     ^
#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...