#include "Azer.h"
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
namespace {
int N, A;
vector<pii> adj[2009];
int cnt = 0, u = 0, v = 0, c = 0;
long long ans[2009], L[2009];
} // namespace
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++) {
adj[U[i]].push_back({V[i], C[i]});
adj[V[i]].push_back({U[i], C[i]});
}
}
void ReceiveA(bool x) {
int X = x;
if(cnt % 31 < 11) u += (X << (cnt%31));
else if(cnt % 31 < 22) v += (X << (cnt%31 - 11));
else if(cnt % 31 < 31) c += (X << (cnt%31 - 22));
++cnt;
if(cnt % 31 == 0) {
adj[u].push_back({v, c});
adj[v].push_back({u, c});
u = v = c = 0;
}
if(cnt == 31000) {
for(int i=1; i<N; i++) L[i] = 1e9;
priority_queue<pii> pq; pq.push({0, 0});
while(pq.size()) {
int c, n; tie(c, n) = pq.top(); c *= -1; pq.pop();
if(L[n] != c) continue;
for(auto& it: adj[n]) {
int u, w; tie(u, w) = it;
if(L[u] > L[n] + w) {
L[u] = L[n] + w;
pq.push({-L[u], u});
}
}
}
for(int i=0; i<N; i++) ans[i] = L[i];
}
}
vector<int> Answer() {
vector<int> S(N);
for(int i=0; i<N; i++) S[i] = ans[i];
return S;
}
#include "Baijan.h"
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
namespace {
int N, B;
} // namespace
void InitB(int N, int B, vector<int> S, vector<int> T, vector<int> D) {
::N = N; ::B = B;
for(int i=0; i<B; i++) {
for(int j=0; j<11; j++) SendB((S[i] >> j) & 1);
for(int j=0; j<11; j++) SendB((T[i] >> j) & 1);
for(int j=0; j<9; j++) SendB((D[i] >> j) & 1);
}
for(int i=B; i<1000; i++) for(int j=0; j<31; j++) SendB(0);
return;
}
void ReceiveB(bool y) {
// assert(0);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
10 ms |
648 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
482 ms |
1344 KB |
Output is correct |
2 |
Correct |
320 ms |
1536 KB |
Output is correct |
3 |
Correct |
394 ms |
1808 KB |
Output is correct |
4 |
Correct |
974 ms |
54976 KB |
Output is correct |
5 |
Correct |
1056 ms |
48024 KB |
Output is correct |
6 |
Correct |
390 ms |
1592 KB |
Output is correct |
7 |
Correct |
996 ms |
48224 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
296 ms |
1472 KB |
Output is correct |
2 |
Correct |
534 ms |
1224 KB |
Output is correct |
3 |
Incorrect |
9 ms |
768 KB |
Wrong Answer [2] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
448 ms |
1320 KB |
Output is correct |
2 |
Correct |
408 ms |
1200 KB |
Output is correct |
3 |
Incorrect |
122 ms |
8336 KB |
Wrong Answer [2] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
448 ms |
1320 KB |
Output is correct |
2 |
Correct |
408 ms |
1200 KB |
Output is correct |
3 |
Incorrect |
122 ms |
8336 KB |
Wrong Answer [2] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
448 ms |
1320 KB |
Output is correct |
2 |
Correct |
408 ms |
1200 KB |
Output is correct |
3 |
Incorrect |
122 ms |
8336 KB |
Wrong Answer [2] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
10 ms |
648 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |