제출 #1122413

#제출 시각아이디문제언어결과실행 시간메모리
1122413enzyTwo Transportations (JOI19_transportations)C++14
컴파일 에러
0 ms0 KiB
#include "Azer.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn=2010;
const int inf=1e9+7;
vector<pair<int,int>>v[maxn];
int dist[maxn], m, cnt, at;
void dijkstra(){
    for(int i=1;i<m;i++) dist[i]=inf;
    set<pair<int,int>>s;
    for(int i=0;i<m;i++) s.insert({dist[i],i});
    while(!s.empty()){
        auto f=s.begin();
        int u=f->second; s.erase(f);
        for(auto p : v[u]){
            int viz=p.first, peso=p.second;
            if(dist[u]+peso<dist[viz]){
                s.erase({dist[viz],viz});
                dist[viz]=dist[u]+peso;
                s.insert({dist[viz],viz});
            }
        }
    }
}
void InitA(int N, int A, vector<int> U, vector<int> V,vector<int> C){
    m=N;
    for(int i=0;i<U.size();i++){
        v[U[i]].push_back({V[i],C[i]});
        v[V[i]].push_back({U[i],C[i]});
    }
    dijkstra();
}

void ReceiveA(bool x) {
    int id=(cnt/11);
    if(cnt%11==0) at=0;
    int k=(cnt%11);
    if(x) at+=(1<<k);
    if(k==10){
        if(id%3==0) U.push_back(at);
        if(id%3==1) V.push_back(at);
        if(id%3==2) C.push_back(at);
    }
    cnt++;
}

vector<int> Answer() {
    vector<int> ans(m);
    for(int i=0;i<m;i++) ans[i]=dist[i];
    return ans;
}
#include "Baijan.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn=2010;
int n;
void InitB(int N, int B, vector<int> S, vector<int> T,vector<int> D){
    n=N;
    for(int i=0;i<B;i++){
        int v=S[i], u=T[i], p=D[i];
        for(int k=0;k<11;k++){
            if(v&(1<<k)) SendB(1);
            else sendB(0);
        }
        for(int k=0;k<11;k++){
            if(u&(1<<k)) SendB(1);
            else sendB(0);
        }
        for(int k=0;k<11;k++){
            if(p&(1<<k)) SendB(1);
            else sendB(0);
        }
    }
}

void ReceiveB(bool y) {

}

컴파일 시 표준 에러 (stderr) 메시지

Azer.cpp: In function 'void InitA(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
Azer.cpp:27:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |     for(int i=0;i<U.size();i++){
      |                 ~^~~~~~~~~
Azer.cpp: In function 'void ReceiveA(bool)':
Azer.cpp:40:21: error: 'U' was not declared in this scope
   40 |         if(id%3==0) U.push_back(at);
      |                     ^
Azer.cpp:41:21: error: 'V' was not declared in this scope
   41 |         if(id%3==1) V.push_back(at);
      |                     ^
Azer.cpp:42:21: error: 'C' was not declared in this scope
   42 |         if(id%3==2) C.push_back(at);
      |                     ^

Baijan.cpp: In function 'void InitB(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
Baijan.cpp:12:18: error: 'sendB' was not declared in this scope; did you mean 'SendB'?
   12 |             else sendB(0);
      |                  ^~~~~
      |                  SendB
Baijan.cpp:16:18: error: 'sendB' was not declared in this scope; did you mean 'SendB'?
   16 |             else sendB(0);
      |                  ^~~~~
      |                  SendB
Baijan.cpp:20:18: error: 'sendB' was not declared in this scope; did you mean 'SendB'?
   20 |             else sendB(0);
      |                  ^~~~~
      |                  SendB