#include "Azer.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int n,m;
typedef pair<int,int> P;
vector<P> adj[2000];
bool vis[2000];
int dist[2000];
int variable_example[500000];
int cnt=0;
int ret[2000];
int s[2000];
int t[2000];
int d[2000];
} // namespace
void InitA(int N, int A, std::vector<int> U, std::vector<int> V,
std::vector<int> C) {
n=N;
m=U.size();
for(int i=0;i<m;i++) {
adj[U[i]].push_back(P(V[i],C[i]));
adj[V[i]].push_back(P(U[i],C[i]));
}
}
void ReceiveA(bool x) {
int now=cnt%31;
if (now<11) {
s[cnt/31]+=(x<<now);
}
else if (now<22){
now-=11;
t[cnt/31]+=(x<<now);
}
else {
now-=22;
d[cnt/31]+=(x<<now);
}
cnt++;
}
std::vector<int> Answer() {
for(int i=0;i<cnt/31;i++) {
adj[s[i]].push_back(P(t[i],d[i]));
adj[t[i]].push_back(P(s[i],d[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;
memset(vis,0,sizeof(vis));
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));
}
}
}
std::vector<int> ans(n);
for (int k = 0; k < n; ++k) {
ans[k] = dist[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++) {
for(int j=0;j<11;j++) {
if (S[i]&(1<<j)) {
SendB(true);
}
else {
SendB(false);
}
}
for(int j=0;j<11;j++) {
if (T[i]&(1<<j)) {
SendB(true);
}
else {
SendB(false);
}
}
for(int j=0;j<9;j++) {
if (D[i]&(1<<j)) {
SendB(true);
}
else {
SendB(false);
}
}
}
}
void ReceiveB(bool y) {
++cnt;
if (cnt < 58000) {
SendB(FunctionExample(y));
++cnt;
}
}
Compilation message
Azer.cpp: In function 'std::vector<int> Answer()':
Azer.cpp:66: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]
66 | for(int i=0;i<adj[now].size();i++) {
| ~^~~~~~~~~~~~~~~~
Azer.cpp: At global scope:
Azer.cpp:14:5: warning: '{anonymous}::ret' defined but not used [-Wunused-variable]
14 | int ret[2000];
| ^~~
Azer.cpp:12:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
12 | int variable_example[500000];
| ^~~~~~~~~~~~~~~~
Baijan.cpp:16:5: warning: '{anonymous}::dist' defined but not used [-Wunused-variable]
16 | int dist[2000];
| ^~~~
Baijan.cpp:15:6: warning: '{anonymous}::vis' defined but not used [-Wunused-variable]
15 | bool vis[2000];
| ^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
328 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
656 KB |
Output is correct |
2 |
Correct |
201 ms |
832 KB |
Output is correct |
3 |
Correct |
255 ms |
880 KB |
Output is correct |
4 |
Correct |
432 ms |
27496 KB |
Output is correct |
5 |
Correct |
152 ms |
24052 KB |
Output is correct |
6 |
Correct |
223 ms |
676 KB |
Output is correct |
7 |
Correct |
476 ms |
24332 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
304 ms |
744 KB |
Output is correct |
2 |
Correct |
1 ms |
656 KB |
Output is correct |
3 |
Incorrect |
1 ms |
328 KB |
Wrong Answer [2] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
111 ms |
716 KB |
Output is correct |
2 |
Correct |
284 ms |
840 KB |
Output is correct |
3 |
Runtime error |
44 ms |
6588 KB |
Execution killed with signal 13 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
111 ms |
716 KB |
Output is correct |
2 |
Correct |
284 ms |
840 KB |
Output is correct |
3 |
Runtime error |
44 ms |
6588 KB |
Execution killed with signal 13 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
111 ms |
716 KB |
Output is correct |
2 |
Correct |
284 ms |
840 KB |
Output is correct |
3 |
Runtime error |
44 ms |
6588 KB |
Execution killed with signal 13 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
328 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |