이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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)>=N) 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<n;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 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... |