답안 #603897

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
603897 2022-07-24T13:05:53 Z almothana05 Flight to the Ford (BOI22_communication) C++17
컴파일 오류
0 ms 0 KB
#include"communication.h"
#include"bits/stdc++.h"
using namespace std;
void encode(int N, int X) {
    if(X == 2){
        send(0);
        send(1);
        send(1);
        
    }
    else{
        send(1);
        send(0);
        sned(0);
    }
}

std::pair<int, int> decode(int N) {
    int numm , nummer , nummi;
    numm = receive();
    nummer = receive();
    nummi = recieve();
    if(numm == 0){
        if(nummer == 0 && nummi == 0){
            return {1 , 3};
        }
        else{
            return {1, 2};
        }
    }
    if(numm == 1){
        if(nummer == 1 && nummi == 1){
            return {1 , 2};
        }
        else{
            return {1, 3};
        }
    }
}

Compilation message

communication.cpp: In function 'void encode(int, int)':
communication.cpp:14:9: error: 'sned' was not declared in this scope; did you mean 'send'?
   14 |         sned(0);
      |         ^~~~
      |         send
communication.cpp: In function 'std::pair<int, int> decode(int)':
communication.cpp:22:13: error: 'recieve' was not declared in this scope; did you mean 'receive'?
   22 |     nummi = recieve();
      |             ^~~~~~~
      |             receive
communication.cpp:39:1: warning: control reaches end of non-void function [-Wreturn-type]
   39 | }
      | ^