답안 #983622

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
983622 2024-05-15T19:18:46 Z user736482 Two Transportations (JOI19_transportations) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include<Azer.h>
using namespace std;
vector<int> answer,akliczby;
int p,akwaga=1,akbit=-1,rec;
vector<bool>tym;
void InitA(int N, int A, vector<int>U,vector<int>V,vector<int>C ){
    set<pair<int,pair<int,int>>>krawedzie;
    for(int i=0;i<N;i++){
        answer.push_back(9999999);
    }
    anwer[0]=0;
    for(int i=0;i<A;i++){
        krawedzie.insert({C[i],{U[i],V[i]}});
    }
    while(krawedzie.size()!=N-1){
        p=2*2;
    }
    
}
void ReceiveA(bool x){
    if(akbit==-1){
        if(!x)
            akbit=0;
        else
            akwaga++;
    }
    else{
        tym.push_back(x);
        akbit++;
        if(akbit==11){
            akbit=-1;
            rec=0;
            for(itn i=10;i>=0;i--){
                rec*=2;
                rec+=tym[i];
            }
            akliczby.push_back(rec);
            if(akliczby.size()==2){
                krawedzie.insert({akwaga,{akliczby[0],akliczby[1]}});
                akliczby.clear();
            }
        }
    }
}
vector<int> Answer(){
    return answer;
}
#include<bits/stdc++.h>
#include<Baijan.h>
using namespace std;
 
void InitB(int N, int B, vector<int>U,vector<int>V,vector<int>C ){
    set<pair<int,pair<int,int>>>krawedzie;
    int akwaga=1,ak;
    for(int i=0;i<B;i++){
        krawedzie.insert({C[i],{U[i],V[i]}});
    }
    for(auto i=krawedzie.begin();i!=krawedzie.end();i++){
        while((*i).first>akwaga){
            akwaga++;
            SendB(1);
        }
        SendB(0);
        ak=(*i).second.first;
        for(int i=0;i<11;i++){
            SendB(ak%2);
            ak/=2;
        }
        ak=(*i).second.second;
        for(int i=0;i<11;i++){
            SendB(ak%2);
            ak/=2;
        }
    }
}
void ReceiveB(bool y){
    
}

Compilation message

Azer.cpp: In function 'void InitA(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
Azer.cpp:12:5: error: 'anwer' was not declared in this scope; did you mean 'answer'?
   12 |     anwer[0]=0;
      |     ^~~~~
      |     answer
Azer.cpp:16:27: warning: comparison of integer expressions of different signedness: 'std::set<std::pair<int, std::pair<int, int> > >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   16 |     while(krawedzie.size()!=N-1){
      |           ~~~~~~~~~~~~~~~~^~~~~
Azer.cpp: In function 'void ReceiveA(bool)':
Azer.cpp:34:17: error: 'itn' was not declared in this scope; did you mean 'int'?
   34 |             for(itn i=10;i>=0;i--){
      |                 ^~~
      |                 int
Azer.cpp:34:26: error: 'i' was not declared in this scope
   34 |             for(itn i=10;i>=0;i--){
      |                          ^
Azer.cpp:40:17: error: 'krawedzie' was not declared in this scope
   40 |                 krawedzie.insert({akwaga,{akliczby[0],akliczby[1]}});
      |                 ^~~~~~~~~