이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Azer.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
int n_A;
vector<pii > nei_A[2000];
vector<int> distanc;
int cnt;
int curr;
void InitA(int N, int A, std::vector<int> U, std::vector<int> V,
std::vector<int> C) {
n_A=N;
cnt=0;
curr=0;
}
void ReceiveA(bool x) {
if(x)curr+=(1<<cnt);
cnt++;
if(cnt==25){
//cout<<curr<<endl;
distanc.push_back(curr);
curr=0;
cnt=0;
}
}
std::vector<int> Answer() {
return distanc;
}
#include "Baijan.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
int n;
vector<pii > nei[2000];
int dist[2000];
void InitB(int N, int B, std::vector<int> S, std::vector<int> T,
std::vector<int> D) {
n=N;
rep(i,0,S.size()){
nei[S[i]].push_back(pii(T[i],D[i]));
nei[T[i]].push_back(pii(S[i],D[i]));
}
priority_queue<pii> pq;
rep(i,0,n)dist[i]=100000000;
dist[0]=0;
pq.push(pii(0,0));
while(!pq.empty()){
pii x=pq.top();pq.pop();
int u=x.first;
int d=-x.second;
if(d>dist[u])continue;
trav(v,nei[u]){
if(dist[v.first]>v.second+d){
dist[v.first]=v.second+d;
pq.push(pii(v.first,-dist[v.first]));
}
}
}
rep(i,0,n){
//cout<<dist[i]<<endl;
rep(j,0,25){
if((dist[i]&(1<<j))>0){
SendB(true);
}else SendB(false);
}
}
}
void ReceiveB(bool y) {
}
컴파일 시 표준 에러 (stderr) 메시지
Baijan.cpp: In function 'void InitB(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
Baijan.cpp:9:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
#define rep(i,a,b) for(int i=a;i<b;i++)
Baijan.cpp:17:7:
rep(i,0,S.size()){
~~~~~~~~~~~~
Baijan.cpp:17:3: note: in expansion of macro 'rep'
rep(i,0,S.size()){
^~~
# | 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... |