Submission #902744

# Submission time Handle Problem Language Result Execution time Memory
902744 2024-01-11T01:55:20 Z heavylightdecomp Parrots (IOI11_parrots) C++14
17 / 100
2 ms 1312 KB
#include "encoder.h"
#include "encoderlib.h"
#include<bits/stdc++.h>
using namespace std;
#define vt vector
#define pb push_back
#define X first
#define Y second
using pii = pair<int,int>;
#define debug(x) do\
{auto _x=x; cerr<<#x<<" = "<<_x<<'\n';}while(0);
#define f0r(i,a,b) for(auto i=(a);i<(b);i++)
#define r0f(i,a,b) for(auto i=(a);i>=(b);i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
//Just encode the 8 bits in a single 8 bit integer
void encode(int N, int M[]) {
    assert(N == 8);
    int res = 0;
    f0r(i,0,8) {
        debug(M[i]);
        res |= (M[i] << i);
    }
    debug(res);
    send(res);
}
#include "decoder.h"
#include "decoderlib.h"
#include<bits/stdc++.h>
using namespace std;
#define vt vector
#define pb push_back
#define X first
#define Y second
using pii = pair<int,int>;
#define debug(x) do\
{auto _x=x; cerr<<#x<<" = "<<_x<<'\n';}while(0);
#define f0r(i,a,b) for(auto i=(a);i<(b);i++)
#define r0f(i,a,b) for(auto i=(a);i>=(b);i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
//Just decode the 8 bits
//potential bug: confusion between N and L
void decode(int msg_sz, int N, int xs[]) {
    int cur = xs[0];
    f0r(i,0,8) {
        //BUG: cast to boolean
        output(!!(cur & (1 << i)));
    }
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 808 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1312 KB Error : Output is wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 788 KB Error : Bad encoded integer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 788 KB Error : Bad encoded integer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 6
2 Runtime error 1 ms 600 KB Execution killed with signal 6
3 Runtime error 1 ms 604 KB Execution killed with signal 6
4 Runtime error 1 ms 604 KB Execution killed with signal 6
5 Runtime error 1 ms 604 KB Execution killed with signal 6
6 Runtime error 1 ms 760 KB Execution killed with signal 6
7 Runtime error 1 ms 764 KB Execution killed with signal 6