This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include"communication.h"
#include<bits/stdc++.h>
using namespace std;
void encode(int N, int X){
for(int i=0;i<30;i++){
while(send(1)){
send(X>>i&1);
}
}
}
pair<int, int> decode(int N) {
int num=0;
for(int i=0;i<30;i++){
while(receive()){
num|=receive()<<i;
}
}
return {num,num};
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |