이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Azer.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 2000;
const int MAXA = 5e5;
struct Edge
{
int u, v, w;
};
static int N, A;
static Edge E[MAXA+10];
static int ans[MAXN+10];
static int cnt=0;
vector<int> Answer()
{
vector<int> ret=vector<int>(ans, ans+N);
return ret;
}
void InitA(int _N, int _A, vector<int> _U, vector<int> _V, vector<int> _C)
{
N=_N; A=_A;
for(int i=0; i<A; i++) E[i]={_U[i], _V[i], _C[i]};
}
void ReceiveA(bool x)
{
if(x) ans[cnt/20]|=(1<<(cnt%20));
cnt++;
}
#include "Baijan.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 2000;
const int MAXB = 5e5;
const int INF = 1e9;
struct Edge
{
int u, v, w;
};
static int N, B;
static Edge E[MAXB+10];
static int ans[MAXN+10];
static vector<pii> adj[MAXN+10];
static int cnt=0;
struct Queue
{
int u, w;
bool operator < (const Queue &p) const
{
return w>p.w;
}
};
static int dist[MAXN+10];
void InitB(int _N, int _B, vector<int> _U, vector<int> _V, vector<int> _C)
{
N=_N; B=_B;
for(int i=0; i<B; i++) E[i]={_U[i], _V[i], _C[i]};
for(int i=0; i<B; i++)
{
int u=E[i].u, v=E[i].v, w=E[i].w;
adj[u].push_back({v, w});
adj[v].push_back({u, w});
}
for(int i=0; i<N; i++) dist[i]=INF;
priority_queue<Queue> PQ;
PQ.push({0, 0});
while(!PQ.empty())
{
Queue now=PQ.top(); PQ.pop();
if(dist[now.u]<=now.w) continue;
dist[now.u]=now.w;
for(auto nxt : adj[now.u]) PQ.push({nxt.first, nxt.second+now.w});
}
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 x)
{
}
컴파일 시 표준 에러 (stderr) 메시지
Baijan.cpp:22:12: warning: 'cnt' defined but not used [-Wunused-variable]
22 | static int cnt=0;
| ^~~
Baijan.cpp:20:12: warning: 'ans' defined but not used [-Wunused-variable]
20 | static int ans[MAXN+10];
| ^~~
# | 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... |