제출 #1311904

#제출 시각아이디문제언어결과실행 시간메모리
1311904eri16메시지 (IOI24_message)C++20
0 / 100
486 ms904 KiB
#include <bits/stdc++.h>
#include "message.h"
using namespace std;

using ll = long long;

void send_message(vector<bool> M, vector<bool> C){
    
    ll n = C.size();
    
    vector <bool> truth(31,true);
    vector <bool> lie(31,false);    
    
    ll index=-1;
    
    for (int i=0; i<31; i++){
        if (C[i]){send_packet(lie);}
        else{send_packet(truth);index=i;}
    }
    
    for (int i=0; i<M.size(); i++){
        vector <bool> ans = lie;
        ans[index]=true;
        send_packet(ans);
    }
}

vector<bool> receive_message(vector<vector<bool>> R){
    ll idx=-1;
    for (int i=0; i<31; i++){
        ll sm = 0;
        for (int j=0; j<31; j++){
            if (R[i][j]){sm++;}
        }
        if (sm>=16){idx=i;}
    }
    vector <bool> ans;
    for (int i=31; i<R.size(); i++){
        if (R[i][idx]){ans.push_back(true);}
        else{ans.push_back(false);}
    }
}

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

message.cpp: In function 'std::vector<bool> receive_message(std::vector<std::vector<bool> >)':
message.cpp:42:1: warning: no return statement in function returning non-void [-Wreturn-type]
   42 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...