Submission #428073

#TimeUsernameProblemLanguageResultExecution timeMemory
428073juggernautTwo Transportations (JOI19_transportations)C++17
Compilation error
0 ms0 KiB
#include"Azer.h" #include<bits/stdc++.h> using namespace std; int dist[2005],n; void InitA(int n,int a,vector<int>u,vector<int>v,vector<int>c){ ::n=n; } int pos=0,shift=0; void ReceiveA(bool x){ dist[pos]|=(x<<shift); shift++; if(shift==20){ shift=0; pos++; } } vector<int>Answer(){ vector<int>vec; for(int i=0;i<n;i++)vec.push_back(dist[i]); return vec; }
#include"Baijan.h" #include<bits/stdc++.h> using namespace std; vector<pair<int,int>>g[2005]; int dist[2005]; void InitB(int n,int b,vector<int>s,vector<int>t,vector<int>d){ for(int i=0;i<b;i++){ int &x=s[i]; int &y=t[i]; int &w=d[i]; g[x].emplace_back(y,w); g[y].emplace_back(x,w); } for(int i=0;i<n;i++)dist[i]=2e9; dist[0]=0; priority_queue<pair<int,int>>q; q.push({0,0}); while(!q.empty()){ int w=q.top().first; int v=q.top().second; q.pop(); if(-w>dist[v])continue; for(auto [to,w]:g[v])if(dist[to]>dist[v]+w){ dist[to]=dist[v]+w; q.push({-dist[to],to}); } } for(int i=0;i<n;i++) for(int j=0;j<20;j++)SendA(dist[i]>>j&1); } void ReceiveB(bool y){ }

Compilation message (stderr)

Baijan.cpp: In function 'void InitB(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
Baijan.cpp:29:30: error: 'SendA' was not declared in this scope; did you mean 'SendB'?
   29 |         for(int j=0;j<20;j++)SendA(dist[i]>>j&1);
      |                              ^~~~~
      |                              SendB