Submission #1102373

#TimeUsernameProblemLanguageResultExecution timeMemory
1102373ezzzayMessage (IOI24_message)C++17
0 / 100
608 ms420 KiB
#include "message.h" #include<bits/stdc++.h> using namespace std; #define ff first #define ss second #define pb push_back void send_message(std::vector<bool> M, std::vector<bool> C) { vector<int>vc; for(int i=0;i<31;i++){ vector<bool>v; if(C[i]==0)vc.pb(i); for(int j=0;j<31;j++){ v.pb(C[i]); } send_packet(v); } int n= M.size(); n= (n%16+16)%16; vector<bool>v; for(int i=0;i<31;i++){ if((1<<i)&n){ v.pb(1); } else{ v.pb(0); } } send_packet(v); for(int i=0;i<int(M.size());i+=16){ vector<bool>vec(31); for(int j=i;j<min(int(M.size()),i+16);j++){ vec[vc[j-i]]=M[j]; } send_packet(vec); } } std::vector<bool> receive_message(std::vector<std::vector<bool>> R) { vector<int>vc; for(int i=0;i<31;i++){ vector<bool>v=R[i]; sort(v.begin(),v.end()); if(v[15]==0){ vc.pb(i); } } int n=0; vector<bool>v=R[31]; for(int i=0;i<31;i++){ if(v[i]){ n+= (1<<i); } } vector<bool>M; for(int i=32;i<R.size();i++){ if(i==int(R.size())-1){ for(int j=0;j<n;j++){ M.pb(R[i][vc[j]]); } continue; } for(int j=0;j<16;j++){ M.pb(R[i][vc[j]]); } } return M; }

Compilation message (stderr)

message.cpp: In function 'std::vector<bool> receive_message(std::vector<std::vector<bool> >)':
message.cpp:59:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<bool> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   59 |  for(int i=32;i<R.size();i++){
      |               ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...