이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Azer.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int n;
int i = 0;
vector<int> ans;
int bit = 0;
} // namespace
void InitA(int N, int A, vector<int> U, vector<int> V,
vector<int> C) {
::n = N;
::ans = vector<int> (::n, 0);
// SendA(true);
}
void ReceiveA(bool x) {
if (x) {
::ans[::i] += (1 << ::bit);
}
::bit++;
if (::bit == 30) {
::bit = 0;
::i++;
}
}
vector<int> Answer() {
return ::ans;
}
#include "Baijan.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int n;
int count;
} // namespace
void InitB(int N, int B, vector<int> S, vector<int> T,
vector<int> D) {
int n = N;
int MAXN = 2000;
int INF = 1e9;
vector<int> ans(n, INF);
vector<pair<int, int>> adj[MAXN];
for (int i=0; i<B; i++) {
int u = S[i], v = T[i], w = D[i];
adj[u].push_back({v, w});
adj[v].push_back({u, w});
}
ans[0] = 0;
priority_queue<
pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>
> pq;
pq.push({0, 0});
while (!pq.empty()) {
int v = pq.top().second, d = pq.top().first;
pq.pop();
if (ans[v] < d) continue;
for (auto [viz, w] : adj[v]) {
if (ans[viz] > d + w) {
ans[viz] = d + w;
pq.push({d + w, viz});
}
}
}
for (int i=0; i<n; i++) {
// cerr << ans[i] << endl;
for (int b=0; b<30; b++) {
if (((1 << b) & ans[i]) != 0) SendB(true);
else SendB(false);
}
}
}
void ReceiveB(bool y) {
// ++count;
// if (count < 58000) {
// SendB(FunctionExample(y));
// ++count;
// }
}
컴파일 시 표준 에러 (stderr) 메시지
Baijan.cpp:8:5: warning: '{anonymous}::count' defined but not used [-Wunused-variable]
8 | int count;
| ^~~~~
Baijan.cpp:7:5: warning: '{anonymous}::n' defined but not used [-Wunused-variable]
7 | int n;
| ^
# | 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... |