이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include"Azer.h"
#include<bits/stdc++.h>
using namespace std;
vector<pair<int,int>>g[2005];
int dist[2005],n,shift;
void InitA(int n,int a,vector<int>u,vector<int>v,vector<int>c){
::n=n;
for(int i=0;i<a;i++){
int &x=u[i];
int &y=v[i];
int &w=c[i];
g[x].emplace_back(y,w);
g[y].emplace_back(x,w);
}
}
queue<bool>q;
void ReceiveA(bool flag){
q.push(flag);
shift++;
if(shift==31){
int x=0,y=0,z=0;
shift=0;
for(int i=0;i<11;i++){
x|=(q.front()<<i);
q.pop();
}
for(int i=0;i<11;i++){
y|=(q.front()<<i);
q.pop();
}
for(int i=0;i<9;i++){
z|=(q.front()<<i);
q.pop();
}
g[x].emplace_back(y,z);
g[y].emplace_back(x,z);
}
}
vector<int>Answer(){
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});
}
}
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;
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];
for(int j=0;j<11;j++)SendB(x>>j&1);
for(int j=0;j<11;j++)SendB(y>>j&1);
for(int j=0;j<9;j++)SendB(w>>j&1);
}
}
void ReceiveB(bool y){
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |