Submission #428071

#TimeUsernameProblemLanguageResultExecution timeMemory
428071amunduzbaevTwo Transportations (JOI19_transportations)C++14
0 / 100
533 ms516 KiB
#include "Azer.h" #include "bits/stdc++.h" using namespace std; vector<int> tt; int cnt, rr, last; void InitA(int n, int a, vector<int> u, vector<int> v, vector<int> c) { assert(!a); tt.resize(n); cnt = 0, rr = 0, last = 1; } void ReceiveA(bool x) { cnt++, rr <<= 1; rr |= x; if(cnt == 11) tt[last] = rr, cnt = rr = 0, last++; } vector<int> Answer() { return tt; }
#include "Baijan.h" #include "bits/stdc++.h" using namespace std; #define ff first #define ss second const int N = 2e3+5; vector<pair<int, int>> edges[N]; vector<int> dd(N, 1e9+7); void InitB(int n, int b, vector<int> s, vector<int> t, vector<int> d) { for(int i=0;i<b;i++){ int a = s[i], b = t[i], c = d[i]; edges[a].push_back({b, c}), edges[b].push_back({a, c}); } priority_queue<pair<int, int>> qq; qq.push({0, 0}), dd[0] = 0; while(!qq.empty()){ auto u = qq.top(); qq.pop(); if(dd[u.ss] < -u.ff) continue; for(auto x : edges[u.ss]){ if(dd[x.ff] > dd[u.ss] + x.ss) dd[x.ff] = dd[u.ss] + x.ss, qq.push({-dd[x.ss], x.ss}); } } for(int i=1;i<n;i++){ for(int j=20;j>=0;j--) SendB(dd[i]>>j&1); } } /* 4 0 7 0 1 6 2 1 4 2 0 10 1 2 3 3 1 1 3 2 3 3 0 7 */ void ReceiveB(bool y) { }
#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...