#include "Azer.h"
#include <vector>
namespace {
int N;
int variable_example[500000];
int cnt;
int ret[2000];
} // namespace
void InitA(int N, int A, std::vector<int> U, std::vector<int> V,
std::vector<int> C) {
}
void ReceiveA(bool x) {
ret[cnt/20+1]+=(x<<(cnt%20));
}
std::vector<int> Answer() {
std::vector<int> ans(N);
for (int k = 0; k < N; ++k) {
ans[k] = ret[k];
}
return ans;
}
#include "Baijan.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int n,m;
int cnt;
bool FunctionExample(bool P) {
return !P;
}
typedef pair<int,int> P;
vector<P> adj[2000];
bool vis[2000];
int dist[2000];
} // namespace
void InitB(int N, int B, std::vector<int> S, std::vector<int> T,
std::vector<int> D) {
n=N;
m=S.size();
for(int i=0;i<m;i++) {
adj[S[i]].push_back(P(T[i],D[i]));
adj[T[i]].push_back(P(D[i],T[i]));
}
for(int i=0;i<n;i++){
dist[i]=1e7;
}
priority_queue<P,vector<P>,greater<P>> pq;
pq.push(P(0,0));
dist[0]=0;
while (!pq.empty()) {
int now=pq.top().second;
pq.pop();
if (vis[now]) {
continue;
}
vis[now]=true;
for(int i=0;i<adj[now].size();i++) {
int nt=adj[now][i].first;
if (dist[nt]>dist[now]+adj[now][i].second) {
dist[nt]=dist[now]+adj[now][i].second;
pq.push(P(dist[nt],nt));
}
}
}
for(int i=1;i<n;i++) {
for(int j=0;j<20;j++) {
if (dist[i]&(1<<j)) {
SendB(true);
}
else {
SendB(false);
}
}
}
}
void ReceiveB(bool y) {
++cnt;
if (cnt < 58000) {
SendB(FunctionExample(y));
++cnt;
}
}
Compilation message
Azer.cpp:7:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
7 | int variable_example[500000];
| ^~~~~~~~~~~~~~~~
Baijan.cpp: In function 'void InitB(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
Baijan.cpp:40:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
40 | for(int i=0;i<adj[now].size();i++) {
| ~^~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
316 ms |
200 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
200 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
206 ms |
200 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
155 ms |
200 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
155 ms |
200 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
155 ms |
200 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
316 ms |
200 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |