이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Azer.h"
#include <bits/stdc++.h>
namespace {
int n,p,id;
int dist[2005];
}
void InitA(int N, int A, std::vector<int> U, std::vector<int> V, std::vector<int> C) {
::n = N;
::id = 0;
::p = 0;
}
void ReceiveA(bool x) {
if(p == 20){
::id++;
::p = 0;
}
if(x)::dist[::id] += (1<<::p);
::p++;
}
std::vector<int> Answer() {
std::vector<int> ans(n);
for(int i = 0; i < n; i++) {
ans[i] = dist[i];
}
return ans;
}
#include "Baijan.h"
#include <bits/stdc++.h>
namespace {
int dist[2005];
std::vector<int> adj[2005], w[2005];
} // namespace
void InitB(int n, int b, std::vector<int> s, std::vector<int> t, std::vector<int> d) {
for(int i = 1; i <= n; i++)dist[i] = 1e6+5;
for(int i = 0; i < b; i++){
::adj[s[i]].push_back(t[i]);
::w[s[i]].push_back(d[i]);
::adj[t[i]].push_back(s[i]);
::w[t[i]].push_back(d[i]);
}
std::set< std::pair<int,int>> st;
dist[0] = 0;
st.insert({dist[0],0});
while(!st.empty()){
int x = st.begin()->second; st.erase(st.begin());
for(int i = 0; i < (int)adj[x].size(); i++){
int viz = adj[x][i], p = w[x][i];
if(dist[viz] > dist[x] + p){
st.erase({dist[viz],viz});
dist[viz] = dist[x]+p;
st.insert({dist[viz],viz});
}
}
}
//for(int i = 0; i < n; i++)std::cerr<<dist[i]<<" ";
//std::cerr<<"\n";
for(int i = 0; i < n; i++)
for(int j = 0; j < 20; j++){
if(dist[i] & (1<<j))SendB(1);
else SendB(0);
}
}
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... |