Submission #1035996

#TimeUsernameProblemLanguageResultExecution timeMemory
1035996vjudge1Two Transportations (JOI19_transportations)C++17
Compilation error
0 ms0 KiB
#include "Azer.h" #include <bits/stdc++.h> using namespace std; int casef=0,NN_; vector<int>Ua,Va,Ca; void sendnum2(int n,int b){ for(int i=b;i--;) SendA(n>>i&1); } void sendedges(){ for(int i=0;i<Ua.size();i++){ sendnum2(Ua[i],11); sendnum2(Va[i],11); sendnum2(Ca[i],9); } sendnum2(0,31); } void InitA(int N, int A, std::vector<int> U, std::vector<int> V, std::vector<int> C) { NN_=N; Ua=U; Va=V; Ca=C; if(A<=1000)SendA(0),sendedges(); else SendA(1); casef=A>1000; } vector<int>bits; void ReceiveA(bool x) { bits.push_back(x); } std::vector<int> Answer() { if(casef) { vector<vector<pair<int,int>>>adj(NN_); int C=bits.size(); for(int i=0;i<C/31;i++){ int U=0,V=0,D=0; for(int j=0;j<11;j++) U=U*2+bits[i*31+j]; for(int j=11;j<22;j++) V=V*2+bits[i*31+j]; for(int j=22;j<31;j++) D=D*2+bits[i*31+j]; adj[U].push_back({V,D}); adj[V].push_back({U,D}); } for(int i=0;i<Ua.size();i++){ adj[Ua[i]].push_back({Va[i],Ca[i]}); adj[Va[i]].push_back({Ua[i],Ca[i]}); } vector<int>dist(NN_,1e9); priority_queue<pair<int,int>,vector<pair<int,int>>,greater<>>pq; dist[0]=0; pq.push({0,0}); while(pq.size()){ auto[d,x]=pq.top(); pq.pop(); if(dist[x]<d)continue; for(auto [v,w]:adj[x]) if(dist[v]>w+d) pq.push({dist[v]=w+d,v}); } return dist; } std::vector<int> ans(NN_); for(int i=0;i<bits.size();i++) ans[i/20]=ans[i/20]<<1|bits[i]; return ans; }

Compilation message (stderr)

Azer.cpp: In function 'void sendedges()':
Azer.cpp:13:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |         for(int i=0;i<Ua.size();i++){
      |                     ~^~~~~~~~~~
Azer.cpp: In function 'std::vector<int> Answer()':
Azer.cpp:49:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   49 |         for(int i=0;i<Ua.size();i++){
      |                     ~^~~~~~~~~~
Azer.cpp:68:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   68 |     for(int i=0;i<bits.size();i++)
      |                 ~^~~~~~~~~~~~

/usr/bin/ld: /tmp/ccquSJHH.o: in function `main':
grader_baijan.cpp:(.text.startup+0x174): undefined reference to `InitB(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
/usr/bin/ld: grader_baijan.cpp:(.text.startup+0x202): undefined reference to `ReceiveB(bool)'
collect2: error: ld returned 1 exit status