Submission #1122410

#TimeUsernameProblemLanguageResultExecution timeMemory
1122410enzyTwo Transportations (JOI19_transportations)C++14
6 / 100
847 ms10476 KiB
#include "Azer.h" #include <bits/stdc++.h> using namespace std; const int maxn=2010; int fare[maxn], cnt, m; void InitA(int N, int A, vector<int> U, vector<int> V,vector<int> C){ m=N; if((cnt/22)>=m) Answer(); } void ReceiveA(bool x) { int id=(cnt/22); int k=(cnt%22); if(x) fare[id]+=(1<<k); cnt++; } vector<int> Answer() { vector<int> ans(m); for(int i=0;i<m;i++) ans[i]=fare[i]; return ans; }
#include "Baijan.h" #include <bits/stdc++.h> using namespace std; const int maxn=2010; const int inf=1e9+7; vector<pair<int,int>>v[maxn]; int dist[maxn], n; void dijkstra(){ for(int i=1;i<n;i++) dist[i]=inf; set<pair<int,int>>s; for(int i=0;i<n;i++) s.insert({dist[i],i}); while(!s.empty()){ auto f=s.begin(); int u=f->second; s.erase(f); for(auto p : v[u]){ int viz=p.first, peso=p.second; if(dist[u]+peso<dist[viz]){ s.erase({dist[viz],viz}); dist[viz]=dist[u]+peso; s.insert({dist[viz],viz}); } } } } void InitB(int N, int B, vector<int> S, vector<int> T,vector<int> D){ n=N; for(int i=0;i<B;i++){ v[S[i]].push_back({T[i],D[i]}); v[T[i]].push_back({S[i],D[i]}); } dijkstra(); for(int i=0;i<n;i++){ for(int k=0;k<22;k++){ if(dist[i]&(1<<k)) SendB(1); else SendB(0); } } } 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...