QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#700919 | #67. Two Transportations | TheZone | Compile Error | / | / | C++23 | 3.8kb | 2024-11-02 13:32:41 | 2024-11-02 13:32:42 |
Judging History
Azer
#include<bits/stdc++.h>
#include"Azer.h"
#define fi first
#define se second
using namespace std;
int n,m,nv,dis[2222],op,nx,nl,my,cnt;
bool vis[2222];
vector<pair<int,int> >e[2222];
void sd(int x,int l){
x=min(x,(1<<l)-1);
// cerr<<"A send "<<x<<" of len "<<l<<endl;
for(int i=0;i<l;i++) SendA(x>>i&1);
// cerr<<"A's send end\n";
}
void InitA(int N,int A,vector<int>U,vector<int>V,vector<int>C){
n=N,m=A;
for(int i=0;i<m;i++) e[U[i]+1].push_back({V[i]+1,C[i]});
for(int i=0;i<m;i++) e[V[i]+1].push_back({U[i]+1,C[i]});
sd(0,9);
memset(dis,0x3f,sizeof(dis));
dis[1]=op=my=0;
}
vector<int>Answer(){
vector<int>p;
for(int i=1;i<=n;i++) p.push_back(dis[i]);
return p;
}
void nxt(){
if(cnt==n) return;
int x=0;
for(int i=1;i<=n;i++) if(!vis[i]) if(dis[x]>dis[i]) x=i;
assert(dis[x]>=nv);
sd(dis[x]-nv,9);
my=dis[x]-nv;
}
void slv(int x){
for(auto i:e[x]) if(dis[i.fi]>dis[x]+i.se) dis[i.fi]=dis[x]+i.se;
cnt++;
vis[x]=1;
nxt();
}
void ReceiveA(bool X){
nx|=X<<nl;
nl++;
if(op==0&&nl==9){
// cerr<<"A rec "<<nx<<" of len 9\n";
if(nx<my){
nv+=nx;
op=1;
}
else{
nv+=my;
int ox=0;
for(int i=1;i<=n;i++) if(!vis[i]) if(dis[ox]>dis[i]) ox=i;
assert(dis[ox]==nv);
sd(ox,11);
slv(ox);
}
nx=nl=0;
return;
}
if(op==1&&nl==11){
// cerr<<"A rec "<<nx<<" of len 11\n";
dis[nx]=nv;
slv(nx);
nx=nl=op=0;
}
}
Baijan
#include<bits/stdc++.h>
#include"Baijan.h"
#define fi first
#define se second
using namespace std;
int n,m,nv,dis[2222],op,nx,nl,my,cnt;
bool vis[2222];
vector<pair<int,int> >e[2222];
void sd(int x,int l){
x=min(x,(1<<l)-1);
// cerr<<"B send "<<x<<" of len "<<l<<endl;
for(int i=0;i<l;i++) SendB(x>>i&1);
// cerr<<"B's send end\n";
}
void InitB(int N,int B,vector<int>U,vector<int>V,vector<int>C){
n=N,m=B;
for(int i=0;i<m;i++){ e[U[i]+1].push_back({V[i]+1,C[i]});}
for(int i=0;i<m;i++){ e[V[i]+1].push_back({U[i]+1,C[i]});}
memset(dis,0x3f,sizeof(dis));
dis[1]=op=my=0;
}
int nxt(){
int x=0;
for(int i=1;i<=n;i++) if(!vis[i]) if(dis[x]>dis[i]) x=i;
return x;
}
void slv(int x){
for(auto i:e[x]) if(dis[i.fi]>dis[x]+i.se) dis[i.fi]=dis[x]+i.se;
cnt++;
vis[x]=1;
}
void ReceiveB(bool X){
nx|=X<<nl;
nl++;
if(op==0&&nl==9){
// cerr<<"B rec "<<nx<<" of len 9\n";
int ot=nxt();
my=dis[ot]-nv;
sd(my,9);
if(nx<=my){
nv+=nx;
op=1;
}
else{
nv+=my;
sd(ot,11);
slv(ot);
op=0;
}
nx=nl=0;
return;
}
if(op==1&&nl==11){
// cerr<<"B rec "<<nx<<" of len 11\n";
dis[nx]=nv;
slv(nx);
nx=nl=op=0;
}
}
Details
Azer.code: In function ‘void InitA(int, int, std::vector<int>, std::vector<int>, std::vector<int>)’: Azer.code:17:43: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’ 17 | for(int i=0;i<m;i++) e[U[i]+1].push_back({V[i]+1,C[i]}); | ^ Azer.code:17:56: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’ 17 | for(int i=0;i<m;i++) e[U[i]+1].push_back({V[i]+1,C[i]}); | ^ Azer.code:18:43: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’ 18 | for(int i=0;i<m;i++) e[V[i]+1].push_back({U[i]+1,C[i]}); | ^ Azer.code:18:56: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’ 18 | for(int i=0;i<m;i++) e[V[i]+1].push_back({U[i]+1,C[i]}); | ^ Azer.code: In function ‘void slv(int)’: Azer.code:37:11: error: ‘i’ does not name a type 37 | for(auto i:e[x]) if(dis[i.fi]>dis[x]+i.se) dis[i.fi]=dis[x]+i.se; | ^ Azer.code:37:67: error: expected ‘;’ before ‘cnt’ 37 | for(auto i:e[x]) if(dis[i.fi]>dis[x]+i.se) dis[i.fi]=dis[x]+i.se; | ^ | ; 38 | cnt++; | ~~~ Azer.code:39:10: error: expected ‘)’ before ‘;’ token 39 | vis[x]=1; | ^ | ) Azer.code:37:5: note: to match this ‘(’ 37 | for(auto i:e[x]) if(dis[i.fi]>dis[x]+i.se) dis[i.fi]=dis[x]+i.se; | ^ In file included from grader_Azer.cpp:2: testlib.h: In member function ‘std::vector<T> random_t::distinct(int, T, T)’: testlib.h:997:9: error: ‘uint64_t’ was not declared in this scope; did you mean ‘u_int64_t’? 997 | uint64_t n = to - from + 1; | ^~~~~~~~ | u_int64_t testlib.h:998:30: error: ‘n’ was not declared in this scope 998 | if (uint64_t(size) > n) | ^ testlib.h:1007:32: error: ‘n’ was not declared in this scope 1007 | expected += double(n) / double(n - i + 1); | ^ testlib.h:1009:31: error: ‘n’ was not declared in this scope 1009 | if (expected < double(n)) { | ^ grader_Azer.cpp: In function ‘int main(int, char**)’: grader_Azer.cpp:37:13: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] 37 | char *t = "/dev/null"; | ^~~~~~~~~~~