QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#420806 | #67. Two Transportations | YuJiahe | 0 | 2ms | 19368kb | C++20 | 2.9kb | 2024-05-24 22:14:54 | 2024-05-24 22:14:54 |
Judging History
Azer
#include "Azer.h"
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
using namespace std;
typedef vector<int> vi;
const int N = 2005, L1 = 11, L2 = 9;
int cnt;
namespace Azer{bool vis[N];
int n, U, dis[N], e[N][N], Ls, Lr = L2, cr, xr, lst, cn, ttp;
void Send(int x){if ((cnt += x) > 58000) exit(1);
for (int i = 0;i < Ls;i ++) SendA(x >> i & 1);
}
void update(int u){cn ++;
for (int v = 1;v <= n;v ++) if (e[u][v])
dis[v] = min(dis[v], dis[u] + e[u][v]);vis[u] = 1;
}
void senddis(){if (cn == n) return;U = 0, Ls = L2;
for (int i = 1;i <= n;i ++)
if (!vis[i] && (!U || dis[i] < dis[U])) U = i;
Send(dis[U]);
}
void sendnod(){Ls = L1, Send(U);}
void recvdis(int x){
if (dis[U] <= x) ttp = -1, update(U), sendnod(), senddis();
else Lr = L1, ttp = x;
}
void recvnod(int u){if (ttp != -1) dis[u] = ttp;update(u), Lr = L2, senddis();}
void ReceiveA(bool x){
xr |= x << cr, cr ++;
if (cr == Lr){int tp = xr;
if (Lr == L2){xr = cr = 0, recvdis(tp);return;}
if (Lr == L1){xr = cr = 0, recvnod(tp);return;}
}
}
void InitA(int nn, int m, vi uu, vi vv, vi ww){
memset(dis, 0x3f, sizeof(dis)), dis[1] = 0;
for (int i = 0;i < m;i ++){
int u = uu[i] + 1, v = vv[i] + 1;
e[u][v] = e[v][u] = ww[i];
}n = nn, senddis();
}
vi Answer(){return vi(dis + 1, dis + n + 1);}
}
void InitA(int nn, int m, vi uu, vi vv, vi ww){Azer::InitA(nn, m, uu, vv, ww);}
void ReceiveA(bool x){Azer::ReceiveA(x);}
vi Answer(){return Azer::Answer();}
Baijan
#include "Baijan.h"
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
using namespace std;
typedef vector<int> vi;
const int N = 2005, L1 = 11, L2 = 9;
int cnt;
namespace Baijan{bool vis[N];
int n, U, dis[N], e[N][N], Ls, Lr = L2, cr, xr, lst, ttp;
void Send(int x){if ((cnt += x) > 58000) exit(1);
for (int i = 0;i < Ls;i ++) SendB(x >> i & 1);
}
void update(int u){
for (int v = 1;v <= n;v ++) if (e[u][v])
dis[v] = min(dis[v], dis[u] + e[u][v]);vis[u] = 1;
}
void senddis(){U = 0, Ls = L2;
for (int i = 1;i <= n;i ++)
if (!vis[i] && (!U || dis[i] < dis[U])) U = i;
Send(dis[U]);
}
void sendnod(){Ls = L1, Send(U);}
void recvdis(int x){senddis();
if (dis[U] < x) ttp = -1, update(U), sendnod();
else Lr = L1, ttp = x;
}
void recvnod(int u){if (ttp != -1) dis[u] = ttp;update(u), Lr = L2;}
void ReceiveB(bool x){
xr |= x << cr, cr ++;
if (cr == Lr){int tp = xr;
if (Lr == L2){xr = cr = 0, recvdis(tp);return;}
if (Lr == L1){xr = cr = 0, recvnod(tp);return;}
}
}
void InitB(int nn, int m, vi uu, vi vv, vi ww){
memset(dis, 0x3f, sizeof(dis)), dis[1] = 0;
for (int i = 0;i < m;i ++){
int u = uu[i] + 1, v = vv[i] + 1;
e[u][v] = e[v][u] = ww[i];
}n = nn;
}
}
void InitB(int nn, int m, vi uu, vi vv, vi ww){Baijan::InitB(nn, m, uu, vv, ww);}
void ReceiveB(bool x){Baijan::ReceiveB(x);}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 19028kb
input:
0 0 0 0 0 0 0 0 0 -1
output:
-1 0 0 0 0 0 0 0 0 0 -1
input:
output:
result:
wrong answer 1st lines differ - expected: '0', found: ''
Subtask #2:
score: 0
Wrong Answer
Test #7:
score: 8
Accepted
time: 1ms
memory: 3852kb
input:
0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 0 0 0 -1 -1
output:
-1 0 0 0 0 0 0 0 0 0 -1 -1 -1
input:
output:
0
result:
ok single line: '0'
Test #8:
score: 0
Wrong Answer
time: 1ms
memory: 18848kb
input:
0 0 0 0 0 0 0 0 0 -1
output:
-1 0 0 0 0 0 0 0 0 0 -1
input:
output:
result:
wrong answer 1st lines differ - expected: '0', found: ''
Subtask #3:
score: 0
Wrong Answer
Test #14:
score: 0
Wrong Answer
time: 2ms
memory: 17892kb
input:
0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 1 0 0 1 -1 0 0 1 0 1 1 1 0 0 0 0 1 1 0 1 1 1 0 0 1 -1 0 0 0 1 0 1 0 0 1 1 0 0 0 0 1 0 0 0 1 1 -1 0 0 1 0 1 0 0 0 0 0 0 1 0 0 1 1 1 1 1 0 -1 -1 -1
output:
-1 0 0 0 0 0 0 0 0 0 -1 1 0 1 0 0 1 0 1 1 -1 1 0 1 0 0 1 0 1 1 -1 1 0 1 0 0 1 0 1 1 -1 1 0 1 0 0 1 0 1 1 -1 -1
input:
output:
0 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 392 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 10611095...
result:
wrong answer 2nd lines differ - expected: '3328', found: '1061109567'
Subtask #4:
score: 0
Wrong Answer
Test #24:
score: 0
Wrong Answer
time: 2ms
memory: 10640kb
input:
0 0 0 0 0 0 0 0 0 -1
output:
-1 0 0 0 0 0 0 0 0 0 -1
input:
output:
result:
wrong answer 1st lines differ - expected: '0', found: ''
Subtask #5:
score: 0
Runtime Error
Test #38:
score: 0
Runtime Error
input:
0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 1 0 0 -1
output:
-1 0 0 0 0 0 0 0 0 0 -1
input:
output:
result:
wrong answer 1st lines differ - expected: '0', found: ''
Subtask #6:
score: 0
Wrong Answer
Test #51:
score: 0
Wrong Answer
time: 0ms
memory: 16520kb
input:
0 0 0 0 0 0 0 0 0 -1
output:
-1 0 0 0 0 0 0 0 0 0 -1
input:
output:
result:
wrong answer 1st lines differ - expected: '0', found: ''
Subtask #7:
score: 0
Wrong Answer
Test #64:
score: 0
Wrong Answer
time: 1ms
memory: 19368kb
input:
0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 -1 1 0 1 0 1 1 1 0 0 0 1 0 1 1 1 0 0 0 0 1 -1 -1 -1
output:
-1 0 0 0 0 0 0 0 0 0 -1 1 1 0 0 1 1 1 1 1 -1 1 1 0 0 0 1 1 1 1 -1 -1
input:
output:
0 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1061109567 1...
result:
wrong answer 2nd lines differ - expected: '25855', found: '1061109567'